Monday, May 14, 2012

Fixing a Corrupted SYSAUX Tablespace



Fixing a Corrupted SYSAUX Tablespace [ID 950128.1]
  Modified 15-DEC-2011     Type HOWTO     Status MODERATED
In this Document
  Goal
  Solution
     1- RMAN Block Recovery
     2 - Restore and Recover the Corrupted Datafile(s)
     3 - Recreate the Corrupted Object
     4 - Export
  References

This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review.
Applies to:

Oracle Server - Enterprise Edition - Version: 10.2.0.3 and later   [Release: 10.2 and later ]
Information in this document applies to any platform.
Goal

How to fix/work-around a corrupted SYSAUX tablespace

Solution

SYSAUX was introduced in 10g to store all auxiliary database metadata related to Oracle options and features. This is a mandatory tablespace and cannot be dropped. Therefore it is important to have all objects in this tablespace accessible at all times.

To find out what is stored in this tablespace, look at V$SYSAUX_OCCUPANTS:

SQL> select occupant_name, space_usage_kbytes from v$sysaux_occupants;
Throughout this document, we are assuming that the datafile 3, belonging to the SYSAUX tablespace, is corrupted.

1- RMAN Block Recovery

RMAN block recovery is only possible if you have a backup and all archivelogs from prior to the time of the corruption. Further, block recovery is only available for Oracle Enterprise Edition.

a) check for corruption

RMAN> backup validate check logical tablespace SYSAUX;

or

RMAN> backup validate check logical datafile 3;
b) Once the above RMAN validate is completed, all corruptions found will be written to this view:

SQL> select * from v$database_block_corruption;
c) If  V$DATABASE_BLOCK_CORRUPTION returns more than one corrupted block, recover them

RMAN> blockrecover corruption list;


2 - Restore and Recover the Corrupted Datafile(s)

If you have a backup of the corrupted file(s), then restore and recover the datafile(s) from backup.

eg:

RMAN> restore datafile 3;
RMAN> recover datafile 3;
SQL> alter database datafile 3 online;
3 - Recreate the Corrupted Object

To identify the corrupted objects, please see Note 472231.1. Most indexes can be recreated but only certain tables in the SYSAUX tablespace can be recreated. Please contact Oracle Support if you wish to explore this path.

4 - Export

If all of the above options are exhausted, the last resort is to export the database, schema(s) or table(s), create a new database and import.

As long as the export views are accessible you should be able to perform either a database or schema level export.

If a tablespace level export works you might also consider using Transportable Tablespaces for recreating the database as documented in
Note:733824.1 HowTo Recreate a database using TTS (TransportableTableSpace)
However, if all datafiles belonging to the SYSAUX are inaccessible then you can only perform export at the table level. Full and schema level export will not work as the export views in SYSAUX are no longer available.

 eg:

% exp scott/tiger file=xscott.dmp log=xscott.log tables=emp,dept
Once exported, you can import this dump into a new database.
References

NOTE:184327.1 - ORA-1157 Troubleshooting
NOTE:243246.1 - SYSAUX New Mandatory Tablespace in Oracle 10g and higher
NOTE:472231.1 - How to identify all the Corrupted Objects in the Database reported with RMAN
NOTE:733824.1 - How To Recreate a database using TTS (Transportable TableSpace)

 Related
Products
Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition

Back to top

2 comments:

  1. Investigate the Data Corruption Issue with Cognegic's DB Recovery Support | Cognegic
    The information misfortune for any association falls in a bad position. The human mix-up, programming/equipment issues or incidentally erased information can make the issue for you. All things considered, you are not ready to recuperate or get back your essential information. Be that as it may, today there is the number of inherent instruments is accessible through which you can without much of a stretch get back your essential information. On the off chance that you know about those instruments then you can without much of a stretch tackle your concern generally, instantly you need to connect with Cognegic's DB Recovery Services or Exchange Database Recovery.
    For More Info: https://cognegicsystems.com/
    Contact Number: 1-800-450-8670
    Email Address- info@cognegicsystems.com
    Company’s Address- 507 Copper Square Drive Bethel Connecticut (USA) 06801

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete