Online Redo Logs on Physical Standby (文檔 ID 740675.1)

 

APPLIES TO:

Oracle Database - Enterprise Edition - Version 9.2.0.1 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.

GOAL

Usage of Online Redo Logs on Physical Standby.
Impact Drop and Add on redo log on Primary  has on Standby.
How to Add/Drop/Sync Redologs on Primary and Standby.

In case you may want or need more about your current topic - please also access the Data Guard Community of Customers and Oracle Specialists directly via:
https://communities.oracle.com/portal/server.pt/community/high_availability_data_guard/302

SOLUTION

Online redo logs are not used in the physical standby database.

Physical standby database will be in mount stage or read-only stage all the times so it will not be generating any Redo, therefore Online Redologs are not used on the Physical Standby Database (as long as it is acting as a Standby Database). 

Changing the Size and Number of the Online Redolog Files is sometimes done/necessary to tune the Database. You can add or drop Online Redolog File Groups or Members on the Primary Database without affecting the Standby Database. Similarly, you can drop Logfile Groups or Members from the Standby Database without affecting your Primary Database. However, these changes do affect the Performance of the Standby Database after Switchover or Failover when it becomes a Primary Database.

So you may want to add/drop Redologs on the Standby Database when you are adding/dropping the Redologs on the Primary Database.

Operation on Redo logs in Physical Standby:

1. Add Redologs on Standby
2. Drop Redologs on Standby
3. Sync Redologs on Primary and Standby


Add Redo Logs on Standby

1. Stop Redo apply:
 

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

2. Set STANDBY_FILE_MANAGEMENT to MANUAL.

SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT='MANUAL';

3. Add Redolog File Group:

SQL> ALTER DATABASE ADD LOGFILE GROUP 4 ('<PATH>\<LOG_FILE_NAME>.log') SIZE 100M;

Add as many Redo Logfile Groups (or Members) you want to add.

4. Set STANDBY_FILE_MANAGEMENT to AUTO.

SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT='AUTO';

5. Start Redo Apply (Managed Recovery):

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

 


Drop Redo Logs on Standby

1. Check the Status of the Online Redolog Group.

Even if the online redo logs are not used on a physical standby database, the status within v$log will be updated through the standby control file. They are results of actions on the primary database eg. logswitches.

SQL> SELECT GROUP#, STATUS FROM V$LOG;

GROUP# STATUS
---------- ----------------
1 CLEARING_CURRENT
3 CLEARING
2 CLEARING

If Status is CLEARING_CURRENT or CURRENT then you cannot drop Online Redolog Group, please use "Sync Redo Logs on Primary and Standby" Section in this Case. You will get ORA-01623 if you try to drop a Redolog Group with Status CLEARING_CURRENT or CURRENT.

You can also change this status by doing a ALTER SYSTEM SWITCH LOGFILE; on primary.


For Status CLEARING, UNUSED, INACTIVE please follow below steps.

2. Stop Redo Apply:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

3. Set STANDBY_FILE_MANAGEMENT to MANUAL.

SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT='MANUAL';

4. Clear the Online Redo Logfile Group:

SQL> ALTER DATABASE CLEAR LOGFILE GROUP n;

5. Drop the Online Redo Logfile Group:

SQL>ALTER DATABASE DROP LOGFILE GROUP n;

If you have skipped Step 4 then you will get ORA-01624 while droping the Online Redolog Group with Status CLEARING.

6. Set STANDBY_FILE_MANAGEMENT to AUTO.

SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT='AUTO';

7. Start Redo Apply:

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

 

Sync Redo Logs on Primary and Standby

1. Make all the Changes related to Redolog Groups (Add/delete/Modify) in the Primary Database  are available to the Standby Database in one Step. So that Step 4 where standby Controlfile is recreated from Primary has the required redo log information.

2. Shutdown the Standby Database.

SQL> SHUTDOWN IMMEDIATE

3. Drop all Redolog Group Files using OS Command or ASMCMD Command depending on the Location of the Online Redo Logs on the Standby Database.

4. Recreate the Standby Controlfile using these Notes:
 

Note 459411.1 : Steps to recreate a Physical Standby Controlfile

OR

Note.734862.1 : Step by step guide on how to recreate standby control file when datafiles are on ASM and using Oracle Managed Files

5. Startup the Database in mount Stage.

Oracle 8i and 9i (8.x - 9.x):

SQL> STARTUP NOMOUNT
SQL> ALTER DATABASE MOUNT STANDBY DATABASE;

Oracle 10g and 11g (10.x - 11.x):

SQL> STARTUP MOUNT

6. Clear all Redolog Groups on Standby (only when using Oracle Database <10.2.0.1).

SQL> ALTER DATABASE CLEAR LOGFILE GROUP 1;

Repeat step 6 for all Online Redolog File Groups.

7. Start Redo Apply:

When using Oracle Database >=10.2.0.1 and LOG_FILE_NAME_CONVERT is configured the online redo logs will  be automatically cleared and physically created when starting recovery.

Please see also

10.2 Data Guard Physical Standby Switchover (Doc ID 751600.1)

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


Also refer :- Handling ORL and SRL (Resize) on Primary and Physical Standby in Data Guard Environment Document 1532566.1

REFERENCES

NOTE:1514588.1 - Data Guard Physical Standby - Managing temporary tablespace tempfiles
BUG:17286325 - UNABLE TO DROP ONLINE REDO LOGFILE ON PHYSICAL STANDBY
NOTE:459411.1 - Steps to recreate a Physical Standby Controlfile
BUG:16091872 - V$LOG ON PSBY SHOWS ONE PER THREAD AS CURRENT
NOTE:734862.1 - Step By Step Guide On How To Recreate Standby Control File When Datafiles Are On ASM And Using Oracle Managed Files
NOTE:751600.1 - 10.2 Data Guard Physical Standby Switchover

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章