dba角色重建步骤

参考MOS:

sqlplus / as sysdba
create role dba;
grant all privileges, select any dictionary, analyze any dictionary to dba with admin option;
grant select_catalog_role to dba with admin option;
grant execute_catalog_role to dba with admin option;
grant delete_catalog_role to dba with admin option;
grant all on map_object to dba;


XDB is INVALID and ORA-01001, ORA-00600 [qm_get_kusr], [], [], [] generated (Doc ID 2273627.1)
How to Recreate DBA Role if Dropped (Doc ID 1068678.6)


--create dba role

sqlplus / as sysdba
create role dba;
grant all privileges, select any dictionary, analyze any dictionary to dba with admin option;
grant select_catalog_role to dba with admin option;
grant execute_catalog_role to dba with admin option;
grant delete_catalog_role to dba with admin option;
grant all on map_object to dba;


-- shutdown and restart the db

shutdown immediate
startup


-- grant XDB-related privs to DBA

GRANT xdbadmin TO dba;
grant all on XDB.XDB$RESOURCE to dba;
grant all on XDB.XDB$H_INDEX to dba;
grant all on XDB.XDB$H_LINK to dba;
grant all on XDB.XDB$D_LINK to dba;
grant all on XDB.XDB$NLOCKS to dba;
grant all on XDB.XDB$WORKSPACE to dba;
grant all on XDB.XDB$CHECKOUTS to dba;
grant all on XDB.XDB$ACL to dba;
grant all on XDB.XDB$CONFIG to dba;
grant all on XDB.XDB$RESCONFIG to dba;
grant all on XDB.XS$DATA_SECURITY to dba;
grant all on XDB.XS$PRINCIPALS to dba;
grant all on XDB.XS$ROLESETS to dba;
grant all on XDB.XS$SECURITYCLASS to dba;


declare
 suf varchar2(26);
 stmt varchar2(2000);
begin
 select toksuf into suf from xdb.xdb$ttset where flags = 0;
 stmt := 'grant all on XDB.X$PT' || suf || ' to DBA';
 execute immediate stmt;
 stmt := 'grant all on XDB.X$PT' || suf || ' to SYSTEM WITH GRANT OPTION';
 execute immediate stmt;
 end;
/

grant execute on XDB.DBMS_CSX_ADMIN to dba;
grant execute on XDB.DBMS_XDB_ADMIN to dba;


-- validate XDB

execute dbms_regxdb.validatexdb;

SELECT substrb(Comp_ID,1,10)Comp_ID,
substrb(Status,1,8)Status,
substrb(Version,1,12)Version,
substrb(Comp_Name,1,35)Comp_Name
FROM DBA_Registry
WHERE comp_id = 'XDB';

 

posted @   Eddie小陈  阅读(69)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示