SQL> Select s.SID session_id, s.machine, s.serial #, 2 s.useine, 3 Decode (LMODE, 4 0, 5 'None', 6 1, 7 'Null', 8 2, 9 'ROW- S (SS) ', 10 3, 11' ROW-X (SX) ', 12 4, 13' Share ', 14 5, 15' S / ROW-X (SSX) ', 16 6, 17' Exclusive ', 18 TO_CHAR (LMODE)) MODE_HELD, 19 DECODE (Request, 20 0, 21 'None', 22 1, 23 'Null', 24 2, 25 'Row-S (SS)', 26 3, 27 'Row-X (SX) ', 28 4, 29' Share ', 30 5, 31' S / ROW-X (SSX) ', 32 6, 33' Exclusive ', 34 TO_CHAR (REQUEST) MODE_REQUESTED, 35 o.WNER || '.' || O. Object_name || '(' || object_type || ')' AS Lock Table, S.Type Lock_Type, 36 L.ID1 LOCK_ID1, 37 L.ID2 LOCK_ID2 38 from V $ LOCK L, SYS.DBA_OBJECTS O, V $ session s 39 where l.sid = s.SID 40 and L.ID1 = O.Object_ID;
SESSION_ID MACHINE SERIAL # username mode_held mode_requested Lock table lock_type lock_id1 lock_id2 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------ ------------------------------------------------ ------------------------------------------------------------------------------------------- -------- ------------------------------------------------------------------------ ------------------------------------ -------- ---------- 2 KJC03 1 Share None Sys.c_obj # (Cluster) Background 2 0 2 KJC03 1 Share None sys.i_obj # (Index) Background 3 0 2 KJC03 1 Share None Sys.
Tab $ (Table) Background 4 0 2 KJC03 1 Share None Sys.
CLU $ (TABLE) Background 5 0 2 KJC03 1 Share None Sys.c_ts # (Cluster) Background 6 0 2 KJC03 1 Share None sys.i_ts # (index) Background 7 0 2 KJC03 1 Share none sys.c_file # _block # Cluster) Background 8 0 2 KJC03 1 Share none sys.i_file # _block # (index) Background 9 0 2 KJC03 1 Share None sys.c_user # (cluster) Background 10 0 2 KJC03
1 Share None sys.i_user # (Index) Background 11 0 2 KJC03 1 Share None Sys.FET $ (TABLE) Background 12 0 2 KJC03 1 Share None Sys.uet $ (Table) Background 13 0 2 KJC03 1 Share None sys.seg $ (TABLE) Background 14 0 2 KJC03 1 Share None sys.undo $ (TABLE) Background 15 0 2 KJC03 1 Share None Sys.ts $ (TABLE)
Background 16 0 2 KJC03 1 Share None Sys.File $ (Table) Background 17 0 2 KJC03 1 Share None Sys.Obj $ (Table) Background 18 0 2 KJC03 1 Share None Sys.ind $ (Table) Background 19 0 2 KJC031 Share None sys.job $ (TABLE) Background 201 0 2 KJC03 1 Share None Sys.icol $ (Table) Background 20 0
SESSION_ID MACHINE SERIAL # username mode_held mode_requested Lock table lock_type lock_id1 lock_id2 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------ ------------------------------------------------ ------------------------------------------------------------------------------------------- -------- ------------------------------------------------------------------------ ------------------------------------ -------- ---------- 2 KJC03 1 Share none sys.i_job_job (Index) Background 202 0 2 KJC03 1 Share None Sys.col $ (Table) Background 21 0 4 KJC03 1 NULL NONE SYS.
Tab $ (TABLE) Background 4 0 5 KJC03 1 ROW-X (SX) None sys.c_obj # (Cluster) Background 2 124 Rows SELECTED
Simulation table lock
SQL> SELECT * from a for update;
Group # thread # sequence # bytes Members Archived Status first_change # first_time ----------------------- --- ---------- ------------------------------------- ----------- 2 1 32 104857600 1 Yes inactive 865718 2005-2-23 1 3 1 33 104857600 1 No Current 909949 2005-2-23 1 1
SQL>
Query the locked table
SQL> /
Session_id Machine Serial # username mode_held mode_reque locked table lock_type lock_id1 lock_id2 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---- ---------------------------------------------------------------------------------------------------------------------- ---------------------- ---------- ---------- 2 KJC03 1 Share None Sys .C_obj # (Cluster) Background 2 0 2 KJC03 1 Share None sys.i_obj # (Index) Background 3 0 2 KJC03 1 Share None sys.tab $ (TABLE) Background 4 0 2 KJC03 1 Share None Sys.Clu $ (Table ) Background 5 0 2 kJC03 1 Share none sys.c_ts # (Cluster) Background 6 0 2 KJC03 1 Share None sys.i_ts # (index) Background 7 0 2 KJC03 1 Share None sys.c_file # _block # (Cluster) Background 8 0 2 KJC03 1 Share none sys.i_file # _block # (index) Background 9 0 2 KJC03 1 Share none sys.c_user # (Cluster) Background 10 0 2 KJC03 1 Share None sys.i_user # (Index) Background 11 0 2 KJC03 1 Share None SYS.
FET $ (TABLE) Background 12 0 2 KJC03 1 Share None Sys.uet $ (Table) Background 13 0 2 KJC03 1 Share None Sys.SEG $ (TABLE) Background 14 0 2 KJC03 1 Share None sys.undo $ (Table) Background 15 0 2 KJC03 1 Share None Sys.ts $ (Table) Background 16 0 2 KJC03 1 Share None Sys.File $ (TABLE) Background 17 0 2 KJC03 1 Share None Sys.obj $ (Table) Background 18 0 2 KJC03 1 Share None Sys.ind $ (TABLE) Background 19 0 2 KJC03 1 Share None sys.job $ (TABLE) Background 201 0 2 KJC03 1 Share None Sys.icol $ (Table) Background 20 0
Session_id Machine Serial # username mode_held mode_reque locked table lock_type lock_id1 lock_id2 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---- ---------------------------------------------------------------------------------------------------------------------- ---------------------- ---------- ---------- 2 KJC03 1 Share None Sys .I_job_job (Index) Background 202 0 2 KJC03 1 Share None sys.col $ (TABLE) Background 21 0 4 KJC03 1 NULL NONE SYS.TAB $ (TABLE) Background 4 0 5 KJC03 1 ROW-X (SX) None Sys. C_OBJ # (Cluster) Background 2 1 26 MSHOME / LUXUEZHU 163 SYS ROW-S (SS) None sys.a (table) user 35133 025 ROWS SELECTED
SQL>