Saturday, February 8, 2025

ORA-10458: standby database requires recovery ORA-01196: file 1 is inconsistent due to a failed media recovery session ORA-01110: data file 1: '/u01/app/oracle/oradata/DB2/datafile/o1_mf_system_mt93gs9b_.dbf'

BOTH SERVER Listener OK and Tns OK and IP reachable then do


 PRIMARY

[oracle@db1 ~]$ sqlplus / as sysdba


SQL*Plus: Release 19.0.0.0.0 - Production on Sat Feb 8 16:13:09 2025

Version 19.3.0.0.0


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

Connected to:

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Version 19.3.0.0.0


SQL>

SQL> SELECT DATABASE_ROLE, OPEN_MODE FROM V$DATABASE;


DATABASE_ROLE    OPEN_MODE

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

PRIMARY          READ WRITE


SQL> select max(sequence#) from v$archived_log;


MAX(SEQUENCE#)

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

            70


SQL> alter system switch logfile;


System altered.


SQL> /


System altered.


SQL> select max(sequence#) from v$archived_log;


MAX(SEQUENCE#)

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

            72




STANDBY 


[oracle@db2 admin]$ sqlplus / as sysdba


SQL*Plus: Release 19.0.0.0.0 - Production on Sat Feb 8 16:13:19 2025

Version 19.3.0.0.0


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



Connected to:

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Version 19.3.0.0.0

Connected to an idle instance.


SQL> startup

ORACLE instance started.


Total System Global Area 1795159104 bytes

Fixed Size                  8897600 bytes

Variable Size             419430400 bytes

Database Buffers         1358954496 bytes

Redo Buffers                7876608 bytes

Database mounted.

ORA-10458: standby database requires recovery

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

ORA-01110: data file 1:

'/u01/app/oracle/oradata/DB2/datafile/o1_mf_system_mt93gs9b_.dbf'


SQL> shut immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> STARTUP MOUNT;
ORACLE instance started.

Total System Global Area 1795159104 bytes
Fixed Size                  8897600 bytes
Variable Size             419430400 bytes
Database Buffers         1358954496 bytes
Redo Buffers                7876608 bytes
Database mounted.


SQL>

SQL> SELECT DATABASE_ROLE, OPEN_MODE FROM V$DATABASE;


DATABASE_ROLE    OPEN_MODE

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

PHYSICAL STANDBY MOUNTED


SQL> select max(sequence#) from v$archived_log;


MAX(SEQUENCE#)

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

            70


SQL>  select max(sequence#) from v$archived_log;


MAX(SEQUENCE#)

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

            72


SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL

*

ERROR at line 1:

ORA-16136: Managed Standby Recovery not active


SQL> shut immediate

ORA-01109: database not open



Database dismounted.

ORACLE instance shut down.

SQL> STARTUP MOUNT;

ORACLE instance started.


Total System Global Area 1795159104 bytes

Fixed Size                  8897600 bytes

Variable Size             419430400 bytes

Database Buffers         1358954496 bytes

Redo Buffers                7876608 bytes

Database mounted.

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL

*

ERROR at line 1:

ORA-16136: Managed Standby Recovery not active



SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;


Database altered.


SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;


Database altered.


SQL> alter database open read only;


Database altered.


SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;


Database altered.


SQL> SELECT DATABASE_ROLE, OPEN_MODE FROM V$DATABASE;


DATABASE_ROLE    OPEN_MODE

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

PHYSICAL STANDBY READ ONLY WITH APPLY


SQL>


No comments:

Post a Comment

 https://www.linkedin.com/pulse/building-real-time-database-monitoring-dashboard-oracle-khaleeq-tpwxf/