Cookies on this site

We would like to use cookies to understand how the site is used and to measure our campaigns. Nothing is set until you choose, and you can change your mind at any time from “Cookie settings” at the foot of every page. Privacy policy

Contact UsContact Us

Resources / Blogs

Oracle & databases

Identifying Blocking Sessions in Oracle Database

Query to find out blocking sessions and the sessions that are getting blocked by these blockers.

· · 1 min read

Blocking Sessions in Oracle Database

Below SQL gives the blocker and blockee sessions in database.

Oracle RAC Environment:

select
(select username from gv$session where sid=a.sid) blocker,
a.sid,
'is blocking',
(select username from gv$session where sid=b.sid) blockee,
b.sid
from gv$lock a, gv$lock b
where a.block > 0
and b.request > 0
and a.id1=b.id1
and a.id2=b.id2;

Oracle Non-RAC Environment:

select
(select username from v$session where sid=a.sid) blocker,
a.sid,
'is blocking',
(select username from v$session where sid=b.sid) blockee,
b.sid
from v$lock a, v$lock b
where a.block > 0
and b.request > 0
and a.id1=b.id1
and a.id2=b.id2;

← All articles

Case studies

Oracle Consulting in practice

Client names are withheld. We are happy to share details on a call.

All case studies
  • Delivered

    30 TB, zero downtime

    Financial services

    Oracle

    Zero-downtime move of a 30 TB Oracle database for a global retail bank

    The bank's transaction database served thousands of users around the clock. We built the new Oracle 12c RAC platform on IBM AIX alongside the old Solaris system, kept the two in sync with Oracle GoldenGate, tested everything and switched over with no downtime and no data loss.

    • 30 TB moved with zero downtime
    • Zero data loss at cut-over
  • Delivered

    Zero downtime

    Legal technology

    Oracle

    Sybase to Oracle with zero downtime for an e-discovery company

    Sybase was holding back a platform that processes large volumes of legal data. We converted the schema, kept both databases in sync with continuous replication, validated the data and switched over without interrupting the business.

    • Zero downtime at cut-over
    • No disruption to client workflows
  • Delivered

    No service disruption

    Local government

    Oracle

    A city's Oracle database moved off ageing Solaris hardware

    A major California city ran a mission-critical Oracle database on Solaris servers nearing end of life. We mapped the dependencies, confirmed the applications would work unchanged and re-platformed the database to Linux without disrupting public services.

    • No disruption to public services
    • Minimal application changes

Keep reading

All Oracle & databases articles

Planning an Oracle or database migration?

Request a migration plan consult with the DBAs who do this work, and leave with a fixed-scope plan.