Get the App
SLTechnology News&Howtos  ›  Database  › 

What if the database reports an ORA-01196 error?

Shulou Source: shulou.com Published: 2022-05-31 20:43:30 10月03日 Update

This article mainly shows you "database report ORA-01196 error how to do", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "database newspaper ORA-01196 error how to do" this article.

Find a problem

In a project in Zambia, the master-slave database is synchronized, the master database is located in the Zambian computer room, and the slave database is located on the Ali cloud server in Qingdao, China, which is implemented through Dataguard. After running for a period of time, the master-slave database is found to be inconsistent and 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:

= "" log information "" =

Windows PowerShell

Copyright (C) 2009 Microsoft Corporation. All rights reserved.

PS C:\ Users\ Administrator > sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Wednesday May 7 04:59:10 2014

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connect to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL > select OPen_mode from v$database

OPEN_MODE

-

MOUNTED

SQL > alter database open

Alter database open

*

An error occurred on line 1:

ORA-10458: standby database requires recovery

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

ORA-01110: data file 1: d:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ SYSTEM01.DBF'

= "end of log" = =

Solution:

From library startup to mount status:

SQL > SHUTDOWN IMMEDIATESQL > STARTUP MOUNT;SQL > ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USEING CURRENT LOGFILE DISCONNECT FROM SESSION

Operate on the main library:

SQL > 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 specified situation on the main database:

SQL > SELECT NAME,SEQUENCE#,ARCHIVED,APPLIED FROMV$ARCHIVED_LOG ORDER BY SEQUENCE#

If the returned result "APPLIED" is "YES" or only the last one is "NO", it means that all the archive logs have been archived, and then go to the slave database to operate:

Prepare the library operation:

SQL > ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCLE; SQL > ALTER DATABASE OPEN; SQL > ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION

= = solution =

Problem solved!

The above is all the contents of the article "how to report ORA-01196 errors in the database". 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!

Tags: Data database error log time what to do consistency content file article master-slave media information method problem Zambia learning help above only Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB MySQL Shulou Technology Huawei Shulou Information