Oracle命令 授權 收回許可權 角色

2021-08-31 12:08:24 字數 1987 閱讀 8352

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' --檢視使用者下面有多少個角色;

Oracle 各種許可權 顯示授權

alter any cluster 修改任意簇的許可權 alter any index 修改任意索引的許可權 alter any role 修改任意角色的許可權 alter any sequence 修改任意序列的許可權 alter any snapshot 修改任意快照的許可權 alter any...

Oracle基本授權命令

首先需要建立乙個表空間 1.建立表空間 2.規定檔案路徑 3.設定檔案大小 自動增長開啟 create tablespace product datafile e product.dbf size 10m autoextend on 建立使用者 1.建立使用者 2.設定密碼 3.設定預設的表空間 c...

sqlplus常見命令,角色,許可權,授權

建立使用者 create user 使用者名稱 identified by密碼 鎖定使用者 alter user 使用者名稱 account lock 解鎖 alter user 使用者名稱 account unlock 登入 conn 使用者名稱 密碼 登出 disconn 退出 exit 授權 ...