Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Awr report error
1. Error -1
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
2. 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.
Error -2
SQL> @?/rdbms/admin/awrrpt.sql
Current Instance
~~~~~~~~~~~~~~~~
DB Id DB Name Inst Num Instance
----------- ------------ -------- ------------
2028137520 HLIT 1 HLIT
Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
Would you like an HTML report, or a plain text report?
Enter 'html' for an HTML report, or 'text' for plain text
Defaults to 'html'
Enter value for report_type: html
Type Specified: html
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3. Using 2028137520 for database Id
Using 1 for instance number
declare
*
ERROR at line 1:
ORA-20200: Database/Instance 2028137520/1 does not exist in
DBA_HIST_DATABASE_INSTANCE
ORA-06512: at line 23
Solution
*************
$ sqlplus '/as sysdba'
SQL*Plus: Release 11.1.0.7.0 - Production on Wed May 15 12:13:54 2013
Copyright (c) 1982, 2008, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select dbid from v$database;
DBID
----------
2028137520
SQL> select instance_number from v$instance;
4. INSTANCE_NUMBER
---------------
1
SQL> define dbid=2028137520
SQL> define inst_num=1
SQL> @?/rdbms/admin/awrrpt.sql
ERROR at line 1:
ORA-20200: Database/Instance 2028137520/1 does not exist in
DBA_HIST_DATABASE_INSTANCE
ORA-06512: at line 23
Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
$ ^[[A
ksh: ^[[A: not found.
$
$ sqlplus '/as sysdba'
SQL*Plus: Release 11.1.0.7.0 - Production on Wed May 15 12:15:01 2013
Copyright (c) 1982, 2008, Oracle. All rights reserved.
Connected to:
5. Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> define dbid=2028137520
SQL> select name from v$database;
NAME
---------
HLIT
SQL> select inst_^?^?
2
3
SQL> select instance_number from v$instance;
INSTANCE_NUMBER
---------------
1
SQL> define dbid=2028137520
SQL> define inst_num=1
SQL> @?/rdbms/admin/awrrpt.sql
6. Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> define dbid=2028137520
SQL> select name from v$database;
NAME
---------
HLIT
SQL> select inst_^?^?
2
3
SQL> select instance_number from v$instance;
INSTANCE_NUMBER
---------------
1
SQL> define dbid=2028137520
SQL> define inst_num=1
SQL> @?/rdbms/admin/awrrpt.sql