oracle許可權管理

來源:互聯網
上載者:User

標籤: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許可權管理

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.