如何创建DBA ROLE

发表于:2007-06-22来源:作者:点击数: 标签:
本人一次遇到有人将 数据库 DBAROLE删除掉了,惊讶之余,只好想办法恢复,经查找资料,终于完全恢复了DBAROLE,现将恢复过程与大家共享: 用sys/xxxxassysdba登录 sql plus,然后执行下列语句: SQLcreateroledba; SQLgr ant allprivilegestodbawithadminopti

   
本人一次遇到有人将数据库DBA ROLE删除掉了,惊讶之余 ,只好想办法恢复,经查找资料,终于完全恢复了DBA ROLE,现将恢复过程与大家共享:

用 sys/xxxx as sysdba登录sqlplus,然后执行下列语句:
 

SQL> create role dba; 
     
SQL> grant all privileges to dba with admin option; 
    
SQL> grant select_catalog_role to dba with admin option; 
     
SQL> grant execute_catalog_role to dba with admin option; 
     
SQL> grant delete_catalog_role to dba with admin option; 


Explanation:  
============  
  
The DBA role is created at database creation time by the "sql.bsq" script. (The "sql.bsq" script is typically found in the $ORACLE_HOME/dbs or the 
$ORACLE_HOME/rdbms/admin directory.)  

Additional grants are made to dba through other scripts in the admin directory.  

For example, exp_full_database and imp_full_database in catexp.sql. 

The above commands are excerpts from the "sql.bsq" script

原文转自:http://www.ltesting.net