程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Oracle數據庫 >> Oracle教程 >> Oracle用戶解鎖

Oracle用戶解鎖

編輯:Oracle教程

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

已連接。

 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved