Home | Mirror | Search

2. Account

select username,account_status from dba_users; 
		

2.1. show user

			
SQL> show user;
USER is "SYS"

SQL> select user from dual;

USER
------------------------------
SYS

			
			

2.2. DEFAULT_TABLESPACE

用戶預設表空間

			
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

			
			

2.3. unlock/lock

帳號加鎖與解鎖

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>
			
			
comments powered by Disqus