Task: Testing Oracle RAC backup in loadbalanced mode, so as test restore from the backup to different client system outside the RAC environment.
In Netbackup for Oracle Guide our scheme is named as "Failover VIP exists and backup is load balanced"
To realize Oracle RAC backup we have made the following settings:
1. Specific sh-script was written
cat /acfsshare/backup/dbm_rman_backup_11g.sh
that includes necessary lines
RUN {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE' CONNECT $TARGET_CONNECT_STR;
ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE' CONNECT $TARGET_CONNECT_STR;
SEND 'NB_ORA_POLICY=EXT_ORA';
BACKUP
archivelog all
BACKUP SPFILE FORMAT 'spfile_${DATE}_%U.ora';
BACKUP CURRENT CONTROLFILE FORMAT 'control_${DATE}_%U.ctl';
delete noprompt obsolete;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
}
2. Backup policies in Netbackup were created
EXT_ora_dbm1 - starts the backup script which starts the next policy
EXT_ORA - starts the loadbalanced backup
3. Alternate names files were created in the following directory
C:\Program Files\Veritas\NetBackup\db\altnames
file dm2db01
dm2db01.domain.ru
dm2db02.domain.ru
dm2-scan.domain.ru
oratest01
oratest01.localdomain
file dm2db02
dm2db01.domain.ru
dm2db02.domain.ru
dm2-scan.domain.ru
oratest01
oratest01.localdomain
file oratest01
oratest01
oratest01.localdomain
dm2db01.domain.ru
dm2db02.domain.ru
dm2-scan.domain.ru
dm2db01
dm2db02
As you can see files were fulfilled with surplus data for eliminating any name mistakes.
4. In order to store all backup image data in one directory 2 directory junctions were created in the image-directory
C:\Program Files\Veritas\NetBackup\db\images\dm2db01.domain.ru <<===>> C:\Program Files\Veritas\NetBackup\db\images\dm2-scan.domain.ru
C:\Program Files\Veritas\NetBackup\db\images\dm2db02.domain.ru <<===>> C:\Program Files\Veritas\NetBackup\db\images\dm2-scan.domain.ru
It allows netbackup to store all the backup data into one directory from both RAC-nodes C:\Program Files\Veritas\NetBackup\db\images\dm2-scan.domain.ru
As a result we have successfully backup archivelogs from both nodes in loadbalanced mode. As we can see below within one session backuppieces copied from both nodes in parallel
But when we trying to restore from that backup we ran into the following problem.
Firstly, when we check which images owned by which client
.\bplist.exe -B -C <client name> -t 4 -l -R /
we can see that storing all backups into one directory does not give us the required result (look at the last copied controlfiles - it is different)
PS C:\Program Files\Veritas\NetBackup\bin> .\bplist.exe -B -C dm2db02.domain.ru -s 04/29/2015 -e 04/29/2015 -t 4 -l -R
/
-rw-rw---- oracle dba 189267968 ряЁ 29 13:08 c-1282940970-20150429-19:\
-rw-rw---- oracle dba 189267968 ряЁ 29 13:08 control_20150429_1306_duq5jm1u_1_1.ctl:\
-rw-rw---- oracle dba 262144 ряЁ 29 13:07 spfile_20150429_1306_dtq5jm12_1_1.ora:\
-rw-rw---- oracle dba 4456448 ряЁ 29 13:07 arch_DBM_20150429_1306_drq5jlvp_1_1.rman:\
-rw-rw---- oracle dba 189267968 ряЁ 29 11:08 c-1282940970-20150429-17:\
-rw-rw---- oracle dba 189267968 ряЁ 29 11:08 control_20150429_1106_dkq5jf1c_1_1.ctl:\
-rw-rw---- oracle dba 262144 ряЁ 29 11:08 spfile_20150429_1106_djq5jf0g_1_1.ora:\
-rw-rw---- oracle dba 2097152 ряЁ 29 11:07 arch_DBM_20150429_1106_diq5jevh_1_1.rman:\
-rw-rw---- oracle dba 524288 ряЁ 29 11:06 arch_DBM_20150429_1106_dgq5jeue_1_1.rman:\
-rw-rw---- oracle dba 189267968 ряЁ 29 10:37 c-1282940970-20150429-16:\
-rw-rw---- oracle dba 189267968 ряЁ 29 10:37 control_20150429_1035_deq5jd6i_1_1.ctl:\
-rw-rw---- oracle dba 262144 ряЁ 29 10:36 spfile_20150429_1035_ddq5jd5m_1_1.ora:\
-rw-rw---- oracle dba 262144 ряЁ 29 10:36 arch_DBM_20150429_1035_dcq5jd4o_1_1.rman:\
-rw-rw---- oracle dba 2097152 ряЁ 29 10:35 arch_DBM_20150429_1035_dbq5jd3k_1_1.rman:\
-rw-rw---- oracle dba 2621440 ряЁ 29 10:35 arch_DBM_20150429_1035_daq5jd3k_1_1.rman:\
PS C:\Program Files\Veritas\NetBackup\bin> .\bplist.exe -B -C dm2db01.domain.ru -s 04/29/2015 -e 04/29/2015 -t 4 -l -R
/
-rw-rw---- oracle dba 189267968 ряЁ 29 14:07 c-1282940970-20150429-1a:\
-rw-rw---- oracle dba 189267968 ряЁ 29 14:06 control_20150429_1406_e3q5jpf8_1_1.ctl:\
-rw-rw---- oracle dba 262144 ряЁ 29 14:06 spfile_20150429_1406_e2q5jped_1_1.ora:\
-rw-rw---- oracle dba 4456448 ряЁ 29 14:05 arch_DBM_20150429_1406_e1q5jpd4_1_1.rman:\
-rw-rw---- oracle dba 4718592 ряЁ 29 14:05 arch_DBM_20150429_1406_e0q5jpd4_1_1.rman:\
-rw-rw---- oracle dba 4718592 ряЁ 29 13:05 arch_DBM_20150429_1306_dsq5jlt0_1_1.rman:\
-rw-rw---- oracle dba 189267968 ряЁ 29 12:07 c-1282940970-20150429-18:\
-rw-rw---- oracle dba 189267968 ряЁ 29 12:06 control_20150429_1206_dpq5jiep_1_1.ctl:\
-rw-rw---- oracle dba 262144 ряЁ 29 12:06 spfile_20150429_1206_doq5jidu_1_1.ora:\
-rw-rw---- oracle dba 4456448 ряЁ 29 12:05 arch_DBM_20150429_1206_dnq5jicl_1_1.rman:\
-rw-rw---- oracle dba 4718592 ряЁ 29 12:05 arch_DBM_20150429_1206_dmq5jicl_1_1.rman:\
-rw-rw---- oracle dba 2621440 ряЁ 29 11:05 arch_DBM_20150429_1106_dhq5jerk_1_1.rman:\
-rw-rw---- oracle dba 61865984 ряЁ 29 10:08 c-3799112179-20150429-15:\
-rw-rw---- oracle dba 189267968 ряЁ 29 10:08 c-1282940970-20150429-15:\
-rw-rw---- oracle dba 61865984 ряЁ 29 10:07 cntrl_FSSDBE_18910_1_878292478:\
-rw-rw---- oracle dba 189267968 ряЁ 29 10:07 cntrl_DBM_16808_1_878292467:\
-rw-rw---- oracle dba 61865984 ряЁ 29 10:07 c-3799112179-20150429-14:\
-rw-rw---- oracle dba 189267968 ряЁ 29 10:07 c-1282940970-20150429-14:\
-rw-rw---- oracle dba 65536000 ряЁ 29 10:06 al_FSSDBE_18908_1_878292409:\
-rw-rw---- oracle dba 9175040 ряЁ 29 10:06 al_DBM_16806_1_878292408:\
So Netbackup does not accept backups from first node to be the same backups from second node and otherwise.
At the time of restore to the test client oratest01, when we allocate only one chennal (for node dm2db01 for example), RMAN does not recieve the last backed up spfile.
RMAN> RUN
{
set dbid=1282940970;
ALLOCATE CHANNEL c1 DEVICE TYPE sbt ;
SEND 'NB_ORA_CLIENT=dm2db02.domain.ru';
RESTORE SPFILE TO pfile '/tmp/pfile.ora';
}
2> 3> 4> 5> 6> 7>
executing command: SET DBID
database name is "DBM" and DBID is 1282940970
allocated channel: c1
channel c1: SID=171 device type=SBT_TAPE
channel c1: Veritas NetBackup for Oracle - Release 7.5 (2012020801)
sent command to channel: c1
Starting restore at 29-APR-15
channel c1: starting datafile backup set restore
channel c1: restoring SPFILE to PFILE
output file name=/tmp/pfile.ora
channel c1: reading from backup piece c-1282940970-20150429-1a
channel c1: ORA-19870: error while restoring backup piece c-1282940970-20150429-1a
ORA-19507: failed to retrieve sequential file, handle="c-1282940970-20150429-1a", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
Backup file <c-1282940970-20150429-1a> not found in NetBackup catalog
failover to previous backup
channel c1: starting datafile backup set restore
channel c1: restoring SPFILE to PFILE
output file name=/tmp/pfile.ora
channel c1: reading from backup piece spfile_20150429_1406_e2q5jped_1_1.ora
channel c1: ORA-19870: error while restoring backup piece spfile_20150429_1406_e2q5jped_1_1.ora
ORA-19507: failed to retrieve sequential file, handle="spfile_20150429_1406_e2q5jped_1_1.ora", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
Backup file <spfile_20150429_1406_e2q5jped_1_1.ora> not found in NetBackup catalog
failover to previous backup
channel c1: starting datafile backup set restore
channel c1: restoring SPFILE to PFILE
output file name=/tmp/pfile.ora
channel c1: reading from backup piece c-1282940970-20150429-19
channel c1: piece handle=c-1282940970-20150429-19 tag=TAG20150429T130843
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:25
Finished restore at 29-APR-15
released channel: c1
If we want to restore archivelogs we should exactly know from whitch node every file were backed up.
But we have found one undocumented solution, and we dont know how it will work in multinode RAC environment. You should allocete both channels to restore from both nodes:
RMAN> RUN
{
set dbid=1282940970;
ALLOCATE CHANNEL c1 DEVICE TYPE sbt PARMS='ENV=(NB_ORA_CLIENT=dm2db01.domain.ru)';
ALLOCATE CHANNEL c2 DEVICE TYPE sbt PARMS='ENV=(NB_ORA_CLIENT=dm2db02.domain.ru)';
RESTORE SPFILE TO pfile '/tmp/pfile.ora';
}
2> 3> 4> 5> 6> 7>
executing command: SET DBID
database name is "DBM" and DBID is 1282940970
allocated channel: c1
channel c1: SID=171 device type=SBT_TAPE
channel c1: Veritas NetBackup for Oracle - Release 7.5 (2012020801)
allocated channel: c2
channel c2: SID=11 device type=SBT_TAPE
channel c2: Veritas NetBackup for Oracle - Release 7.5 (2012020801)
Starting restore at 29-APR-15
channel c1: starting datafile backup set restore
channel c1: restoring SPFILE to PFILE
output file name=/tmp/pfile.ora
channel c1: reading from backup piece c-1282940970-20150429-1a
channel c1: piece handle=c-1282940970-20150429-1a tag=TAG20150429T140702
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:35
Finished restore at 29-APR-15
released channel: c1
released channel: c2
Now we can see that the last control file restores at first try.
But in multinode cluster (as example with 20 nodes), we should allocate 20 channels and we do not know how it will work then.
The main question is the following.
All that we did is correct i think, so why the command responds incorrectly?
.\bplist.exe -B -C <node name> -t 4 -l -R /
It does not show the same results for both nodes, and how to get rid of allocating more channels at time of restore?? Why in the official guide Netbackup for Oracle vendor offers to store backups from both nodes in one directory if it doesn't give us the required result?
Sorry for my English...