Oracle用户解锁

首先先连接上

SQL*Plus: Release 12.1.0.2.0 Production on 星期四 2月 12 15:40:422015

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

请输入用户名:  system

输入口令:

上次成功登录时间: 星期四 2月  12 2015 10:26:40 +08:00

连接到:

Oracle Database 12c Enterprise EditionRelease 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, AdvancedAnalytics and Real Application Testing opt

Ions

//对相应的列惊醒格式化操作,以便观察

SQL> column username format a20

SQL> column account_status format a20

SQL> set pagesize 400

//输入下面这条select语句,从dba_users查询用户以及状态信息

SQL> select username,account_status fromdba_users

USERNAME            ACCOUNT_STATUS

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

C##TEST              OPEN

C##SCOTT             OPEN

ORACLE_OCM           EXPIRED & LOCKED

OJVMSYS              EXPIRED & LOCKED

SYSKM                EXPIRED & LOCKED

XS$NULL              EXPIRED & LOCKED

GSMCATUSER           EXPIRED & LOCKED

MDDATA               EXPIRED & LOCKED

SYSBACKUP            EXPIRED & LOCKED

DIP                  EXPIRED & LOCKED

SYSDG                EXPIRED & LOCKED

APEX_PUBLIC_USER     EXPIRED & LOCKED

SPATIAL_CSW_ADMIN_US EXPIRED & LOCKED

R

 

SPATIAL_WFS_ADMIN_US EXPIRED & LOCKED

R

 

GSMUSER              EXPIRED & LOCKED

AUDSYS                EXPIRED& LOCKED

C##USER1              OPEN

FLOWS_FILES           EXPIRED& LOCKED

DVF                   EXPIRED & LOCKED

MDSYS                 EXPIRED& LOCKED

ORDSYS                EXPIRED& LOCKED

DBSNMP               EXPIRED & LOCKED

WMSYS                EXPIRED & LOCKED

APEX_040200          EXPIRED & LOCKED

APPQOSSYS            EXPIRED & LOCKED

GSMADMIN_INTERNAL    EXPIRED & LOCKED

ORDDATA              EXPIRED & LOCKED

CTXSYS               EXPIRED & LOCKED

ANONYMOUS            EXPIRED & LOCKED

XDB                  EXPIRED & LOCKED

ORDPLUGINS           EXPIRED & LOCKED

DVSYS                EXPIRED & LOCKED

SI_INFORMTN_SCHEMA   EXPIRED & LOCKED

OLAPSYS              EXPIRED & LOCKED

LBACSYS              EXPIRED & LOCKED

OUTLN                EXPIRED & LOCKED

SYSTEM               OPEN

SYS                 OPEN

已选择 38 行。

如上面所示,如果username对应的account_status为open,表示该用户解锁, 如果username对应的account_status为EXPIRED,表示该用户已经过期,如果username对应的account_status为locked,表示该用户锁定。使用过期的或者锁定的账号是登陆不上的,我们必须先对用户解锁。

//接下来我们对outln用户进行解锁

SQL> alter user outln account unlock;

用户已更改。

//给该用户指定口令

SQL> alter user outln identified byadmin;

用户已更改。

//我们再查询所用用户

SQL> select username,account_status fromdba_users;

USERNAME             ACCOUNT_STATUS

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

C##TEST              OPEN

C##SCOTT             OPEN

ORACLE_OCM           EXPIRED & LOCKED

OJVMSYS              EXPIRED & LOCKED

SYSKM                EXPIRED & LOCKED

XS$NULL              EXPIRED & LOCKED

GSMCATUSER           EXPIRED & LOCKED

MDDATA               EXPIRED & LOCKED

SYSBACKUP            EXPIRED & LOCKED

DIP                  EXPIRED & LOCKED

SYSDG                EXPIRED & LOCKED

APEX_PUBLIC_USER     EXPIRED & LOCKED

SPATIAL_CSW_ADMIN_US EXPIRED & LOCKED

R

SPATIAL_WFS_ADMIN_US EXPIRED & LOCKED

R

GSMUSER              EXPIRED & LOCKED

AUDSYS               EXPIRED & LOCKED

C##USER1             OPEN

FLOWS_FILES          EXPIRED & LOCKED

DVF                  EXPIRED & LOCKED

MDSYS                EXPIRED & LOCKED

ORDSYS               EXPIRED & LOCKED

DBSNMP               EXPIRED & LOCKED

WMSYS                EXPIRED & LOCKED

APEX_040200          EXPIRED & LOCKED

APPQOSSYS            EXPIRED & LOCKED

GSMADMIN_INTERNAL    EXPIRED & LOCKED

ORDDATA              EXPIRED & LOCKED

CTXSYS               EXPIRED & LOCKED

ANONYMOUS            EXPIRED & LOCKED

XDB                  EXPIRED & LOCKED

ORDPLUGINS           EXPIRED & LOCKED

DVSYS                EXPIRED & LOCKED

SI_INFORMTN_SCHEMA   EXPIRED & LOCKED

OLAPSYS              EXPIRED & LOCKED

LBACSYS              EXPIRED & LOCKED

OUTLN                OPEN

SYSTEM               OPEN

SYS                  OPEN

已选择 38 行。

如上,outln已经显示为open。

//测试连接

SQL> connect outln/admin

已连接。

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。