Home | 簡體中文 | 繁體中文 | 雜文 | 打賞(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎專欄 | Search | Email

第 9 章 Privilege

目錄

9.1. Account
9.1.1. show user
9.1.2. DEFAULT_TABLESPACE
9.1.3. unlock/lock
9.2. User
9.2.1. Create user
9.2.2. Drop user
9.2.3. Alter user
9.2.4. 修改密碼
9.2.5. Reset Password 忘記密碼重置密碼
9.3. grant
9.3.1. 列出權限
9.3.2. 查看用戶權限
9.3.3. 吊銷權限
9.3.4. System Privileges 系統權限
9.3.4.1. EM 權限
9.3.4.2. Granting and Revoking SYSDBA and SYSOPER Privileges
9.3.5. Object Privileges 對象權限
9.4. Opening the Encrypted Wallet

9.1. Account

select username,account_status from dba_users; 

select username,account_status from dba_users where account_status='OPEN';

select username,account_status from dba_users t where t.default_tablespace = 'USERS' and t.account_status = 'OPEN';
		

9.1.1. show user

			
SQL> show user;
USER is "SYS"

SQL> select user from dual;

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

9.1.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


SQL> select username,account_status from dba_users t where t.default_tablespace = 'USERS' and t.account_status = 'OPEN';

USERNAME                       ACCOUNT_STATUS
------------------------------ --------------------------------
FINANCE                        OPEN
NEWS                           OPEN
			
			

9.1.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>