Whether the Oracle database query object is locked and unlocked
For details about whether the Oracle database object is locked, see the following SQL statement and the unlock process:
-- Query the locked objects of the current user
Select B. OBJECT_NAME, B. OWNER, C. SID, C. SERIAL #, C. OSUSER, C. MACHINE, C. TERMINAL
From v $ LOCKED_OBJECT A, DBA_OBJECTS B, V $ SESSION C
Where a. OBJECT_ID = B. OBJECT_ID
And a. SESSION_ID = C. SID
AND c. STATUS = 'inactive'
And c. TYPE = 'user'
Order by 1;
-- Unlock statement
DECLARE
V_ SQL VARCHAR2 (500 );
CURSOR C_SESSION IS
Select B. OBJECT_NAME,
B. OWNER,
C. sid as SESSION_ID,
C. SERIAL # as serial #,
C. OSUSER,
C. MACHINE,
C. TERMINAL
From v $ LOCKED_OBJECT A, DBA_OBJECTS B, V $ SESSION C
Where a. OBJECT_ID = B. OBJECT_ID AND A. SESSION_ID = C. SID
And c. STATUS = 'inactive' and c. TYPE = 'user'
Order by 1;
BEGIN
FOR GET_SESSION IN C_SESSION
LOOP
BEGIN
V_ SQL: = 'alter SYSTEM KILL SESSION ''' | GET_SESSION.SESSION_ID | ',' | GET_SESSION.SERIAL # | '''immediate ';
Execute immediate V_ SQL;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
End loop;
END;
/
Installing Oracle 12C in Linux-6-64
RHEL6.4 _ 64 install a single instance Oracle 12cR1
New Features of Oracle 12C: Paging Query
12 new features of Oracle 12C