Oracle unlocking and locking (for hr Users)

Source: Internet
Author: User
Welcome to the Oracle community forum and interact with 2 million technical staff to access SQL * Plus: Release9.2.0.4.0

Welcome to the Oracle community forum and interact with 2 million technical staff> go to SQL * Plus: Release 9.2.0.4.0-Production on Tue Jul 14 18:12:38 2009 Copyright (c) 1982,200 2, Oracle Corporation. all rights reserved. SQL conn sys/sys as sysdba Connected. SQL show u

Welcome to the Oracle community forum and interact with 2 million technical staff> enter

SQL * Plus: Release 9.2.0.4.0-Production on Tue Jul 14 18:12:38 2009

Copyright (c) 1982,200 2, Oracle Corporation. All rights reserved.

SQL> conn sys/sys as sysdba

Connected.

SQL> show user

USER is "SYS"

SQL> desc dba_users

Name Null? Type

-----------------------------------------------------------------------------

Username not null VARCHAR2 (30)

USER_ID NOT NULL NUMBER

PASSWORD VARCHAR2 (30)

ACCOUNT_STATUS not null VARCHAR2 (32)

LOCK_DATE DATE

EXPIRY_DATE DATE

DEFAULT_TABLESPACE not null VARCHAR2 (30)

TEMPORARY_TABLESPACE not null VARCHAR2 (30)

CREATED NOT NULL DATE

Profile not null VARCHAR2 (30)

INITIAL_RSRC_CONSUMER_GROUP VARCHAR2 (30)

EXTERNAL_NAME VARCHAR2 (4000)

SQL> set lines 200

SQL> select username, account_status from dba_users;

USERNAME ACCOUNT_STATUS

--------------------------------------------------------------

SYS OPEN

SYSTEM OPEN

DBSNMP OPEN

SCOTT OPEN

Outln expired & LOCKED

Wmsys expired & LOCKED

Ordsys expired & LOCKED

Ordplugins expired & LOCKED

Mdsys expired & LOCKED

Ctxsys expired & LOCKED

Xdb expired & LOCKED

USERNAME ACCOUNT_STATUS

--------------------------------------------------------------

Anonymous expired & LOCKED

Wksys expired & LOCKED

Wkproxy expired & LOCKED

Odm expired & LOCKED

ODM_MTR EXPIRED & LOCKED

Olapsys expired & LOCKED

Hr expired & LOCKED

Oe expired & LOCKED

Pm expired & LOCKED

SQL> alter user hr account unlock; (unlock)

User altered.

SQL> select username, account_status from dba_users;

USERNAME ACCOUNT_STATUS

--------------------------------------------------------------

SYS OPEN

SYSTEM OPEN

DBSNMP OPEN

SCOTT OPEN

HR EXPIRED

Outln expired & LOCKED

Wmsys expired & LOCKED

Ordsys expired & LOCKED

Ordplugins expired & LOCKED

QL> alter user hr identified by hr; (Change Password)

User altered.

SQL> select username, account_status from dba_users;

USERNAME ACCOUNT_STATUS

--------------------------------------------------------------

SYS OPEN

SYSTEM OPEN

DBSNMP OPEN

SCOTT OPEN

HR OPEN

Outln expired & LOCKED

SQL> conn hr/hr

Connected.

SQL> conn/as sysdba

Connected.

SQL> alter user hr account lock; (lock)

User altered.

SQL> select username, account_status from dba_users;

USERNAME ACCOUNT_STATUS

--------------------------------------------------------------

SYS OPEN

SYSTEM OPEN

DBSNMP OPEN

SCOTT OPEN

HR LOCKED

Outln expired & LOCKED

SQL> alter user hr password expire; (the password is invalid)

User altered.

SQL> select username, account_status from dba_users;

USERNAME ACCOUNT_STATUS

--------------------------------------------------------------

SYS OPEN

SYSTEM OPEN

DBSNMP OPEN

SCOTT OPEN

Outln expired & LOCKED

Wmsys expired & LOCKED

Olapsys expired & LOCKED

Hr expired & LOCKED

Oe expired & LOCKED

Pm expired & LOCKED

SQL> conn hr/hr

ERROR:

ORA-28000: the account is locked

Warning: You are no longer connected to ORACLE.

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.