Tuesday, August 31, 2010

ORA-13516: AWR Operation failed: SWRF Schema not initialized

Problem Description
While executing dbms_workload_repository package the following error message is reported.
sql> exec dbms_workload_repository.modify_snapshot_settings(interval=>0);

BEGIN dbms_workload_repository.modify_snapshot_settings(interval=>0); END;
ERROR at line 1:
ORA-13516: AWR Operation failed: SWRF Schema not initialized
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 85
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 133
ORA-06512: at line 1

Cause of the Problem
These errors have happened because of wrong or invalid objects with respect to AWR.

Solution of the Problem
In order to resolve the issue you need to drop and recreate the AWR objects, which you can do by running CATNOAWR.SQL and CATAWR.SQL scripts.

Note that from 10.2 onwards, the script name has changed. The catalog script for AWR Tables, used to create the Workload Repository Schema is CATAWRTB.SQL .

In case of Oracle 10gR1,
To re-create the AWR objects, by running the catnoawr.sql and catawr.sql scripts located in $ORACLE_HOME/rdbms/admin.
SQL> @$ORACLE_HOME/rdbms/admin/catnoawr.sql
SQL> @$ORACLE_HOME/rdbms/admin/catawr.sql
SQL> shut immediate
SQL> startup
In case of Oracle 10gR2,
SQL> @$ORACLE_HOME/rdbms/admin/CATAWRTB.sql
SQL> shut immediate;
SQL> startup
On re-start of the database instance, the AWR tables will be populated with the required data.

Note that, the CATNOAWR.SQL scripts is no longer available in 10.2 and cannot be found
in the $ORACLE_HOME/rdbms/admin directory.

No comments:

Post a Comment