By William Sescu

From the RMAN point of view, you have generally two possibilities to store your backups, on Disk or on Tape. In case of a single instance, it doesn’t really matter from the accessible or inaccessible point of view. However, in a DataGuard environment it makes a huge difference.

Per default, backups to Tape are always accessible and backups to disk always inaccessible. But what do you do in case you backup to NFS, and you want the backups to be usable on Primary and Standby?

Ok. Let’s to a quick demo.

Before we start, make sure that the oracle Unix user has the same unique id, and group id. If not, you end up with a big mess.

oracle@dbidg01:/home/oracle/ [DBIT122] id -a
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(sysbkp),54324(sysdg),54325(syskm),54326(oper)

The next import thing with NFS are the mount options. Oracle has documented it quite well which mount options are needed if you put Binaries, Datafiles or CRS Voting Disk and OCR on it.

Mount Options for Oracle files for RAC databases and Clusterware when used with NFS on NAS devices (Doc ID 359515.1)

For Linux x86-64bit it would be the following options for Datafiles

rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,vers=3,timeo=600

However, if your NFS mount is needed only for RMAN backup pieces, the actimeo=0 is not recommended. The actimeo=0 disables all NFS attribute caching, like acregmin, acregmax, acdirmin and acdirmax. And disabling attribute caching is suboptimal for RMAN backups. See also the following MOS note:

NFS options for 11.2.0.2 RMAN disk backups on Linux 64-bit (Doc ID 1117597.1)

I am using for that example NFS 4.1 and these are the mount options I use.

[root@dbidg01 etc]# mount | grep nfs4
dbidg03:/u99 on /u99 type nfs4 (rw,relatime,vers=4.1,rsize=32768,wsize=32768,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.56.201,local_lock=none,addr=192.168.56.203)

Last but not least, the Primary database has to be registered with the RMAN catalog. This is a very important point when working with RMAN in a DataGuard environment.

Ok. Let’s do the first backup on the Primary.

-- Primary

oracle@dbidg01:/home/oracle/ [DBIT122] rman target / catalog rman/rman@pdb1

Recovery Manager: Release 12.2.0.1.0 - Production on Tue Jan 24 08:09:16 2017

Copyright (c) 1982, 2016, Oracle and/or its affiliates.  All rights reserved.

connected to target database: DBIT122 (DBID=653953745)
connected to recovery catalog database


RMAN> list backup summary;

specification does not match any backup in the repository

RMAN> backup database plus archivelog tag 'DBI_BACKUP_ON_PRIMARY' format '/u99/backup/DBIT122/%U';


Starting backup at 24-JAN-2017 08:09:45
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=31 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=36 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=68 RECID=386 STAMP=934081238
channel ORA_DISK_1: starting piece 1 at 24-JAN-2017 08:09:46
channel ORA_DISK_2: starting archived log backup set
channel ORA_DISK_2: specifying archived log(s) in backup set
input archived log thread=1 sequence=69 RECID=388 STAMP=934099691
input archived log thread=1 sequence=70 RECID=390 STAMP=934099729
input archived log thread=1 sequence=71 RECID=392 STAMP=934099785
channel ORA_DISK_2: starting piece 1 at 24-JAN-2017 08:09:46
channel ORA_DISK_2: finished piece 1 at 24-JAN-2017 08:09:47
piece handle=/u99/backup/DBIT122/2vrqqeqa_1_1 tag=DBI_BACKUP_ON_PRIMARY comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_2: starting archived log backup set
channel ORA_DISK_2: specifying archived log(s) in backup set
input archived log thread=1 sequence=64 RECID=378 STAMP=934044533
input archived log thread=1 sequence=65 RECID=380 STAMP=934044555
input archived log thread=1 sequence=66 RECID=382 STAMP=934045153
input archived log thread=1 sequence=67 RECID=384 STAMP=934045183
channel ORA_DISK_2: starting piece 1 at 24-JAN-2017 08:09:47
channel ORA_DISK_1: finished piece 1 at 24-JAN-2017 08:09:48
piece handle=/u99/backup/DBIT122/2urqqeqa_1_1 tag=DBI_BACKUP_ON_PRIMARY comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
channel ORA_DISK_2: finished piece 1 at 24-JAN-2017 08:09:48
piece handle=/u99/backup/DBIT122/30rqqeqb_1_1 tag=DBI_BACKUP_ON_PRIMARY comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:01
Finished backup at 24-JAN-2017 08:09:48

Starting backup at 24-JAN-2017 08:09:48
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u02/oradata/DBIT122_SITE1/datafile/o1_mf_system_d4fnthn8_.dbf
input datafile file number=00007 name=/u02/oradata/DBIT122_SITE1/datafile/o1_mf_users_d4fnx3bd_.dbf
channel ORA_DISK_1: starting piece 1 at 24-JAN-2017 08:09:49
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00003 name=/u02/oradata/DBIT122_SITE1/datafile/o1_mf_sysaux_d4fnvx0w_.dbf
input datafile file number=00004 name=/u02/oradata/DBIT122_SITE1/datafile/o1_mf_undotbs1_d4fnx03r_.dbf
input datafile file number=00002 name=/u02/oradata/DBIT122_SITE1/datafile/o1_mf_dbv_d7klp09z_.dbf
channel ORA_DISK_2: starting piece 1 at 24-JAN-2017 08:09:49
channel ORA_DISK_2: finished piece 1 at 24-JAN-2017 08:09:52
piece handle=/u03/fast_recovery_area/DBIT122_SITE1/backupset/2017_01_24/o1_mf_nnndf_TAG20170124T080948_d8fzfxqx_.bkp tag=TAG20170124T080948 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_2: starting piece 1 at 24-JAN-2017 08:09:53
channel ORA_DISK_1: finished piece 1 at 24-JAN-2017 08:09:54
piece handle=/u03/fast_recovery_area/DBIT122_SITE1/backupset/2017_01_24/o1_mf_nnndf_TAG20170124T080948_d8fzfxps_.bkp tag=TAG20170124T080948 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:05
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 24-JAN-2017 08:09:54
channel ORA_DISK_2: finished piece 1 at 24-JAN-2017 08:09:54
piece handle=/u03/fast_recovery_area/DBIT122_SITE1/backupset/2017_01_24/o1_mf_ncnnf_TAG20170124T080948_d8fzg1yp_.bkp tag=TAG20170124T080948 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: finished piece 1 at 24-JAN-2017 08:09:55
piece handle=/u03/fast_recovery_area/DBIT122_SITE1/backupset/2017_01_24/o1_mf_nnsnf_TAG20170124T080948_d8fzg2yn_.bkp tag=TAG20170124T080948 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 24-JAN-2017 08:09:55

Starting backup at 24-JAN-2017 08:09:56
current log archived
using channel ORA_DISK_1
using channel ORA_DISK_2
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=72 RECID=394 STAMP=934099796
channel ORA_DISK_1: starting piece 1 at 24-JAN-2017 08:09:56
channel ORA_DISK_1: finished piece 1 at 24-JAN-2017 08:09:57
piece handle=/u99/backup/DBIT122/35rqqeqk_1_1 tag=DBI_BACKUP_ON_PRIMARY comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 24-JAN-2017 08:09:57

RMAN>

RMAN> list backup summary completed after 'sysdate -1';


List of Backups
===============
Key     TY LV S Device Type Completion Time      #Pieces #Copies Compressed Tag
------- -- -- - ----------- -------------------- ------- ------- ---------- ---
1981    B  A  A DISK        24-JAN-2017 08:09:46 1       1       NO         DBI_BACKUP_ON_PRIMARY
1982    B  A  A DISK        24-JAN-2017 08:09:48 1       1       NO         DBI_BACKUP_ON_PRIMARY
1983    B  A  A DISK        24-JAN-2017 08:09:46 1       1       NO         DBI_BACKUP_ON_PRIMARY
2003    B  F  A DISK        24-JAN-2017 08:09:51 1       1       NO         TAG20170124T080948
2004    B  F  A DISK        24-JAN-2017 08:09:53 1       1       NO         TAG20170124T080948
2005    B  F  A DISK        24-JAN-2017 08:09:54 1       1       NO         TAG20170124T080948
2006    B  F  A DISK        24-JAN-2017 08:09:54 1       1       NO         TAG20170124T080948
2025    B  A  A DISK        24-JAN-2017 08:09:56 1       1       NO         DBI_BACKUP_ON_PRIMARY

 

Ok. So what does my Standby know about this backup, which I have done on the Primary.

oracle@dbidg02:/u99/backup/DBIT122/ [DBIT122] rman target / catalog rman/rman@pdb1

Recovery Manager: Release 12.2.0.1.0 - Production on Tue Jan 24 08:11:12 2017

Copyright (c) 1982, 2016, Oracle and/or its affiliates.  All rights reserved.

connected to target database: DBIT122 (DBID=653953745)
connected to recovery catalog database

RMAN> list backup summary completed after 'sysdate -1';

specification does not match any backup in the repository

RMAN>

 

Nothing …

Ok. Let’s do now a backup on the Standby to NFS and check if it is visible on the Primary.

RMAN> backup database plus archivelog tag 'DBI_BACKUP_ON_STANDBY' format '/u99/backup/DBIT122/%U';


Starting backup at 24-JAN-2017 08:11:49
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=271 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=41 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=64 RECID=291 STAMP=934044533
input archived log thread=1 sequence=65 RECID=292 STAMP=934044555
input archived log thread=1 sequence=66 RECID=293 STAMP=934045153
input archived log thread=1 sequence=67 RECID=294 STAMP=934045183
input archived log thread=1 sequence=68 RECID=295 STAMP=934081238
channel ORA_DISK_1: starting piece 1 at 24-JAN-2017 08:11:50
channel ORA_DISK_2: starting archived log backup set
channel ORA_DISK_2: specifying archived log(s) in backup set
input archived log thread=1 sequence=69 RECID=296 STAMP=934099691
input archived log thread=1 sequence=70 RECID=297 STAMP=934099729
input archived log thread=1 sequence=71 RECID=298 STAMP=934099785
input archived log thread=1 sequence=72 RECID=299 STAMP=934099796
channel ORA_DISK_2: starting piece 1 at 24-JAN-2017 08:11:50
channel ORA_DISK_2: finished piece 1 at 24-JAN-2017 08:11:51
piece handle=/u99/backup/DBIT122/49rqqeu6_1_1 tag=DBI_BACKUP_ON_STANDBY comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: finished piece 1 at 24-JAN-2017 08:11:53
piece handle=/u99/backup/DBIT122/48rqqeu6_1_1 tag=DBI_BACKUP_ON_STANDBY comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 24-JAN-2017 08:11:53

Starting backup at 24-JAN-2017 08:11:53
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u02/oradata/DBIT122_SITE2/datafile/o1_mf_system_d4zc9yd3_.dbf
input datafile file number=00007 name=/u02/oradata/DBIT122_SITE2/datafile/o1_mf_users_d4zccmnt_.dbf
channel ORA_DISK_1: starting piece 1 at 24-JAN-2017 08:11:54
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00003 name=/u02/oradata/DBIT122_SITE2/datafile/o1_mf_sysaux_d4zcbr8r_.dbf
input datafile file number=00004 name=/u02/oradata/DBIT122_SITE2/datafile/o1_mf_undotbs1_d4zccjnc_.dbf
input datafile file number=00002 name=/u02/oradata/DBIT122_SITE2/datafile/o1_mf_dbv_d7klp0gg_.dbf
channel ORA_DISK_2: starting piece 1 at 24-JAN-2017 08:11:54
channel ORA_DISK_1: finished piece 1 at 24-JAN-2017 08:12:09
piece handle=/u03/fast_recovery_area/DBIT122_SITE2/backupset/2017_01_24/o1_mf_nnndf_TAG20170124T081153_d8fzktfn_.bkp tag=TAG20170124T081153 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
channel ORA_DISK_2: finished piece 1 at 24-JAN-2017 08:12:09
piece handle=/u03/fast_recovery_area/DBIT122_SITE2/backupset/2017_01_24/o1_mf_nnndf_TAG20170124T081153_d8fzktg7_.bkp tag=TAG20170124T081153 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_2: starting piece 1 at 24-JAN-2017 08:12:09
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 24-JAN-2017 08:12:10
channel ORA_DISK_2: finished piece 1 at 24-JAN-2017 08:12:10
piece handle=/u03/fast_recovery_area/DBIT122_SITE2/backupset/2017_01_24/o1_mf_nnsnf_TAG20170124T081153_d8fzl9p7_.bkp tag=TAG20170124T081153 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: finished piece 1 at 24-JAN-2017 08:12:11
piece handle=/u03/fast_recovery_area/DBIT122_SITE2/backupset/2017_01_24/o1_mf_ncnnf_TAG20170124T081153_d8fzlbqg_.bkp tag=TAG20170124T081153 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 24-JAN-2017 08:12:11

Starting backup at 24-JAN-2017 08:12:11
RMAN-06820: warning: failed to archive current log at primary database
cannot connect to remote database
using channel ORA_DISK_1
using channel ORA_DISK_2
specification does not match any archived log in the repository
backup cancelled because there are no files to backup
Finished backup at 24-JAN-2017 08:12:12

RMAN>

RMAN> list backup summary completed after 'sysdate -1';


List of Backups
===============
Key     TY LV S Device Type Completion Time      #Pieces #Copies Compressed Tag
------- -- -- - ----------- -------------------- ------- ------- ---------- ---
2065    B  A  A DISK        24-JAN-2017 08:11:50 1       1       NO         DBI_BACKUP_ON_STANDBY
2066    B  A  A DISK        24-JAN-2017 08:11:50 1       1       NO         DBI_BACKUP_ON_STANDBY
2084    B  F  A DISK        24-JAN-2017 08:12:01 1       1       NO         TAG20170124T081153
2085    B  F  A DISK        24-JAN-2017 08:12:02 1       1       NO         TAG20170124T081153
2086    B  F  A DISK        24-JAN-2017 08:12:09 1       1       NO         TAG20170124T081153
2087    B  F  A DISK        24-JAN-2017 08:12:10 1       1       NO         TAG20170124T081153

 

Now let’s check the Primary.

-- Primary

RMAN> list backup summary completed after 'sysdate -1';


List of Backups
===============
Key     TY LV S Device Type Completion Time      #Pieces #Copies Compressed Tag
------- -- -- - ----------- -------------------- ------- ------- ---------- ---
1981    B  A  A DISK        24-JAN-2017 08:09:46 1       1       NO         DBI_BACKUP_ON_PRIMARY
1982    B  A  A DISK        24-JAN-2017 08:09:48 1       1       NO         DBI_BACKUP_ON_PRIMARY
1983    B  A  A DISK        24-JAN-2017 08:09:46 1       1       NO         DBI_BACKUP_ON_PRIMARY
2003    B  F  A DISK        24-JAN-2017 08:09:51 1       1       NO         TAG20170124T080948
2004    B  F  A DISK        24-JAN-2017 08:09:53 1       1       NO         TAG20170124T080948
2005    B  F  A DISK        24-JAN-2017 08:09:54 1       1       NO         TAG20170124T080948
2006    B  F  A DISK        24-JAN-2017 08:09:54 1       1       NO         TAG20170124T080948
2025    B  A  A DISK        24-JAN-2017 08:09:56 1       1       NO         DBI_BACKUP_ON_PRIMARY

 

No … nothing there from the Standby. Only the backups done on the Primary are visible.

Before we continue, let’s take a look at the following warning message that appeared on the standby database:

RMAN-06820: warning: failed to archive current log at primary database

In a DataGuard environment, it is not a good practise to logon to the standby with “rman target /”. You should use the
username/password@connectstring instead, or Wallets, if configured. To have a good backup on the Standby, Oracle first attempts to archive the current online redo log, and before the backup ends, it does another one. That’s why you see the RMAN-06820 twice. In case you are doing backups on the standby, always use “username/password@connectstring” or Wallets.

oracle@dbidg02:/u99/backup/DBIT122/ [DBIT122] rman target sys/Manager1@DBIT122_SITE2 catalog rman/rman@PDB1

Recovery Manager: Release 12.2.0.1.0 - Production on Tue Jan 24 08:15:47 2017

Copyright (c) 1982, 2016, Oracle and/or its affiliates.  All rights reserved.

connected to target database: DBIT122 (DBID=653953745)
connected to recovery catalog database

RMAN> backup database plus archivelog tag 'DBI_BACKUP_ON_STANDBY' format '/u99/backup/DBIT122/%U';


Starting backup at 24-JAN-2017 08:16:09
current log archived at primary database
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=271 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=16 device type=DISK
skipping archived logs of thread 1 from sequence 64 to 72; already backed up
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=73 RECID=300 STAMP=934100169
channel ORA_DISK_1: starting piece 1 at 24-JAN-2017 08:16:11
channel ORA_DISK_1: finished piece 1 at 24-JAN-2017 08:16:12
piece handle=/u99/backup/DBIT122/4erqqf6b_1_1 tag=DBI_BACKUP_ON_STANDBY comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 24-JAN-2017 08:16:12

Starting backup at 24-JAN-2017 08:16:12
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u02/oradata/DBIT122_SITE2/datafile/o1_mf_system_d4zc9yd3_.dbf
input datafile file number=00007 name=/u02/oradata/DBIT122_SITE2/datafile/o1_mf_users_d4zccmnt_.dbf
channel ORA_DISK_1: starting piece 1 at 24-JAN-2017 08:16:13
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00003 name=/u02/oradata/DBIT122_SITE2/datafile/o1_mf_sysaux_d4zcbr8r_.dbf
input datafile file number=00004 name=/u02/oradata/DBIT122_SITE2/datafile/o1_mf_undotbs1_d4zccjnc_.dbf
input datafile file number=00002 name=/u02/oradata/DBIT122_SITE2/datafile/o1_mf_dbv_d7klp0gg_.dbf
channel ORA_DISK_2: starting piece 1 at 24-JAN-2017 08:16:13
channel ORA_DISK_1: finished piece 1 at 24-JAN-2017 08:16:28
piece handle=/u03/fast_recovery_area/DBIT122_SITE2/backupset/2017_01_24/o1_mf_nnndf_TAG20170124T081612_d8fzsx8o_.bkp tag=TAG20170124T081612 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
channel ORA_DISK_2: finished piece 1 at 24-JAN-2017 08:16:28
piece handle=/u03/fast_recovery_area/DBIT122_SITE2/backupset/2017_01_24/o1_mf_nnndf_TAG20170124T081612_d8fzsx94_.bkp tag=TAG20170124T081612 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_2: starting piece 1 at 24-JAN-2017 08:16:28
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 24-JAN-2017 08:16:28
channel ORA_DISK_2: finished piece 1 at 24-JAN-2017 08:16:28
piece handle=/u03/fast_recovery_area/DBIT122_SITE2/backupset/2017_01_24/o1_mf_nnsnf_TAG20170124T081612_d8fztdkp_.bkp tag=TAG20170124T081612 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:00
channel ORA_DISK_1: finished piece 1 at 24-JAN-2017 08:16:29
piece handle=/u03/fast_recovery_area/DBIT122_SITE2/backupset/2017_01_24/o1_mf_ncnnf_TAG20170124T081612_d8fztdl7_.bkp tag=TAG20170124T081612 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 24-JAN-2017 08:16:29

Starting backup at 24-JAN-2017 08:16:29
current log archived at primary database
using channel ORA_DISK_1
using channel ORA_DISK_2
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=74 RECID=301 STAMP=934100189
channel ORA_DISK_1: starting piece 1 at 24-JAN-2017 08:16:31
channel ORA_DISK_1: finished piece 1 at 24-JAN-2017 08:16:32
piece handle=/u99/backup/DBIT122/4jrqqf6v_1_1 tag=DBI_BACKUP_ON_STANDBY comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 24-JAN-2017 08:16:32

RMAN>


-- A message like the following popps up in the alert.log of the Primary, when Backup was done correctly.

ALTER SYSTEM ARCHIVE LOG
2017-01-24T08:16:09.244238+01:00
LGWR: Standby redo logfile selected to archive thread 1 sequence 74
LGWR: Standby redo logfile selected for thread 1 sequence 74 for destination LOG_ARCHIVE_DEST_2
2017-01-24T08:16:09.264207+01:00
Thread 1 advanced to log sequence 74 (LGWR switch)
  Current log# 2 seq# 74 mem# 0: /u02/oradata/DBIT122_SITE1/onlinelog/o1_mf_2_d4fotcnx_.log
  Current log# 2 seq# 74 mem# 1: /u03/fast_recovery_area/DBIT122_SITE1/onlinelog/o1_mf_2_d4fotkvy_.log
2017-01-24T08:16:09.268607+01:00
Archived Log entry 396 added for T-1.S-73 ID 0x27387e4f LAD:1
2017-01-24T08:16:29.636421+01:00
ALTER SYSTEM ARCHIVE LOG
2017-01-24T08:16:29.656594+01:00
LGWR: Standby redo logfile selected to archive thread 1 sequence 75
LGWR: Standby redo logfile selected for thread 1 sequence 75 for destination LOG_ARCHIVE_DEST_2
2017-01-24T08:16:29.665882+01:00
Thread 1 advanced to log sequence 75 (LGWR switch)

 

Nevertheless, we still can’t see the backups on Primary which were done on Standby. Now the accessible flag comes into play. If executed on Primary, you can see now the backups which were done on the Standby.

-- Primary

RMAN> set backup files for device type disk to accessible;

executing command: SET backup

RMAN> list backup summary completed after 'sysdate -1';


List of Backups
===============
Key     TY LV S Device Type Completion Time      #Pieces #Copies Compressed Tag
------- -- -- - ----------- -------------------- ------- ------- ---------- ---
1981    B  A  A DISK        24-JAN-2017 08:09:46 1       1       NO         DBI_BACKUP_ON_PRIMARY
1982    B  A  A DISK        24-JAN-2017 08:09:48 1       1       NO         DBI_BACKUP_ON_PRIMARY
1983    B  A  A DISK        24-JAN-2017 08:09:46 1       1       NO         DBI_BACKUP_ON_PRIMARY
2003    B  F  A DISK        24-JAN-2017 08:09:51 1       1       NO         TAG20170124T080948
2004    B  F  A DISK        24-JAN-2017 08:09:53 1       1       NO         TAG20170124T080948
2005    B  F  A DISK        24-JAN-2017 08:09:54 1       1       NO         TAG20170124T080948
2006    B  F  A DISK        24-JAN-2017 08:09:54 1       1       NO         TAG20170124T080948
2025    B  A  A DISK        24-JAN-2017 08:09:56 1       1       NO         DBI_BACKUP_ON_PRIMARY
2065    B  A  A DISK        24-JAN-2017 08:11:50 1       1       NO         DBI_BACKUP_ON_STANDBY
2066    B  A  A DISK        24-JAN-2017 08:11:50 1       1       NO         DBI_BACKUP_ON_STANDBY
2084    B  F  A DISK        24-JAN-2017 08:12:01 1       1       NO         TAG20170124T081153
2085    B  F  A DISK        24-JAN-2017 08:12:02 1       1       NO         TAG20170124T081153
2086    B  F  A DISK        24-JAN-2017 08:12:09 1       1       NO         TAG20170124T081153
2087    B  F  A DISK        24-JAN-2017 08:12:10 1       1       NO         TAG20170124T081153
2137    B  A  A DISK        24-JAN-2017 08:16:11 1       1       NO         DBI_BACKUP_ON_STANDBY
2148    B  F  A DISK        24-JAN-2017 08:16:17 1       1       NO         TAG20170124T081612
2149    B  F  A DISK        24-JAN-2017 08:16:21 1       1       NO         TAG20170124T081612
2150    B  F  A DISK        24-JAN-2017 08:16:28 1       1       NO         TAG20170124T081612
2151    B  F  A DISK        24-JAN-2017 08:16:28 1       1       NO         TAG20170124T081612
2169    B  A  A DISK        24-JAN-2017 08:16:31 1       1       NO         DBI_BACKUP_ON_STANDBY

RMAN>

 

If executed on Standby, you can see now the backups which were done on the Primary.

 

-- Standby

RMAN> set backup files for device type disk to accessible;

executing command: SET backup

RMAN> list backup summary completed after 'sysdate -1';


List of Backups
===============
Key     TY LV S Device Type Completion Time      #Pieces #Copies Compressed Tag
------- -- -- - ----------- -------------------- ------- ------- ---------- ---
1981    B  A  A DISK        24-JAN-2017 08:09:46 1       1       NO         DBI_BACKUP_ON_PRIMARY
1982    B  A  A DISK        24-JAN-2017 08:09:48 1       1       NO         DBI_BACKUP_ON_PRIMARY
1983    B  A  A DISK        24-JAN-2017 08:09:46 1       1       NO         DBI_BACKUP_ON_PRIMARY
2003    B  F  A DISK        24-JAN-2017 08:09:51 1       1       NO         TAG20170124T080948
2004    B  F  A DISK        24-JAN-2017 08:09:53 1       1       NO         TAG20170124T080948
2005    B  F  A DISK        24-JAN-2017 08:09:54 1       1       NO         TAG20170124T080948
2006    B  F  A DISK        24-JAN-2017 08:09:54 1       1       NO         TAG20170124T080948
2025    B  A  A DISK        24-JAN-2017 08:09:56 1       1       NO         DBI_BACKUP_ON_PRIMARY
2065    B  A  A DISK        24-JAN-2017 08:11:50 1       1       NO         DBI_BACKUP_ON_STANDBY
2066    B  A  A DISK        24-JAN-2017 08:11:50 1       1       NO         DBI_BACKUP_ON_STANDBY
2084    B  F  A DISK        24-JAN-2017 08:12:01 1       1       NO         TAG20170124T081153
2085    B  F  A DISK        24-JAN-2017 08:12:02 1       1       NO         TAG20170124T081153
2086    B  F  A DISK        24-JAN-2017 08:12:09 1       1       NO         TAG20170124T081153
2087    B  F  A DISK        24-JAN-2017 08:12:10 1       1       NO         TAG20170124T081153
2137    B  A  A DISK        24-JAN-2017 08:16:11 1       1       NO         DBI_BACKUP_ON_STANDBY
2148    B  F  A DISK        24-JAN-2017 08:16:17 1       1       NO         TAG20170124T081612
2149    B  F  A DISK        24-JAN-2017 08:16:21 1       1       NO         TAG20170124T081612
2150    B  F  A DISK        24-JAN-2017 08:16:28 1       1       NO         TAG20170124T081612
2151    B  F  A DISK        24-JAN-2017 08:16:28 1       1       NO         TAG20170124T081612
2169    B  A  A DISK        24-JAN-2017 08:16:31 1       1       NO         DBI_BACKUP_ON_STANDBY

RMAN>

If you don’t want to use the the accessible flag, but still want to see the backups on NFS from both sites you have another option. You can use the Oracle DISKSBT library and point it to the NFS directory.

RMAN> CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS  'SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/u99/backup/DBIT122)';

new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS  'SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/u99/backup/DBIT122)';
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN> CONFIGURE DEFAULT DEVICE TYPE TO SBT_TAPE;

old RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
new RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN> backup database plus archivelog tag 'DBI_SBT_TAPE_BACKUP_ON_PRIMARY';


Starting backup at 24-JAN-2017 08:22:16
current log archived
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=31 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: WARNING: Oracle Test Disk API
allocated channel: ORA_SBT_TAPE_2
channel ORA_SBT_TAPE_2: SID=36 device type=SBT_TAPE
channel ORA_SBT_TAPE_2: WARNING: Oracle Test Disk API
channel ORA_SBT_TAPE_1: starting compressed archived log backup set
channel ORA_SBT_TAPE_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=64 RECID=378 STAMP=934044533
input archived log thread=1 sequence=65 RECID=380 STAMP=934044555
input archived log thread=1 sequence=66 RECID=382 STAMP=934045153
input archived log thread=1 sequence=67 RECID=384 STAMP=934045183
input archived log thread=1 sequence=68 RECID=386 STAMP=934081238
channel ORA_SBT_TAPE_1: starting piece 1 at 24-JAN-2017 08:22:16
channel ORA_SBT_TAPE_2: starting compressed archived log backup set
channel ORA_SBT_TAPE_2: specifying archived log(s) in backup set
input archived log thread=1 sequence=69 RECID=388 STAMP=934099691
input archived log thread=1 sequence=70 RECID=390 STAMP=934099729
input archived log thread=1 sequence=71 RECID=392 STAMP=934099785
input archived log thread=1 sequence=72 RECID=394 STAMP=934099796
input archived log thread=1 sequence=73 RECID=396 STAMP=934100169
input archived log thread=1 sequence=74 RECID=398 STAMP=934100189
channel ORA_SBT_TAPE_2: starting piece 1 at 24-JAN-2017 08:22:16
channel ORA_SBT_TAPE_2: finished piece 1 at 24-JAN-2017 08:22:17
piece handle=37rqqfho_1_1 tag=DBI_SBT_TAPE_BACKUP_ON_PRIMARY comment=API Version 2.0,MMS Version 8.1.3.0
channel ORA_SBT_TAPE_2: backup set complete, elapsed time: 00:00:01
channel ORA_SBT_TAPE_2: starting compressed archived log backup set
channel ORA_SBT_TAPE_2: specifying archived log(s) in backup set
input archived log thread=1 sequence=75 RECID=400 STAMP=934100536
channel ORA_SBT_TAPE_2: starting piece 1 at 24-JAN-2017 08:22:18
channel ORA_SBT_TAPE_2: finished piece 1 at 24-JAN-2017 08:22:19
piece handle=38rqqfhq_1_1 tag=DBI_SBT_TAPE_BACKUP_ON_PRIMARY comment=API Version 2.0,MMS Version 8.1.3.0
channel ORA_SBT_TAPE_2: backup set complete, elapsed time: 00:00:01
channel ORA_SBT_TAPE_1: finished piece 1 at 24-JAN-2017 08:22:25
piece handle=36rqqfho_1_1 tag=DBI_SBT_TAPE_BACKUP_ON_PRIMARY comment=API Version 2.0,MMS Version 8.1.3.0
channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:09
Finished backup at 24-JAN-2017 08:22:25

Starting backup at 24-JAN-2017 08:22:25
using channel ORA_SBT_TAPE_1
using channel ORA_SBT_TAPE_2
channel ORA_SBT_TAPE_1: starting compressed full datafile backup set
channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u02/oradata/DBIT122_SITE1/datafile/o1_mf_system_d4fnthn8_.dbf
input datafile file number=00007 name=/u02/oradata/DBIT122_SITE1/datafile/o1_mf_users_d4fnx3bd_.dbf
channel ORA_SBT_TAPE_1: starting piece 1 at 24-JAN-2017 08:22:25
channel ORA_SBT_TAPE_2: starting compressed full datafile backup set
channel ORA_SBT_TAPE_2: specifying datafile(s) in backup set
input datafile file number=00003 name=/u02/oradata/DBIT122_SITE1/datafile/o1_mf_sysaux_d4fnvx0w_.dbf
input datafile file number=00004 name=/u02/oradata/DBIT122_SITE1/datafile/o1_mf_undotbs1_d4fnx03r_.dbf
input datafile file number=00002 name=/u02/oradata/DBIT122_SITE1/datafile/o1_mf_dbv_d7klp09z_.dbf
channel ORA_SBT_TAPE_2: starting piece 1 at 24-JAN-2017 08:22:25
channel ORA_SBT_TAPE_1: finished piece 1 at 24-JAN-2017 08:22:51
piece handle=39rqqfi1_1_1 tag=TAG20170124T082225 comment=API Version 2.0,MMS Version 8.1.3.0
channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:26
channel ORA_SBT_TAPE_1: starting compressed full datafile backup set
channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
channel ORA_SBT_TAPE_2: finished piece 1 at 24-JAN-2017 08:22:51
piece handle=3arqqfi1_1_1 tag=TAG20170124T082225 comment=API Version 2.0,MMS Version 8.1.3.0
channel ORA_SBT_TAPE_2: backup set complete, elapsed time: 00:00:26
channel ORA_SBT_TAPE_2: starting compressed full datafile backup set
channel ORA_SBT_TAPE_2: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_SBT_TAPE_2: starting piece 1 at 24-JAN-2017 08:22:51
including current control file in backup set
channel ORA_SBT_TAPE_1: starting piece 1 at 24-JAN-2017 08:22:52
channel ORA_SBT_TAPE_2: finished piece 1 at 24-JAN-2017 08:22:52
piece handle=3crqqfir_1_1 tag=TAG20170124T082225 comment=API Version 2.0,MMS Version 8.1.3.0
channel ORA_SBT_TAPE_2: backup set complete, elapsed time: 00:00:01
channel ORA_SBT_TAPE_1: finished piece 1 at 24-JAN-2017 08:22:53
piece handle=3brqqfir_1_1 tag=TAG20170124T082225 comment=API Version 2.0,MMS Version 8.1.3.0
channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:01
Finished backup at 24-JAN-2017 08:22:53

Starting backup at 24-JAN-2017 08:22:53
current log archived
using channel ORA_SBT_TAPE_1
using channel ORA_SBT_TAPE_2
channel ORA_SBT_TAPE_1: starting compressed archived log backup set
channel ORA_SBT_TAPE_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=76 RECID=402 STAMP=934100573
channel ORA_SBT_TAPE_1: starting piece 1 at 24-JAN-2017 08:22:54
channel ORA_SBT_TAPE_1: finished piece 1 at 24-JAN-2017 08:22:55
piece handle=3drqqfiu_1_1 tag=DBI_SBT_TAPE_BACKUP_ON_PRIMARY comment=API Version 2.0,MMS Version 8.1.3.0
channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:01
Finished backup at 24-JAN-2017 08:22:55

Now backups on NFS are accessible without the accessible flag. It’s not needed for backups to SBT_TAPE. It’s default. 🙂

RMAN> list backup summary completed after 'sysdate -1';


List of Backups
===============
Key     TY LV S Device Type Completion Time      #Pieces #Copies Compressed Tag
------- -- -- - ----------- -------------------- ------- ------- ---------- ---
1981    B  A  A DISK        24-JAN-2017 08:09:46 1       1       NO         DBI_BACKUP_ON_PRIMARY
1982    B  A  A DISK        24-JAN-2017 08:09:48 1       1       NO         DBI_BACKUP_ON_PRIMARY
1983    B  A  A DISK        24-JAN-2017 08:09:46 1       1       NO         DBI_BACKUP_ON_PRIMARY
2003    B  F  A DISK        24-JAN-2017 08:09:51 1       1       NO         TAG20170124T080948
2004    B  F  A DISK        24-JAN-2017 08:09:53 1       1       NO         TAG20170124T080948
2005    B  F  A DISK        24-JAN-2017 08:09:54 1       1       NO         TAG20170124T080948
2006    B  F  A DISK        24-JAN-2017 08:09:54 1       1       NO         TAG20170124T080948
2025    B  A  A DISK        24-JAN-2017 08:09:56 1       1       NO         DBI_BACKUP_ON_PRIMARY
2065    B  A  A DISK        24-JAN-2017 08:11:50 1       1       NO         DBI_BACKUP_ON_STANDBY
2066    B  A  A DISK        24-JAN-2017 08:11:50 1       1       NO         DBI_BACKUP_ON_STANDBY
2084    B  F  A DISK        24-JAN-2017 08:12:01 1       1       NO         TAG20170124T081153
2085    B  F  A DISK        24-JAN-2017 08:12:02 1       1       NO         TAG20170124T081153
2086    B  F  A DISK        24-JAN-2017 08:12:09 1       1       NO         TAG20170124T081153
2087    B  F  A DISK        24-JAN-2017 08:12:10 1       1       NO         TAG20170124T081153
2137    B  A  A DISK        24-JAN-2017 08:16:11 1       1       NO         DBI_BACKUP_ON_STANDBY
2148    B  F  A DISK        24-JAN-2017 08:16:17 1       1       NO         TAG20170124T081612
2149    B  F  A DISK        24-JAN-2017 08:16:21 1       1       NO         TAG20170124T081612
2150    B  F  A DISK        24-JAN-2017 08:16:28 1       1       NO         TAG20170124T081612
2151    B  F  A DISK        24-JAN-2017 08:16:28 1       1       NO         TAG20170124T081612
2169    B  A  A DISK        24-JAN-2017 08:16:31 1       1       NO         DBI_BACKUP_ON_STANDBY
2312    B  A  A SBT_TAPE    24-JAN-2017 08:22:17 1       1       YES        DBI_SBT_TAPE_BACKUP_ON_PRIMARY
2313    B  A  A SBT_TAPE    24-JAN-2017 08:22:18 1       1       YES        DBI_SBT_TAPE_BACKUP_ON_PRIMARY
2314    B  A  A SBT_TAPE    24-JAN-2017 08:22:20 1       1       YES        DBI_SBT_TAPE_BACKUP_ON_PRIMARY
2345    B  F  A SBT_TAPE    24-JAN-2017 08:22:44 1       1       YES        TAG20170124T082225
2346    B  F  A SBT_TAPE    24-JAN-2017 08:22:46 1       1       YES        TAG20170124T082225
2347    B  F  A SBT_TAPE    24-JAN-2017 08:22:51 1       1       YES        TAG20170124T082225
2348    B  F  A SBT_TAPE    24-JAN-2017 08:22:52 1       1       YES        TAG20170124T082225
2377    B  A  A SBT_TAPE    24-JAN-2017 08:22:54 1       1       YES        DBI_SBT_TAPE_BACKUP_ON_PRIMARY

RMAN>

 

Conclusion

Backups to NFS are perfectly possible, however, in a DataGuard environment it is very useful to see the backups on the primary and standby. You never know which host might fail, so it is good to have all options.