[Oracle] undo is damaged and non-conventional Backup recovery is not performed.

Source: Internet
Author: User
A test environment of the customer, the host abnormal power failure, after the startup of the undo file damaged, unable to start, in the open stage error: errorsinfileu01apporaclediagrdbmscdrdbcdrdbtracecdrdb_ora_rj9.trc: ORA-01122: dataf

In a test environment of the customer, the host suffers an abnormal power failure. After the startup, the undo file is damaged and cannot be started. The following error is reported during the open stage: errors in file/u01/app/oracle/diag/rdbms/cdrdb/CDRDB/trace/cdrdb_ora_00009.trc: ORA-01122: database file 3 failed verification check ORA-01110: data f

In a test environment of the customer, the host suffers an abnormal power failure. After the startup, the undo file is damaged and cannot be started. The following error is reported during the open stage:

Errors in file/u01/app/oracle/diag/rdbms/cdrdb/CDRDB/trace/cdrdb_ora_00009.trc:

ORA-01122: database file 3 failed verification check

ORA-01110: data file 3: '/u01/app/oracle/oradata/CDRDB/undotbs01.dbf'

ORA-01210: data file header is media upt

ORA-1122 signalled during: alter database open...

Because it is a test environment, there is no backup, but some data in it is required, so I tried to use unconventional recovery methods.

Cold backup of existing environment first !!!!!!!!!!!!!!!!

Create a pfile:

Create pfile from spfile;

Modify the two parameters in pfile

# *. Undo_tablespace = 'undotbs1'

*. Undo_management = MANUAL

Then start with this pfile:

SYS @ CDRDB> startup force pfile = '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initCDRDB. ora ';

ORACLE instance started.

Total System Global Area 523108352 bytes

Fixed Size 1337632 bytes

Variable Size 364906208 bytes

Database Buffers 150994944 bytes

Redo Buffers 5869568 bytes

Database mounted.

ORA-01122: database file 3 failed verification check

ORA-01110: data file 3: '/u01/app/oracle/oradata/CDRDB/undotbs01.dbf'

ORA-01210: data file header is media upt

Still report error

Then try to drop this undo

SYS @ CDRDB> alter database datafile 3 offline drop;

Database altered.

And then re-open the database

SYS @ CDRDB> alter database open;

Database altered.

Then create a new undo tablespace undotbs2

SYS @ CDRDB> create undo tablespace undotbs2 datafile '/u01/app/oracle/oradata/CDRDB/undotbs02_01.dbf' size 100 M;

Create undo tablespace undotbs2 datafile '/u01/app/oracle/oradata/CDRDB/undotbs02_01.dbf' size 100 M

*

ERROR at line 1:

ORA-00604: error occurred at recursive SQL level 1

ORA-01552: cannot use system rollback segment for non-system tablespace

'Data _ OL'

ORA-06512: at line 999

ORA-01552: cannot use system rollback segment for non-system tablespace

'Data _ OL'

The above error is reported.

I am wondering why the creation of the undo affects the DATA_OL tablespace, so I made a 10046

SYS @ CDRDB> oradebug event 10046 trace name context off

Statement processed.

SYS @ CDRDB> oradebug tracefile_name

/U01/app/oracle/diag/rdbms/cdrdb/CDRDB/trace/CDRDB_ora_4279.trc

[Oracle @ centos-1 ~] $ Tkprof/u01/app/oracle/diag/rdbms/cdrdb/CDRDB/trace/CDRDB_ora_4279.trc

Output = 1.trm

Check 1.trmand find the cause:

"OGG". DDLReplication. dbQueried IS NULL THEN

SELECT database_role,

Open_mode

INTO dbRole, dbOpenMode

FROM v $ database;

"OGG". DDLReplication. dbQueried: = TRUE;

End if;

If not (

^ @ (DbRole = 'primary' OR dbRole = 'logical standby ')

AND dbOpenMode =

'Read write'

)

THEN

-- Do not write any trace even though it

Shocould work as this is standby

"OGG"

. DDLReplication. setCtxInfo (-1,-1,-1,-1,-1 );

RETURN; -- do not use

Trigger if not read/write and primary/logical_standby

End if;

EXCEPTION

...

It turns out that the database is configured with ogg ddl synchronization. When DDL is generated, the insert operation is generated, and the DATA_OL tablespace is used.

Locate the cause ~ Run the script to close the DDL configuration of the OGG library.

SYS @ CDRDB> @ ddl_disable. SQL

Trigger altered.

Then recreate the undotbs2 tablespace.

SYS @ CDRDB> create undo tablespace undotbs2 datafile '/u01/app/oracle/oradata/CDRDB/undotbs02_01.dbf' size 1000 M;

Tablespace created.

This operation was successfully added.

After undotbs2 is added, close the database and modify the pfile parameter.

*. Undo_tablespace = 'undotbs2'

*. Undo_management = AUTO

Restart database with pfile

SYS @ CDRDB> startup pfile = '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initCDRDB. ora ';

ORACLE instance started.

Total System Global Area 523108352 bytes

Fixed Size 1337632 bytes

Variable Size 364906208 bytes

Database Buffers 150994944 bytes

Redo Buffers 5869568 bytes

Database mounted.

Database opened.

The database is successfully started. However, an error still occurs when you query many business tables:

ERROR at line 1:

ORA-00376: file 3 cannot be read at this time

ORA-01110: data file 3: '/u01/app/oracle/oradata/CDRDB/undotbs01.dbf'

The original undotbs01.dbf is still required to roll back the transactions not committed when the database crashes.

Then I tried to set event 10513 to block smon rollback.

SYS @ CDRDB> alter system set events '10513 trace name context forever, level 2 ';

System altered.

The previous error is reported. It seems that you need to manually block the rollback segment.

SYS @ CDRDB> SELECT SEGMENT_NAME, status from DBA_ROLLBACK_SEGS;

SEGMENT_NAME STATUS

----------------------------------------------

SYSTEM ONLINE

_ SYSSMU10_4131489474 $ NEEDS RECOVERY

_ SYSSMU9_1735643689 $ NEEDS RECOVERY

_ SYSSMU8_3901294357 $ NEEDS RECOVERY

_ SYSSMU7_3517345427 $ NEEDS RECOVERY

_ SYSSMU6_2897970769 $ NEEDS RECOVERY

_ SYSSMU5_538557934 $ NEEDS RECOVERY

_ SYSSMU4_1003442803 $ NEEDS RECOVERY

_ SYSSMU3_1204390606 $ NEEDS RECOVERY

_ SYSSMU2_967517682 $ NEEDS RECOVERY

_ SYSSMU1_592353410 $ NEEDS RECOVERY

SEGMENT_NAME STATUS

----------------------------------------------

_ Syssmu30_241_8789 $ ONLINE

_ SYSSMU29_1020880693 $ ONLINE

_ SYSSMU28_2912622077 $ ONLINE

_ SYSSMU27_747253598 $ ONLINE

_ SYSSMU26_560868814 $ ONLINE

_ SYSSMU25_1357066082 $ ONLINE

_ SYSSMU24_103440716 $ ONLINE

_ SYSSMU23_1006903361 $ ONLINE

_ Syssmu22_2808425508 $ ONLINE

_ Syssmu21_000026587 $ ONLINE

21 rows selected.

Then add the queried needs recovery table to the following two parameters to block these rollback segments.

_ Offline_rollback_segments/_ parameter upted_rollback_segments

*. _ Offline_rollback_segments = (_ blank $, _ SYSSMU7_3517345427 $, _ blank $, _ blank $, _ SYSSMU4_1003442803 $, _ blank $, _ blank $, _ syssmustm592353410 $)

*. _ Partition upted_rollback_segments = (_ partition $, _ SYSSMU7_3517345427 $, _ partition $, _ partition $, _ SYSSMU4_1003442803 $, _ partition $, _ partition $, _ syssmustm592353410 $)

Use this pfile to start the database

Startup force pfile = '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initCDRDB. ora ';

Then I checked all the test tables, confirmed that they could be queried, and then exported the data to help them export the data. Everything is OK ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.