暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Fixing a Corrupted SYSAUX Tablespace (文档 ID 950128.1)

245

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.1 to 12.1.0.2 [Release 10.2 to 12.1]

Oracle Database - Standard Edition - Version 11.1.0.7 to 11.1.0.7 [Release 11.1]

Information in this document applies to any platform.

***Checked for relevance on 17-May-2013***

***Checked for relevance on 3-Jul-2015***


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.

Confirm the backuppieces required:

RMAN> restore datafile 3 preview;

 

If you have all the available backups and archivelogs, then proceed with the restore and recovery:

RMAN> alter database datafile 3 offline;

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, tablespace(s), schema(s) or table(s), create a new database and import.

 

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)

Note: If all datafiles belonging to the SYSAUX are inaccessible then you can only perform export at the tablespace or table level. Full and schema level export may not work. You will need to use traditional exp rather than expdp as expdp relies on objects in the SYSAUX tablespace.

 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:472231.1 - How to identify all the Corrupted Objects in the Database with RMAN

NOTE:733824.1 - How To Recreate A Database Using TTS (Transportable TableSpace)

NOTE:184327.1 - ORA-1157 Troubleshooting



NOTE:243246.1 - SYSAUX New Mandatory Tablespace in Oracle 10g and higher

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论