1 one, unlock the user2 --Modify the time format3 AlterSessionSetNls_date_format= 'YYYY-MM-DD Hh24:mi:ss';4 5 --Check lock Time6 SelectUsername,lock_date fromDba_userswhereUsername like 'ODS';7 8 --Querying user Status9 SelectUsername,account_status fromDba_userswhereUsernameinch('od','Yxx');Ten One --Unlocking Users A Alter UserYxx Account Unlock
1 second, unlock the data table2 --01. Note that your users have no permissions issues3 SELECTP.spid, a.serial#, C.object_name, b.session_id, B.oracle_username,4 B.os_user_name5 fromv$process P, v$session A, v$locked_object B, all_objects c6 WHEREP.addr=A.paddr andA.process=b.process7 andC.object_id =B.object_id8 ---1, with table name query9 Select object_name, Machine, S.sid, s.serial#Ten fromv$locked_object L, dba_objects o, v$session s One whereL.object_id =O.object_id A andl.session_id=S.sid; - - --2. Get the sid,serial parameters for unlocking the - SelectS.username, S.osuser, S.sid, s.serial#, P.spid fromv$session s,v$process P - whereS.paddr=P.addr andS.username is not NULL; - --2.1. Splicing SQL + Select 'alter system kill session'," '"||Trim (T2.SID)||','||Trim (t2.serial#)||" ";' - fromV$locked_object t1,v$session T2wheret1.session_id=T2.sidOrder byT2.logon_time; + A ---2: Execute SQL to unlock at AlterSystemKillSession'198,12231'; - AlterSystemKillSession'194,37558';
Iii. The process of Ching dead system--Query Process IDSELECTA.username, C.spid asOS_PROCESS_ID, C.pid asoracle_process_id fromv$session A, v$process cWHEREC.addr=a.paddr andA.sid=2323 anda.serial#=213;---kill off the processLinux execution:KILL -9Spid;window Execution: Orakill oracle_sid SPID
Unlock users and database tables, lock the process