今天犯傻,不小心刪除了,本來想revoke某個使用者的DBA許可權的。習慣用PLSQLDEVELOP的我,順手在UI那裡點了DROP。 汗,操作完之後,還不知道什麼回事,切換SYSTEM登陸的時候發現沒 CREATE SESSION許可權,奇怪了。 後來想想才發現自己誤操作了。鬱悶啊。DROP ROLE了。暈死。 痛苦之下叫LIVING 幫忙查看DBA ROLE的SQL語句。哎。痛苦的重建了一個,首先需登陸SYS使用者 然後執行一下SQL語句,如果有對象不存在則跳過就可以。
-- Create the role
create role DBA;
-- Grant/Revoke object privileges
grant execute on DBMS_DBVERIFY to DBA;
grant execute on DBMS_DEFER_QUERY to DBA;
grant execute on DBMS_DEFER_SYS to DBA;
grant execute on DBMS_FEATURE_USAGE to DBA;
grant execute on DBMS_FLASHBACK to DBA;
grant execute on DBMS_MONITOR to DBA;
grant execute on DBMS_RESUMABLE to DBA;
grant execute on DBMS_SERVER_ALERT to DBA;
grant execute on DBMS_SERVER_TRACE to DBA;
grant execute on DBMS_SERVICE to DBA;
grant execute on DBMS_STORAGE_MAP to DBA;
grant execute on DBMS_UADV_ARR to DBA;
grant execute on DBMS_UNDO_ADV to DBA;
grant execute on DBMS_WORKLOAD_REPOSITORY to DBA;
grant execute on LOAD_UNDO_STAT to DBA;
grant select , insert , update , delete , alter on MAP_OBJECT to DBA;
grant execute on OUTLN_EDIT_PKG to DBA;
grant execute on OUTLN_PKG to DBA;
grant execute on RESET_UNDO_STAT to DBA;
-- Grant/Revoke role privileges
grant delete_catalog_role to DBA with admin option ;
grant execute_catalog_role to DBA with admin option ;
grant exp_full_database to DBA;
grant gather_system_statistics to DBA;
grant imp_full_database to DBA;
grant java_admin to DBA;
grant java_deploy to DBA;
grant olap_dba to DBA;
grant scheduler_admin to DBA with admin option ;
grant select_catalog_role to DBA with admin option ;
grant wm_admin_role to DBA;
grant xdbadmin to DBA;
-- Grant/Revoke system privileges
grant administer any sql tuning set to DBA with admin option ;
grant administer database trigger to DBA with admin option ;
grant administer resource manager to DBA with admin option ;
grant administer sql tuning set to DBA with admin option ;
grant advisor to DBA with admin option ;
grant alter any cluster to DBA with admin option ;
grant alter any dimension to DBA with admin option ;
grant alter any evaluation context to DBA with admin option ;
grant alter any index to DBA with admin option ;
grant alter any indextype to DBA with admin option ;
grant alter any library to DBA with admin option ;
grant alter any materialized view to DBA with admin option ;
grant alter any outline to DBA with