Oracle解锁与加锁(hr用户为例)

WBOY
Lepaskan: 2016-06-07 15:15:01
asal
1161 orang telah melayarinya

欢迎进入Oracle社区论坛,与200万技术人员互动交流 >>进入 SQL*Plus: Release 9.2.0.4.0 - Production on Tue Jul 14 18:12:38 2009 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. SQL conn sys/sys as sysdba Connected. SQL show u

欢迎进入Oracle社区论坛,与200万技术人员互动交流 >>进入

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

  Copyright (c) 1982, 2002, 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;(解锁)

  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;(更改密码)

  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;(加锁)

  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;(密码失效)

  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.

Oracle解锁与加锁(hr用户为例)

Label berkaitan:
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan