檢視ORACLE中鎖定物件

zhouwf0726發表於2019-05-07
檢視ORACLE中鎖定物件

SQL> update a set id=100;

3 rows updated

SQL> SELECT SID FROM V$MYSTAT WHERE ROWNUM=1;

SID
----------
154

SQL>
SQL> select * from v$access
2 where sid=154
3 ;

SID OWNER OBJECT TYPE
---------- ---------------------------------------------------------------- -------------------------------------------------------------------------------- ------------------------
154 SYS STANDARD PACKAGE
154 SYS X$KGLOB TABLE
154 ROME V$ACCESS CURSOR
154 SYS PENDING_SUB_SESSIONS$ CURSOR
154 SYS X$KGLLK TABLE
154 SYS PENDING_SESSIONS$ CURSOR
154 SYS DBMS_TRANSACTION PACKAGE
154 PUBLIC SYS NON-EXISTENT
154 SYS X$KGLDP TABLE
154 SYS X$KSUSE TABLE
154 SYS GV$ACCESS VIEW
154 SYS V$ACCESS VIEW
154 SYS PENDING_TRANS$ TABLE
154 SYS SYS NON-EXISTENT
154 SYS V_$ACCESS VIEW
154 PUBLIC V$ACCESS SYNONYM
154 SYS DBMS_APPLICATION_INFO PACKAGE

17 rows selected

SQL> SELECT A.OWNER,
2 A.OBJECT_NAME,
3 B.XIDUSN,
4 B.XIDSLOT,
5 B.XIDSQN,
6 B.SESSION_ID,
7 B.ORACLE_USERNAME,
8 B.OS_USER_NAME,
9 B.PROCESS,
10 B.LOCKED_MODE,
11 C.MACHINE,
12 C.STATUS,
13 C.SERVER,
14 C.SID,
15 C.SERIAL#,
16 C.PROGRAM
17 FROM ALL_OBJECTS A,
18 V$LOCKED_OBJECT B,
19 V$SESSION C
20 WHERE ( A.OBJECT_ID = B.OBJECT_ID )
21 AND (B.PROCESS = C.PROCESS )
22 ORDER BY 1,2;

OWNER OBJECT_NAME XIDUSN XIDSLOT XIDSQN SESSION_ID ORACLE_USERNAME OS_USER_NAME PROCESS LOCKED_MODE MACHINE STATUS SERVER SID SERIAL# PROGRAM
------------------------------ ------------------------------ ---------- ---------- ---------- ---------- ------------------------------ ------------------------------ ------------ ----------- ---------------------------------------------------------------- -------- --------- ---------- ---------- ----------------------------------------------------------------
ROME A 5 22 7490 154 ROME DP07Administrator 368:3936 3 WORKGROUPNAMEDP07 INACTIVE DEDICATED 138 430 plsqldev.exe
ROME A 5 22 7490 154 ROME DP07Administrator 368:3936 3 WORKGROUPNAMEDP07 INACTIVE DEDICATED 139 9 plsqldev.exe
ROME A 5 22 7490 154 ROME DP07Administrator 368:3936 3 WORKGROUPNAMEDP07 INACTIVE DEDICATED 158 320 plsqldev.exe
ROME A 5 22 7490 154 ROME DP07Administrator 368:3936 3 WORKGROUPNAMEDP07 ACTIVE DEDICATED 154 30 plsqldev.exe
ROME A 5 22 7490 154 ROME DP07Administrator 368:3936 3 WORKGROUPNAMEDP07 INACTIVE DEDICATED 140 329 plsqldev.exe

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/756652/viewspace-242393/,如需轉載,請註明出處,否則將追究法律責任。

相關文章