As you know, when performing backups with the RMAN tool, you can use a physical standby instead of the primary database to avoid putting extra load on the primary.
Since the structure of these two environments (primary and physical standby) is essentially the same, there is not much difference in backup operations between them (the datafiles in these two environments match block by block, provided that the standby is synchronized).
The slight difference comes from the open mode of these two databases, and this difference becomes noticeable especially when backing up archive logs. This is because, during an archivelog backup, Oracle executes a log switch — and obviously, this log switch cannot be executed in the physical standby environment.
The following command was executed in the physical standby environment. The RMAN-06820 message in the output confirms the points mentioned above:
rman target /
RMAN> backup archivelog all format '/bkp/%U';
Starting backup at 12-AUG-21
using target database control file instead of recovery catalog
'RMAN-06820: warning: failed to archive current log at primary database'
cannot connect to remote database
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1321 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=179829 RECID=83713 STAMP=1080395727
input archived log thread=1 sequence=179830 RECID=83714 STAMP=1080395729
channel ORA_DISK_1: starting piece 1 at 12-AUG-21
channel ORA_DISK_1: finished piece 1 at 12-AUG-21
piece handle=/bkp/iv06b2l4_1_1 tag=TAG20210812T140732 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
To avoid this issue, you should provide the SYS user password when connecting to the physical standby. In this case, the log switch will be executed on the primary database:
rman target sys/sys
RMAN> backup archivelog all format '/bkp/%U';
Starting backup at 12-AUG-21
using target database control file instead of recovery catalog
'current log archived at primary database'
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1321 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=179829 RECID=83713 STAMP=1080395727
input archived log thread=1 sequence=179830 RECID=83714 STAMP=1080395729
input archived log thread=1 sequence=179831 RECID=83715 STAMP=1080396540
channel ORA_DISK_1: starting piece 1 at 12-AUG-21
channel ORA_DISK_1: finished piece 1 at 12-AUG-21
piece handle=/bkp/j106b2nv_1_1 tag=TAG20210812T140903 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 12-AUG-21
In the alert log of the primary environment, you can see the information about this log switch:
2021-08-12T14:13:40.047070+04:30
ALTER SYSTEM ARCHIVE LOG
2021-08-12T14:13:40.066804+04:30
Thread 1 advanced to log sequence 179832 (LGWR switch)
Current log# 3 seq# 179832 mem# 0: /oradata/DBORG/onlinelog/o1_mf_3_j4675ghj_.log
Current log# 3 seq# 179832 mem# 1: /fra/DBORG/onlinelog/o1_mf_3_j4675jwx_.log
2021-08-12T14:13:40.285117+04:30
TT02 (PID:27803): SRL selected for T-1.S-179832 for LAD:2
2021-08-12T14:13:40.508384+04:30
NET (PID:39106): Archived Log entry 362234 added for T-1.S-179831 ID 0x46023b59 LAD:1
Top comments (0)