Oracle Lock Information Queries
--Find out what objects are locked.
select
c.owner,
c.object_name,
c.object_type,
b.sid,
b.serial#,
b.status,
b.osuser,
b.machine
from
v$locked_object a ,
v$session b,
dba_objects c
where
b.sid = a.session_id
and
a.object_id = c.object_id;
--Find out all blocking locks
select * from v$lock where block > 0;
--Find out blocker and blockee
select
(select username || ' - ' || osuser from v$session where sid=a.sid) blocker,
a.sid || ', ' ||
(select serial# from v$session where sid=a.sid) sid_serial,
' is blocking ',
(select username || ' - ' || osuser from v$session where sid=b.sid) blockee,
b.sid || ', ' ||
(select serial# from v$session where sid=b.sid) sid_serial
from v$lock a, v$lock b
where a.block = 1
and b.request > 0
and a.id1 = b.id1
and a.id2 = b.id2;
select
c.owner,
c.object_name,
c.object_type,
b.sid,
b.serial#,
b.status,
b.osuser,
b.machine
from
v$locked_object a ,
v$session b,
dba_objects c
where
b.sid = a.session_id
and
a.object_id = c.object_id;
--Find out all blocking locks
select * from v$lock where block > 0;
--Find out blocker and blockee
select
(select username || ' - ' || osuser from v$session where sid=a.sid) blocker,
a.sid || ', ' ||
(select serial# from v$session where sid=a.sid) sid_serial,
' is blocking ',
(select username || ' - ' || osuser from v$session where sid=b.sid) blockee,
b.sid || ', ' ||
(select serial# from v$session where sid=b.sid) sid_serial
from v$lock a, v$lock b
where a.block = 1
and b.request > 0
and a.id1 = b.id1
and a.id2 = b.id2;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/638844/viewspace-776963/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE LOCK,LATCH,PINOracle
- ORACLE LOCK MODE 1.2.3.4.5.6Oracle
- ORACLE基礎之oracle鎖(oracle lock mode)詳解Oracle
- [20220128]Check the datapump file header information in Oracle.txtHeaderORMOracle
- Oracle:ORA-01219:database not open:queries allowed on fixed tables/views onlyOracleDatabaseView
- GCD QueriesGC
- Oracle RAC Cache Fusion 系列十:Oracle RAC Enqueues And Lock Part 1OracleENQ
- 【TUNE_ORACLE】等待事件之“library cache lock”Oracle事件
- PG: Utility queries
- oracle ORA-01157: cannot identify/lock data file 64OracleIDE
- Oracle Enqueues Wait Events 三 enq: TX - row lock contentionOracleENQAI
- F. Scalar Queries
- Trees and XOR Queries AgainAI
- F - Two Sequence Queries
- Tree – Information TheoryORM
- CF1093G [Multidimensional Queries]
- [LeetCode] 2080. Range Frequency QueriesLeetCode
- SAP Spartacus 中的 Commands and queries
- Testing JPA Queries with Spring Boot and @DataJpaTestSpring Boot
- oracle資料庫事務transaction鎖lock模式思考之一Oracle資料庫模式
- oracle資料庫事務transaction 不同的鎖lock型別Oracle資料庫型別
- [Information Security] What is WEPORM
- oracle事務transaction鎖lock一點兒小思考或總結Oracle
- 【ASK_ORACLE】LOCK_SGA引數失效的解決辦法Oracle
- PostgreSQL DBA(170) - pgAdmin(Queries For Index Maintenance)SQLIndexAINaN
- 標準裝置的-media queries
- PostgreSQL DBA(36) - PG 12 Inlined WITH queriesSQLinline
- Oracle 11g 密碼延遲認證與 library cache lock 等待Oracle密碼
- System Volume Information是什麼檔案 System Volume Information可以刪除嗎ORM
- cf375D. Tree and Queries(莫隊)
- LeetCode之Sum of Even Numbers After Queries(Kotlin)LeetCodeKotlin
- 題解:CF644B Processing Queries
- Educational Codeforces Round 19 E. Array Queries
- Lock 鎖
- 當刪除oracle資料庫user時發生row cache lock 等待事件Oracle資料庫事件
- 【ASK_ORACLE】Library cache pin 與 library load lock的關係和區別Oracle
- mysql innodb lock鎖之record lock之一MySql
- information_schema的結構ORM
- Python | 資訊熵 Information EntropyPython熵ORM