《oracle用户解锁与加锁》由会员分享,可在线阅读,更多相关《oracle用户解锁与加锁(3页珍藏版)》请在金锄头文库上搜索。
1、SQL*Plus: Release 9.2.0.4.0 - Production on Tue Jul 14 18:12:38 2009Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.SQL conn sys/sys as sysdbaConnected.SQL show userUSER is SYSSQL desc dba_usersName Null? Type- - -USERNAME NOT NULL VARCHAR2(30)USER_ID NOT NULL NUMBERPASSWORD VARCHA
2、R2(30)ACCOUNT_STATUS NOT NULL VARCHAR2(32)LOCK_DATE DATEEXPIRY_DATE DATEDEFAULT_TABLESPACE NOT NULL VARCHAR2(30)TEMPORARY_TABLESPACE NOT NULL VARCHAR2(30)CREATED NOT NULL DATEPROFILE NOT NULL VARCHAR2(30)INITIAL_RSRC_CONSUMER_GROUP VARCHAR2(30)EXTERNAL_NAME VARCHAR2(4000)SQL set lines 200SQL select
3、username,account_status from dba_users;USERNAME ACCOUNT_STATUS- -SYS OPENSYSTEM OPENDBSNMP OPENSCOTT OPENOUTLN EXPIRED & LOCKEDWMSYS EXPIRED & LOCKEDORDSYS EXPIRED & LOCKEDORDPLUGINS EXPIRED & LOCKEDMDSYS EXPIRED & LOCKEDCTXSYS EXPIRED & LOCKEDXDB EXPIRED & LOCKEDUSERNAME ACCOUNT_STATUS- -ANONYMOUS
4、EXPIRED & LOCKEDWKSYS EXPIRED & LOCKEDWKPROXY EXPIRED & LOCKEDODM EXPIRED & LOCKEDODM_MTR EXPIRED & LOCKEDOLAPSYS EXPIRED & LOCKEDHR EXPIRED & LOCKEDOE EXPIRED & LOCKEDPM EXPIRED & LOCKEDSQL alter user hr account unlock;(解锁)User altered.SQL select username,account_status from dba_users;USERNAME ACCO
5、UNT_STATUS- -SYS OPENSYSTEM OPENDBSNMP OPENSCOTT OPENHR EXPIREDOUTLN EXPIRED & LOCKEDWMSYS EXPIRED & LOCKEDORDSYS EXPIRED & LOCKEDORDPLUGINS EXPIRED & LOCKEDQL alter user hr identified by hr;(更改密码)User altered.SQL select username,account_status from dba_users;USERNAME ACCOUNT_STATUS- -SYS OPENSYSTEM
6、 OPENDBSNMP OPENSCOTT OPENHR OPENOUTLN EXPIRED & LOCKEDSQL conn hr/hrConnected.SQL conn /as sysdbaConnected.SQL alter user hr account lock;(加锁)User altered.SQL select username,account_status from dba_users;USERNAME ACCOUNT_STATUS- -SYS OPENSYSTEM OPENDBSNMP OPENSCOTT OPENHR LOCKEDOUTLN EXPIRED & LOC
7、KEDSQL alter user hr password expire;(密码失效)User altered.SQL select username,account_status from dba_users;USERNAME ACCOUNT_STATUS- -SYS OPENSYSTEM OPENDBSNMP OPENSCOTT OPENOUTLN EXPIRED & LOCKEDWMSYS EXPIRED & LOCKEDOLAPSYS EXPIRED & LOCKEDHR EXPIRED & LOCKEDOE EXPIRED & LOCKEDPM EXPIRED & LOCKEDSQL conn hr/hrERROR:ORA-28000: the account is lockedWarning: You are no longer connected to ORACLE.