Mar 10 2013

How to Add Standby Logfile in Oracle

Category: Administration,Backup And RecoveryFatih Acar @ 17:59

If you want to use real-time apply Oracle Data Guard, you have to add standby logfile to standby database.

Show Logfiles Before Add

SQL> select * from gv$logfile;

INST_ID GROUP# STATUS TYPE MEMBER IS_RECOVERY_DEST_FILE
1 3 ONLINE +DATA/testdb/onlinelog/group_3.14134123 NO
1 1 ONLINE +DATA/testdb/onlinelog/group_1.35116731 NO
1 2 ONLINE +DATA/testdb/onlinelog/group_2.32513245 NO
1 4 ONLINE +DATA/testdb/onlinelog/group_4.12255335 NO
1 2 ONLINE +FRA/testdb/onlinelog/group_2.13423425 YES
1 1 ONLINE +FRA/testdb/onlinelog/group_1.53242411 YES
1 3 ONLINE +FRA/testdb/onlinelog/group_3.34634123 YES
1 4 ONLINE +FRA/testdb/onlinelog/group_4.32525244 YES

Add Standby Logfile ASM

SQL> alter database add standby logfile ‘+DATA’ size 52428800;

Add Standby Logfile FileSystem

SQL> alter database add standby logfile ‘/oracle/db/datafile/standby_redo01.rdo’ size 52428800;


Show Logfiles After Add

SQL> select * from gv$logfile;

INST_ID GROUP# STATUS TYPE MEMBER IS_RECOVERY_DEST_FILE
1 3 ONLINE +DATA/testdb/onlinelog/group_3.14134123 NO
1 1 ONLINE +DATA/testdb/onlinelog/group_1.35116731 NO
1 2 ONLINE +DATA/testdb/onlinelog/group_2.32513245 NO
1 4 ONLINE +DATA/testdb/onlinelog/group_4.12255335 NO
1 2 ONLINE +FRA/testdb/onlinelog/group_2.13423425 YES
1 1 ONLINE +FRA/testdb/onlinelog/group_1.53242411 YES
1 3 ONLINE +FRA/testdb/onlinelog/group_3.34634123 YES
1 4 ONLINE +FRA/testdb/onlinelog/group_4.32525244 YES
1 5 STANDBY +DATA/testdb/onlinelog/group_5.42344234 NO
1 6 STANDBY +DATA/testdb/onlinelog/group_6.90895675 NO
1 8 STANDBY +DATA/testdb/onlinelog/group_8.45674886 NO
1 7 STANDBY +DATA/testdb/onlinelog/group_7.87456844 NO

Alter Data Guard To Real-Time Apply

SQL> alter database recover managed standby database using current logfile disconnect;

You can drop log file with below operation. Logfile status has to be ‘INACTIVE’ when you drop logfile. You can look status at v$log dictionary view.

Drop Logfile

SQL> alter database drop logfile group 8;

49,737 total views, 55 views today

Tags: Database Administration, Oracle Administration, Oracle Data Guard

facebook comments:

Leave a Reply

Time limit is exhausted. Please reload CAPTCHA.