oracle权限管理

授权原则:最小权限原则

通过角色给用户授权可以方便简化管理员管理权限

业务账号创建:
  创建特定表空间:
    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';

原文地址:https://www.cnblogs.com/fanxuanhui-linux/p/7091847.html