Oacle 권한 관리

2783 단어 데이터 뱅 크
1. 보기
select * from user_sys_privs;--          
select * from user_tab_privs;--           
select * from user_sys_privs;--          
select * from user_tab_privs;--           

1.      :
  select * from dba_users;
  select * from all_users;
  select * from user_users;

2.           (               ):
  select * from dba_sys_privs;
  select * from user_sys_privs;
 
3.    (             )      
sql>select * from role_sys_privs;

4.        :
  select * from dba_tab_privs;
  select * from all_tab_privs;
  select * from user_tab_privs;

5.      :
  select * from dba_roles;

6.             :
  select * from dba_role_privs;
  select * from user_role_privs;
 
7.       sysdba sysoper    (         )
select * from V$PWFILE_USERS
 
         wzsb      :
SQL> select * from dba_sys_privs where grantee='WZSB';
 
GRANTEE                        PRIVILEGE                                ADMIN_OPTION
------------------------------ ---------------------------------------- ------------
WZSB                           CREATE TRIGGER                           NO
WZSB                           UNLIMITED TABLESPACE                     NO

         wzsb      :
SQL> select * from dba_role_privs where grantee='WZSB';
 
GRANTEE   GRANTED_ROLE   ADMIN_OPTION  DEFAULT_ROLE
------------------------------ ------------------------------ ------------ ------------
WZSB                           DBA                         NO              YES

              
select privilege from dba_sys_privs where grantee='WZSB'
union
select privilege from dba_sys_privs where grantee in 
(select granted_role from dba_role_privs where grantee='WZSB' );

2. 관리
--              
drop user xxx   cascade;

--        
create user xxx   identified by 1234;

--    
grant  dba to  xxx;

--    
revoke dba from xxx;

--            
grant create session to xxx;

--          
grant unlimited tablespace to xxx;
grant create tablespace to xxx;
grant alter tablespace to xxx;
grant drop tablespace to xxx;
grant manage tablespace to xxx;

--            
revoke unlimited tablespace from xxx;
revoke create tablespace from xxx;
revoke alter tablespace from xxx;
revoke drop tablespace from xxx;
revoke manage tablespace from xxx;

grant create session to zhangsan;--  zhangsan    session   ,     
grant unlimited session to zhangsan;--  zhangsan          
grant create table to zhangsan;--        
grant drop table to   zhangsan;--        
grant insert table to zhangsan;--      
grant update table to zhangsan;--      

grant select on tablename to zhangsan;--  zhangsan          
grant drop on tablename to zhangsan--        
grant insert on tablename to zhangsan;--       
grant update on tablename to zhangsan;--        

좋은 웹페이지 즐겨찾기