oracle grant

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' --查看用戶下面有多少個角色;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章