標籤:employee 管理 最小 count acl sys user sysdba tempfile
授權原則:最小許可權原則
通過角色給使用者授權可以方便簡化管理員系統管理權限
業務帳號建立:
建立特定資料表空間:
CREATE TABLESPACE TBS1 DATAFILE ‘/u01/app/oracle/oradata/PROD4/PROD4/TBS1.DBF‘ SIZE 100M;
建立特點暫存資料表空間:
create temporary tablespace temp2 tempfile ‘/u01/app/oracle/oradata/PROD4/PROD4/temp2.dbf‘ size 50m ;
建立業務使用者:
create user "mytest" profile "DEFAULT" identified by 123456 default tablespace "tbs1" temporary tablespace "temp2" account unlock;
給使用者授權:
grant RESOURCE to mytest;
給員工建立oracle帳號:
SQL> create user fxh identified by "123456";
SQL> grant connect to fxh;
SQL> grant select on hr.employees to fxh;
帳戶解鎖
SQL> alter user hr identified by 123456 account unlock;
許可權查詢:
1、查詢某個使用者具有的許可權:
查詢某個使用者具有的角色:
select grantee,granted_role from dba_role_privs where grantee=‘HR‘;
查詢某個使用者具有的系統許可權:
select grantee,privilege from dba_sys_privs where grantee=‘HR‘;
查詢某個使用者具有的對象許可權:
select GRANTEE,OWNER,TABLE_NAME,PRIVILEGE from dba_tab_privs WHERE grantee=‘HR‘;
2、查詢某個角色的許可權:
查詢某個角色具有的對像許可權:
SQL> select * from role_tab_privs where role=‘AA‘;
查詢某個角色中具有什麼系統許可權:
select privilege from role_sys_privs where role=‘RESOURCE‘;
查詢某個角色中包含有什麼角色
select granted_role from role_role_privs where role=‘SYSDBA‘;
oracle許可權管理