oracle grant 授權語句


--select * from dba_users; 查詢數據庫中的所有用戶

  --alter user TEST_SELECT account lock; 鎖住用戶

  --alter user TEST_SELECT account unlock; 給用戶解鎖

  --create user xujin identified by   xujin; 建立用戶

  --grant create tablespace to xujin; 授權

  --grant select on tabel1 to xujin; 授權查詢

  --grant update on table1 to xujin;

  --grant execute on procedure1 to xujin 授權存儲過程

  --grant update on table1 to xujin with grant option; 授權更新權限轉移給xujin用戶,許進用戶可以繼續授權;

  --收回權限

  --revoke select on table1 from xujin1; 收回查詢select表的權限;

  --revoke all on table1 from xujin;

  /*grant connect to xujin;

  revoke connect from xujin

  grant select on xezf.cfg_alarm to xujin;

  revoke select on xezf.cfg_alarm from xujin;*/

  --select table_name,privilege from dba_tab_privs where grantee='xujin' 查詢一個用戶擁有的對象權限

  --select * from dba_sys_privs where grantee='xujin' 查詢一個用戶擁有的系統權限

  --select * from session_privs --當前會話有效的系統權限

  --角色

  --create role xujin1;--建立xujin1角色

  --grant insert on xezf.cfg_alarm to xujin1; 將插入表的信息

  --revoke insert on xezf.cfg_alarm from xujin1; 收回xujin1角色的權限

  --grant xujin1 to xujin ; 將角色的權限授權給xujin;

  -- create role xujin2;

  --grant xujin1 to xujin2; 將角色xujin1授權給xujin2;

  --alter user xujin default xujin1,xujin2; 修改用戶默認角色

  -- DROP ROLE xujin1;刪除角色1;

  --select * from role_sys_privs where role=xujin1;

  --查看許進1角色下有什么系統權限;

  --select granted_role,admin_option from role_role_privs where role='xujin2';

  --查看xujin1角色下面有什么角色權限

  --select * from role_sys_privs where role='xujin2';

  --select table_name,privilege from role_tab_privs where role='xujin1';

  --select * from dba_role_privs where grantee='xujin' --查看用戶下面有多少個角色;


免責聲明!

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



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