The AWR import failed today and damaged the awr of the database. It can only be rebuilt. After reconstruction, an error is reported in awr.
SYS @ hcndb> begin
Dbms_workload_repository.modify_snapshot_settings (
3 interval => 30,
4 retention => 14*24*60
5 );
6 end;
7/
Begin
*
ERROR at line 1:
ORA-13518: Invalid database id (231820269)
ORA-06512: at "SYS. DBMS_WORKLOAD_REPOSITORY", line 85
ORA-06512: at "SYS. DBMS_WORKLOAD_REPOSITORY", line 133
ORA-06512: at line 2
View the MOS document:
ORA-13518: 'invalid Database id' On Call to DBMS_WORKLOAD_REPOSITORY Package [Id 984447.1]
Changes
Recently AWR was recreated using catnoawr. SQL and catawrtb. SQL.
Cause
When a function/procedure is called from DBMS_WORKLOAD_REPOSITORY package, it refers table WRM $ _ DATABASE_INSTANCE to get dbid information. as the AWR repositories has been recreated, the table doesn' t not have any data present in it.
SQL> select * from WRM $ _ DATABASE_INSTANCE;
No rows selected
Solution
The WRM $ _ DATABASE_INSTANCE gets populated with instance information when the instance is rebooted. so, If you have recreated AWR using catnoawr. SQL, catawrtb. SQL, then you need to bounce the Instance. on restart, the table will be populated with the requisite information. hence, better option for recreating AWR is to use startup restrict method. after the recreation activity is completed, shutdown the database and open it normally.
Resume normal after instance restart, record