provided steps outline the process of managing standby redo logs (SRLs) for a Data Guard setup, focusing on configuring and troubleshooting issues during the addition and removal of standby log groups. Here’s a summary of what you performed and some recommendations:
Steps and Observations:
- Primary DB Configuration:
- Deferred log shipping to standby by setting
log_archive_dest_state_2
to'DEFER'
. - alter system set log_archive_dest_state_2=’DEFER’ scope=both;
- Deferred log shipping to standby by setting
- Standby DB Preparation:
- Cancelled the managed recovery on the standby database to modify log files.
- alter database recover managed standby database cancel;
- col member for a60
- select group#,type,member from v$logfile order by 1;
- Dropped Existing Standby Log Groups:
- Verified existing standby log groups with
v$logfile
andv$standby_log
. - select group#,thread#,bytes,blocksize, status from v$standby_log;
- alter database drop logfile group 16;
- alter database drop logfile group 17;
- alter database drop logfile group 18;
- alter database drop logfile group 19;
- alter database drop logfile group 20;
- alter database drop logfile group 21;
- Dropped log groups 16 through 21.
- Verified existing standby log groups with
- Added New Standby Log Groups:
- Attempted to add standby log groups using both
+DATABASE
and+FRA
as ASM disk group destinations. - alter database add standby logfile group 16(‘+DATABASE’,’+FRA’) size 512M;
- alter database add standby logfile group 17(‘+DATABASE’,’+FRA’) size 512M;
- alter database add standby logfile group 18(‘+DATABASE’,’+FRA’) size 512M;
- alter database add standby logfile group 19 (‘+DATABASE’,’+FRA’) size 512M;
- alter database add standby logfile group 20 (‘+DATABASE’,’+FRA’) size 512M;
- alter database add standby logfile group 21 (‘+DATABASE’,’+FRA’) size 512M;
- Attempted to add standby log groups using both
- Error During Addition:
- Encountered
ORA-00301
,ORA-17502
, andORA-15005
when adding a log file group to the ASM disk group+FRA/CAODR/ONLINELOG
. - Reason: Alias
CAODR/ONLINELOG/group_5
was already used, leading to conflicts. - alter database add standby logfile group 5 (‘+FRA/CAODR/ONLINELOG/group_5’) size 512M
- *
- ERROR at line 1:
- ORA-00301: error in adding log file ‘+FRA/CAODR/ONLINELOG/group_5’ – file cannot be created
- ORA-17502: ksfdcre:4 Failed to create file +FRA/CAODR/ONLINELOG/group_5
- ORA-15005: name “CAODR/ONLINELOG/group_5” is already used by an existing alias
- Encountered
- ASM Commands:
- Used
asmcmd
to navigate and remove conflicting files from the+FRA
disk group. - SET the env variable and do the following
- asmcmd
- ls
- cdfra/caodr/onlinelog
- ls
- rm group_16*
- rm group_17*
- rm group_18*
- rm group_19*
- rm group_20*
- rm group_21*
- Used
- Retried Standby Log Addition:
- Successfully added standby log groups 16 through 21 after resolving conflicts.
- alter database add standby logfile group 16 (‘+DATABASE’,’+FRA’) size 512M;
- alter database add standby logfile group 17 (‘+DATABASE’,’+FRA’) size 512M;
- alter database add standby logfile group 18 (‘+DATABASE’,’+FRA’) size 512M;
- alter database add standby logfile group 19 (‘+DATABASE’,’+FRA’) size 512M;
- alter database add standby logfile group 20 (‘+DATABASE’,’+FRA’) size 512M;
- alter database add standby logfile group 21 (‘+DATABASE’,’+FRA’) size 512M;
- Restarted Managed Recovery:
- Re-enabled managed recovery on the standby database.
- Re-enabled log shipping on the primary database by setting
log_archive_dest_state_2
to'ENABLE'
. - col member for a60
- select group#,type,member from v$logfile order by 1;
- alter database recover managed standby database disconnect from session;
- PRIMARY DB
- alter system set log_archive_dest_state_2=’ENABLE’ scope=both;
Recommendations:
- Verify Disk Group Capacity:
- Before adding standby log groups, ensure the ASM disk groups (
+DATABASE
,+FRA
) have sufficient space.
- Before adding standby log groups, ensure the ASM disk groups (
- Avoid Alias Conflicts:
- Use unique names for log groups or aliases in ASM. Conflicts like
ORA-15005
can be avoided by verifying existing files:sqlCopyEditselect name from v$asm_alias where name like '%ONLINELOG%';
- Use unique names for log groups or aliases in ASM. Conflicts like
- Ensure Symmetry:
- The number and size of standby log groups should match the primary log groups for efficient redo log synchronization.
- Log File Removal:
- Use
asmcmd rm
carefully to delete obsolete log files from ASM disk groups. Verify their usage with:bashCopyEditasmcmd ls -l <directory_path>
- Use
- Post-Changes Validation:
- Confirm the configuration using:sqlCopyEdit
select group#, thread#, bytes/1024/1024 as size_mb, status from v$standby_log;
- Confirm the configuration using:sqlCopyEdit
- Monitoring:
- Monitor the Data Guard environment for errors:sqlCopyEdit
select severity, error_code, message from v$dataguard_status order by timestamp desc;
- Monitor the Data Guard environment for errors:sqlCopyEdit
Let me know if you need further assistance or troubleshooting!