Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What to do about the incomplete recovery of scn based on control files

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail what to do about the incomplete recovery of scn based on control files, the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Problem phenomenon:

SQL > alter database open resetlogs

Alter database open resetlogs

*

ERROR at line 1:

ORA-01152: file 1 was not restored from a sufficiently old backup

ORA-01110: data file 1:'/ DBSoft/oracle/oradata/woo/system01.dbf'

Error reported in the log:

Alter database open

Errors in file / DBSoft/oracle/diag/rdbms/woo/woo/trace/woo_ora_24956.trc:

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

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

Sun Dec 24 05:44:45 2017

Signalling error 1152 for datafile

Signalling error 1152 for datafile

Signalling error 1152 for datafile

Signalling error 1152 for datafile

Signalling error 1152 for datafile

Checker run found 5 new persistent data failures

Sun Dec 24 05:44:51 2017

Alter database open resetlogs

Signalling error 1152 for datafile

ORA-1152 signalled during: alter database open resetlogs...

Problem analysis:

After completing the recover database, I was about to start the library and found that data file 1 needed to be restored, so it's time to think about the need for incomplete recovery. Then there are four kinds of incomplete recovery, time-based (time) recovery.

Restore based on cancel (cancel)

Recovery based on SCN (change)

Based on backup control file (unsing backup controlfile) recovery, then we need to know which way is the most appropriate.

View scn information:

View the scn information in the header of the data file:

SQL > select checkpoint_change# from v$datafile_header

CHECKPOINT_CHANGE#

-

2247792

2247792

2247792

2247792

2247792

View the scn header information recorded in the control file:

SQL > select checkpoint_change# from v$datafile

CHECKPOINT_CHANGE#

-

2247974

2247974

2247974

2247974

2247974

Here we can clearly see that the scn information recorded in the control file is newer than the scn information recorded in the header of the data file, and the header information of all the data files is the same, so we can quickly get that we restore the database to the scn of the data file so that the database can be opened.

Do a scn recovery based on the file header:

SQL > recover database until change 2247792

ORA-00283: recovery session canceled due to errors

ORA-01610: recovery using the BACKUP CONTROLFILE option must be done

Hint that you need to use a control file for scn-based recovery.

Use control files for scn-based recovery:

SQL > recover database until change 2247792 using backup controlfile

Media recovery complete.

SQL > select * from v$recover_file

FILE# ONLINE ONLINE_ ERROR CHANGE# TIME

--

1 ONLINE ONLINE 2247792 23-DEC-17

2 ONLINE ONLINE 2247792 23-DEC-17

3 ONLINE ONLINE 2247792 23-DEC-17

4 ONLINE ONLINE 2247792 23-DEC-17

5 ONLINE ONLINE 2247792 23-DEC-17

After the restore is complete, execute open resetlogs:

SQL > alter database open resetlogs

Database altered.

Check:

SQL > col error format A10

SQL > select * from v$recover_file

No rows selected

SQL > select checkpoint_change# from v$datafile_header

CHECKPOINT_CHANGE#

-

2247797

2247797

2247797

2247797

2247797

SQL > select checkpoint_change# from v$datafile

CHECKPOINT_CHANGE#

-

2247797

2247797

2247797

2247797

2247797

You must ensure that the scn in the header of the data file is consistent with the scn information in the control file before the database can be opened, then the normal recovery will follow the nearest.

On the control file-based scn incomplete recovery how to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report