Friday, April 21, 2023

Oracle Database 19c -- ORA-13518: Invalid database id

Problem

In a PDB, while performing an operation on the Automatic Workload Repository, such as taking an AWR snapshot, or changing interval settings, you get an error below:

ORA-13518: Invalid database id (<dbid>)
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 213
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 265


Solution

First ensure that the <dbid> reported in the error, is the correct dbid of the PDB:

SQL > select sys_context('USERENV','CON_NAME')
from v$database
where con_dbid=<dbid>;

In case the dbid is correct, manually register the AWR for the PDB:

SQL> exec dbms_swrf_internal.register_local_dbid;


No comments: