解决问题 ORA-04063: package body "SYS.DBMS_LOGREP_UTIL" has errors

今天给Streams管理用户授权时遇到如下错误:

SQL> exec DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE(grantee => 'strmrep',grant_privileges => true);
BEGIN DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE(grantee => 'strmrep',grant_privileges => true); END;

*
ERROR at line 1:
ORA-04063: package body "SYS.DBMS_LOGREP_UTIL" has errors
ORA-06508: PL/SQL: could not find program unit being called: "SYS.DBMS_LOGREP_UTIL"
ORA-06512: at "SYS.DBMS_STREAMS_AUTH", line 1211
ORA-06512: at line 1

查询Streams不支持对象视图也是有错误:

SQL> select * from DBA_STREAMS_UNSUPPORTED;
select * from DBA_STREAMS_UNSUPPORTED
              *
ERROR at line 1:
ORA-04063: package body "SYS.DBMS_LOGREP_UTIL" has errors

后来想起是由于原先做过 execute dbms_logmnr_d.set_tablespace('ts_strmrep'); 操作把logminer相关对象从sysaux表空间迁移到ts_strmrep, 清除Streams配置的时候, 也把表空间ts_strmrepdrop, 造成logminer相关对象都没了.

metalink找到重建方法:

$ sqlplus / as sysdba
SQL> @?/rdbms/admin/dbmslmd.sql
SQL> @?/rdbms/admin/prvtlmd.plb
SQL> @?/rdbms/admin/utlrp.sql

为防止下次再犯错, 还是把logminer相关对象放回sysaux表空间, 因为建库时把sysaux表空间设置成了自动扩展, 所以不怕被logminer的日志撑爆了.

SQL> execute dbms_logmnr_d.set_tablespace('sysaux');

--END--

你可能感兴趣的:(Oracle错误集)