Unlock users and database tables, lock the process

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.