1600 PMP mock questions 1400 CAPM mock questions 800 SCJP 6 mock questions 600 OCAJP 7 mock questions 590 OCPJP 7 mock questions 556 SCWCD 5 mock questions 500 OCEJWCD 6 mock questions pdfDownload (java,struts, hibernet etc)

ORACLE Tutorials

LOCK / UNLOCK an oracle user

LOCK / UNLOCK an oracle user:

In spite of deleting an oracle user, we can LOCK it.
In that way the user won?t be accessible. In future if we want we can UNLOCK it.

create a user named techfaq360 which is LOCKED:

SQL> create user techfaq360 identified by techfaq360 account lock;

User created.

Now grant him the CONNECT & RESOURCE privilege:

SQL> grant connect, resource to techfaq360;

Grant succeeded.

Now, try to connect the user:

SQL> conn techfaq360/techfaq360;
ERROR:
ORA-28000: the account is locked

Warning: You are no longer connected to ORACLE.

Now, connect to the SYS accout:

SQL> conn sys as sysdba
Enter password:
Connected.
SQL>

Now, see the account status:

SQL> select USERNAME,ACCOUNT_STATUS,LOCK_DATE from dba_users where USERNAME=?techfaq360?;

USERNAME ACCOUNT_STATUS LOCK_DATE
------------------------------ -------------------------------- ---------
techfaq360 LOCKED 10-OCT-08To, unlock the techfaq360:

SQL> alter user techfaq360 account unlock;

User altered.

SQL>
SQL> conn techfaq360/techfaq360;
Connected.

==================

Otherwise we can do one thing, we can revoke its CONNECT privilage. In that way the user can?t connect to the db.

SQL> revoke connect from techfaq360;

Revoke succeeded.

SQL> conn techfaq360/techfaq360;
ERROR:
ORA-01045: user techfaq360 lacks CREATE SESSION privilege; logon denied


Warning: You are no longer connected to ORACLE.

SQL> conn sys as sysdba
Enter password:
Connected.
SQL>
SQL> grant connect to techfaq360;

Grant succeeded.

SQL>
SQL> conn techfaq360/techfaq360;
Connected.

Reviews and Comments


PMP, CAPM, PMI is a registered certification mark of the Project Management Institute, Inc

Copyright © www.techfaq360.com 2016


About US | Contact US | Privacy Policy | Terms and Conditions  | Website disclaimer  | Cancellation and Refund Policy  | Shipping & Delivery Policy