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

How to solve the problem of downtime and startup of Oracle standby database

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article is to share with you about how to solve the problem of Oracle repository downtime and startup. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Brief introduction

ORA-10458: standby database requires recovery

ORA-01196: file 1 is inconsistent due to media recovery session failure

ORA-01110: data file 1: 'XXXXXXXXXXXXXXXXXX\ XXXXX1.DBF'

A project synchronizes the Oracle master-slave database through Dataguard, and the slave server goes down. When the slave server is rebooted, the slave database cannot be started. The error "ORA-01196: file 1 is inconsistent due to media recovery session failure" is reported. The specific log information is as follows:

ORA-10458: standby database requires recovery

ORA-01196: file 1 is inconsistent due to media recovery session failure

ORA-01110: data file 1: 'XXXXXXXXXXXXXXXXXX\ XXXXX1.DBF'

The order of normal startup should be to start the slave library first and then the main library. Due to the downtime of the slave library, the log is not synchronized for a period of time, the master / slave is inconsistent, and the slave library cannot be started.

Preparation before recovery

Back up the main library

Backup master database data [/ home/oracle/backup/20190506/]

Mkdir / home/oracle/backup/20190506 sqlplus / as sysdba SQL > create directory data_dir as'/ home/oracle/backup/20190506'; expdp SYSTEM/ password @ orcl schemas= username dumpfile=bak20190506.dmp directory=data_dir logfile=bak20190506.log

Check the log file

Before recovery, you need to know the database files and log files of the current slave database, and check whether the master and slave databases are consistent [copy if inconsistent].

SQL > set linesize 300SQL > col MEMBER for a60SQL > select type,member from v$logfile

Check the database file

SQL > select name from v$datafile

Reserve database recovery

Close the standby library, start the instance, load the database, but the database is not open. Open the logging process

Shutdown immediatestartup mount;alter database recover managed standby database using current logfile disconnect from session

Main library operation

Alter system switch logfile

To force log switching, it is not necessary to archive the current redo log files (if automatic archiving is turned on, redo logs before archiving are enabled; if automatic archiving is not opened, current redo logs are not archived. )

Alter system switch logfile

After a few more operations, wait for a short period of time, depending on the network speed. After a period of time, query the synchronization on the main database:

Select name,sequence#,archived,applied from v$archived_log order by sequence#

If the returned result "APPLIED" is "YES" or only the last one is "NO", all the archived logs have been archived.

At this time, go to the slave database to operate.

Start the standby library

Alter database recover managed standby database cancel;alter database open;alter database recover managed standby database using current logfile disconnect from session;, thank you for your reading! This is the end of the article on "how to solve the problem of downtime and startup of Oracle repository". I hope the above content can be of some help to you, so that 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