Slave database:
SQL> alter database open read only;
Alter database open read only
*
ERROR at line 1:
ORA-10458: standby database requires recovery
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/u01/app/Oracle/oradata/bhoms/system01.dbf'
View slave database:
SQL> SELECT SWITCHOVER_STATUS FROM V $ DATABASE;
SWITCHOVER_STATUS
--------------------
TO PRIMARY
View the master database:
SQL> SELECT SWITCHOVER_STATUS FROM V $ DATABASE;
SWITCHOVER_STATUS
--------------------
NOT ALLOWED
View the parameters of the master database again:
SQL> show parameter LOG_ARCHIVE_DEST_2
NAME TYPE VALUE
-----------------------------------------------------------------------------
Log_archive_dest_2 string service = standby lgwr async noa
Ffrem
It turns out that the setting is incorrect:
SQL> alter system set log_archive_dest_2 = 'service = bhoms02 async valid_for = (online_logfiles, primary_role) db_unique_name = bhoms02 ';
Check the master database again:
SQL> SELECT SWITCHOVER_STATUS FROM V $ DATABASE;
SWITCHOVER_STATUS
--------------------
TO STANDBY
View slave database:
SQL> show parameter LOG_ARCHIVE_DEST_2
NAME TYPE VALUE
-----------------------------------------------------------------------------
Log_archive_dest_2 string service = standby lgwr async noa
Ffrem
It turns out that the setting is incorrect:
SQL> alter system set log_archive_dest_2 = 'service = bhoms01 async valid_for = (online_logfiles, primary_role) db_unique_name = bhoms01 ';
Restart the slave database to solve the problem:
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 6747725824 bytes
Fixed Size 2213976 bytes
Variable Size 5100275624 bytes
Database Buffers 1610612736 bytes
Redo Buffers 34623488 bytes
SQL> alter database mount standby database;
Database altered.
SQL> alter database open read only;
Database altered.
SQL> alter database recover managed standby database disconnect from session;
Database altered.