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

Why do you need resetlogs after using using backup controlfile to restore db

2025-01-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

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

This article mainly shows you "Why do you need resetlogs after using using backup controlfile to restore db", the content is simple and clear, hoping to help you solve your doubts, let the editor lead you to study and learn "Why do you need resetlogs after using using backup controlfile to restore db"?

I think this question may not only bother me, but very often we can not explain it clearly. It seems that oracle does not need to resetlogs after using using backup controlfile to restore db, but I think resetlogs seems to have some truth.

SQL > shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

-- Cold backup

SQL > startup

ORACLE instance started.

Total System Global Area 167772160 bytes

Fixed Size 1247876 bytes

Variable Size 83887484 bytes

Database Buffers 75497472 bytes

Redo Buffers 7139328 bytes

The database is loaded.

The database is already open.

SQL > select group#,status,sequence#, archived,first_change# from v$log

GROUP# STATUS SEQUENCE# ARC FIRST_CHANGE#

-

1 CURRENT 2 NO 1090927

2 INACTIVE 1 YES 1090926

3 UNUSED 0 YES 0

SQL > alter system switch logfile

The system has changed.

SQL > alter system switch logfile

The system has changed.

SQL > alter system switch logfile

The system has changed.

SQL > alter system switch logfile

The system has changed.

SQL > alter system switch logfile

The system has changed.

SQL > shutdown immediate

The database has been closed.

The database has been uninstalled.

The ORACLE routine has been closed.

SQL > startup mount

The ORACLE routine has been started.

Total System Global Area 167772160 bytes

Fixed Size 1247876 bytes

Variable Size 83887484 bytes

Database Buffers 75497472 bytes

Redo Buffers 7139328 bytes

The database is loaded.

At present, controlfile is up to date. If the controlfile is not damaged, check that the scn to which db can eventually recover is 1092089.

SQL > select file#,checkpoint_change# from v$datafile

FILE# CHECKPOINT_CHANGE#

--

1 1092089

3 1092089

4 1092089

7 1092089

SQL >

SQL > shutdown immediate

ORA-01109: the database is not open

The database has been uninstalled.

The ORACLE routine has been closed.

-- delete controlfile and datafile, and copy controlfile and datafile when backing up

SQL > startup

The ORACLE routine has been started.

Total System Global Area 167772160 bytes

Fixed Size 1247876 bytes

Variable Size 83887484 bytes

Database Buffers 75497472 bytes

Redo Buffers 7139328 bytes

The database is loaded.

ORA-00314: the sequence number required by log 1 (for thread 1) does not match

ORA-00312: online Log 1 Thread 1: 'DVR ORADATESTREDO01.LOG'

SQL > recover database using backup controlfile

ORA-00279: a change of 1091621 (generated at 14:33:23 in 07 Universe 31) is required for thread 1

ORA-00289: recommended:

E:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTARCHIVELOG2010_07_31O1_MF_1_

2_%U_.ARC

ORA-00280: change 1091621 (for thread 1) in sequence # 2

Specify log: {= suggested | filename | AUTO | CANCEL}

Auto

ORA-00279: a change of 1091764 (generated at 14:35:30 in 07 Universe 31) is required for thread 1

ORA-00289: recommended:

E:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTARCHIVELOG2010_07_31O1_MF_1_

3_%U_.ARC

ORA-00280: change 1091764 (for thread 1) in sequence # 3

ORA-00278: log files are no longer required for this restore

'E:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTARCHIVELOG2010_07_31O1_MF_1

_ 2cm 6595S2CQR. ARC'

ORA-00279: a change of 1091766 (generated at 14:35:31 in 07 Universe 31) is required for thread 1

ORA-00289: recommended:

E:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTARCHIVELOG2010_07_31O1_MF_1_

4_%U_.ARC

ORA-00280: change 1091766 (for thread 1) in sequence # 4

ORA-00278: log files are no longer required for this restore

'E:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTARCHIVELOG2010_07_31O1_MF_1

_ 3' 6595S400room.ARC'

ORA-00279: a change of 1091769 (generated at 14:35:36 in 07 Universe 31) is required for thread 1

ORA-00289: recommended:

E:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTARCHIVELOG2010_07_31O1_MF_1_

5_%U_.ARC

ORA-00280: change 1091769 (for thread 1) in sequence # 5

ORA-00278: log files are no longer required for this restore

'E:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTARCHIVELOG2010_07_31O1_MF_1

_ 4' 6595S8RFroom.ARC'

ORA-00279: a change of 1091771 (generated at 14:35:37 in 07 Universe 31) is required for thread 1

ORA-00289: recommended:

E:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTARCHIVELOG2010_07_31O1_MF_1_

6_%U_.ARC

ORA-00280: change 1091771 (for thread 1) in sequence # 6

ORA-00278: log files are no longer required for this restore

'E:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTARCHIVELOG2010_07_31O1_MF_1

_ 5cm 6595S9TCrun.ARC'

ORA-00279: a change of 1091774 (generated at 14:35:43 in 07 Universe 31) is required for thread 1

ORA-00289: recommended:

E:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTARCHIVELOG2010_07_31O1_MF_1_

7_%U_.ARC

ORA-00280: change 1091774 (for thread 1) in sequence # 7

ORA-00278: log files are no longer required for this restore

'E:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTARCHIVELOG2010_07_31O1_MF_1

_ 651 595 SHSWANG.ARC'

ORA-00308: unable to open archive log

'E:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTARCHIVELOG2010_07_31O1_MF_1

_ 7% Ubun.ARC'

ORA-27041: unable to open file

OSD-04002: unable to open file

O/S-Error: (OS 2) the system cannot find the specified file.

SQL >

SQL > recover database using backup controlfile

ORA-00279: a change of 1091774 (generated at 14:35:43 in 07 Universe 31) is required for thread 1

ORA-00289: recommended:

E:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTARCHIVELOG2010_07_31O1_MF_1_

7_%U_.ARC

ORA-00280: change 1091774 (for thread 1) in sequence # 7

Specify log: {= suggested | filename | AUTO | CANCEL}

D:oradatatestredo01.log

ORA-00310: archive log contains sequence 5; required sequence 7

ORA-00334: archived log: 'DresdORADATESTREDO01.log'

SQL > recover database using backup controlfile

ORA-00279: a change of 1091774 (generated at 14:35:43 in 07 Universe 31) is required for thread 1

ORA-00289: recommended:

E:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTARCHIVELOG2010_07_31O1_MF_1_

7_%U_.ARC

ORA-00280: change 1091774 (for thread 1) in sequence # 7

Specify log: {= suggested | filename | AUTO | CANCEL}

D:oradatatestredo02.log

Applied logs.

Complete the media recovery.

SQL > select file#,checkpoint_change# from v$datafile

FILE# CHECKPOINT_CHANGE#

--

1 1092088

3 1092088

4 1092088

7 1092088

SQL > select file#,checkpoint_change# from v$datafile_header

FILE# CHECKPOINT_CHANGE#

--

1 1092088

3 1092088

4 1092088

7 1092088

SQL > alter database open

Alter database open

*

An error occurred on line 1:

ORA-01589: to open the database, you must use the RESETLOGS or NORESETLOGS option

-- = =

-- in the end, the db is restored to 1092088, which is only 1 different from the fully recovered scn1092089. Is that why you need resetlogs after using using backup controlfile to restore db? In fact, I don't think it is. The reason why we need resetlogs

The reason is that there is a lot of redo-related information recorded in controlfile, and now after the latest controlfile damage, there is a lot about

The message of redo is not clear, which may be the reason why you need resetlogs after you finally use using backup controlfile to restore db.

After all, oracle opened db using resetlogs instead of resetscn....

-- = =

SQL > alter database open resetlogs

The database has changed.

SQL > select file#,checkpoint_change# from v$datafile

FILE# CHECKPOINT_CHANGE#

--

1 1092091

3 1092091

4 1092091

7 1092091

SQL > select file#,checkpoint_change# from v$datafile_header

FILE# CHECKPOINT_CHANGE#

--

1 1092091

3 1092091

4 1092091

7 1092091

SQL >

The above is all the contents of the article "Why do you need resetlogs after using using backup controlfile to recover db?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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

Network Security

Wechat

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

12
Report