創建和管理用戶作業


創建和管理用戶作業

1. 創建一個口令認證的數據用戶usera_exer,口令為usera,默認表空間為USERS,配額為10MB,初始賬戶為鎖定狀態。(需要在system或sys用戶下創建。)

2. 為usera_exer用戶授予create session權限、scott.emp的select權限和update權限,同時允許該用戶將獲得的權限授予其他用戶。

3. 創建一個口令認證的數據庫用戶userb_exer,口令為userb。

4. 將用戶usera_exer的賬戶解鎖。

5. 用usera_exer登錄數據庫,查詢和更新scott.emp中的數據,同時,將scott.emp的select和update權限授予用戶 userb_exer。
usera_exer登錄數據庫

查詢scott.emp中的數據

更新scott.emp中的數據

將scott.emp的select和update權限授予用戶 userb_exer。

參考代碼

create user usera_exer identified by usera 
default tablespace users quota 10M on users account lock;

grant create session to usera_exer with admin option;
grant select,update on scott.emp to usera_exer with grant option;

create user userb_exer identified by userb;

alter user usera_exer account unlock;

conn usera_exer/usera;
select * from scott.emp;
update scott.emp set ename='ASIA' where ename='KING';
grant select,update on scott.emp to userb_exer;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM