Home | Mirror | Search |
select username,account_status from dba_users;
SQL> show user; USER is "SYS" SQL> select user from dual; USER ------------------------------ SYS
用戶預設表空間
SQL> SELECT DEFAULT_TABLESPACE FROM DBA_USERS WHERE USERNAME='WCUSER'; DEFAULT_TABLESPACE ------------------------------ WCSDB SQL> SELECT DEFAULT_TABLESPACE FROM DBA_USERS WHERE USERNAME=(select user from dual); DEFAULT_TABLESPACE ------------------------------ SYSTEM
帳號加鎖與解鎖
alter user scott account unlock /lock;SQL> alter user scott account unlock; User altered. SQL> select username,account_status from dba_users where username='SCOTT'; USERNAME ACCOUNT_STATUS ------------------------------ -------------------------------- SCOTT EXPIRED SQL> alter user scott account lock; User altered. SQL> select username,account_status from dba_users where username='SCOTT'; USERNAME ACCOUNT_STATUS ------------------------------ -------------------------------- SCOTT EXPIRED & LOCKED SQL>