2011-03-18 110 views

回答

4

這裏是如何你找到你的用戶的權限:

select 
    lpad(' ', 2*level) || granted_role "User, his roles and privileges" 
from 
    (
    /* THE USERS */ 
    select 
     null  grantee, 
     username granted_role 
    from 
     dba_users 
    /* THE ROLES TO ROLES RELATIONS */ 
    union 
    select 
     grantee, 
     granted_role 
    from 
     dba_role_privs 
    /* THE ROLES TO PRIVILEGE RELATIONS */ 
    union 
    select 
     grantee, 
     privilege 
    from 
     dba_sys_privs 
) 
start with grantee is null 
connect by grantee = prior granted_role; 

這將顯示哪些用戶已膨脹的特權。您可以通過鍵入

sqlplus/as sysdba --(if you are root on the box) 
spool user_privileges.txt 
@whos_a_root.sql --(if that's what you call your script) 
spool off 
exit; 
5

在Oracle中,「root」或「adminstrative」特權意味着什麼?你想讓用戶獲得SYSDBA嗎?或者,在較早的Oracle版本中,有DBA角色,它具有廣泛的特權集,使用戶能夠執行大部分任務。它在11g中具有減少的一組功能。 @ client09給出的答案對於確切地確定每個用戶可以做什麼很有用。

對我而言,Oracle中的root用戶是SYSDBA帳戶,默認情況下是SYS用戶。任何被授予此權限的人都可以登錄「AS SYSDBA」,從而使該用戶完全控制數據庫。您可以通過此選擇列表授予此權限的用戶:

SELECT * FROM v$pwfile_users; 

有趣的是,如果我授予SYSDBA角色,和我身份登錄SYSDBA,在Oracle會話的實際用戶是SYS:

SQL> create user test identified by test; 

User created. 

SQL> grant create session to test; 

Grant succeeded. 

SQL> grant sysdba to test; 

Grant succeeded. 

SQL> connect test/test as sysdba 
Connected. 
SQL> select user from dual; 

USER 
------------------------------ 
SYS 

SQL> select * from v$pwfile_users; 

USERNAME      SYSDB SYSOP SYSAS 
------------------------------ ----- ----- ----- 
SYS       TRUE TRUE FALSE 
TEST       TRUE FALSE FALSE