03-20-2013 10:47 AM
Hello everyone, I have a problem I hope you can help me with. I'm participating in a disaster recovery test and am responsible for recovering Oracle databases that run on Solaris servers and am referencing the backups on my Windows NetBackup server. My backups go to a local DataDomain (DD) box and are replicated to a DataDomain box at my DR site and to physical tapes which ares stored offsite. Our system is configured so that NetBackup can see both of the DD devices and in theory allows for different retention periods between my local DD versus the remote DD. Due to capacity constraints both DD backups are configured with the same retention period: one week. One more item: In order to mazimize the DD deduplication capabilities, each Oracle database file is backed up seperately - no interleaving of files is allowed.
The problem is that the recovery of my databases takes place after the recovery of our document management system and MS Exchange. _IF_ everything works perfectly, I can get my Oracle restores done before the backups expire however it is easily possible that a problem with some of the restores would delay my database recovery to past the one week backup retention period.
OK, during the disaster recovery test, we disconnect the DataDomain device at the DR site so it appears as if our main office has been destroyed and is unaccessible - this means that I need to be able to restore from just the backups at the remote DataDomain device. I don't want to risk having my backups expire so I want to add a step to the beginning of my disaster recovery documentation where I change the expiration of my backups from 1 week to 3 months. My plan is to make this change while waiting for the other restores to complete. Below is a sample of what I see for backups. Backups with MediaID @aaaae are on the remote DataDomain device.
D:\Program Files\Veritas\NetBackup\bin\admincmd> bpimmedia -policy ORA_PASPROD -client st31bora01 -d 3/6/2013 00:00:00 -e 3/20/2013 00:00:00 -t UBAK -L Backup-ID Policy Type RL Files C E T PC Expires Copy Frag KB Type Density FNum Off Host DWO MPX Expires RL MediaID ------------------------------------------------------------------------------------------------ st31bora01_136363320 ORA_PASPRO UBAK 0 1 N N R 2 13:00 03/25/2013 1 1 31264 Disk - - - inf-srv17 - N 13:00 03/25/2013 0 @aaaac 2 1 31264 Disk - - - inf-srv17 - N 13:00 03/25/2013 0 @aaaae 3 1 31264 RMed hcart 870 27321361 inf-srv17 9 N 13:00 03/25/2013 0 APA083 st31bora01_136363311 ORA_PASPRO UBAK 0 1 N N R 2 12:58 03/25/2013 1 1 288 Disk - - - inf-srv17 - N 12:58 03/25/2013 0 @aaaac 2 1 288 Disk - - - inf-srv17 - N 12:58 03/25/2013 0 @aaaae 3 1 288 RMed hcart 869 27321354 inf-srv17 9 N 12:58 03/25/2013 0 APA083 ... repeated for another 1000+ files
So I don't want to have to build 1000+ commands to change the retention period of each individual backup. The problem is that when I try to alter the retention based on the policy, I get "unable to process". I've tried using both "-ret" and "-d" flags of the bpexpdate without success:
D:\Program Files\Veritas\NetBackup\bin\admincmd> bpexpdate -recalculate -copy 2 -client st31bora01 -policy ORA_PASPROD -ret 3 -sched 2 Are you SURE you want to recalculate expiration dates on all images that meet the following criteria: client st31bora01 policy ORA_PASPROD scheduletype 2 copy 2 retention will be changed to 3(1 month) Continue?(y/n)y unable to process request D:\Program Files\Veritas\NetBackup\bin\admincmd> bpexpdate -recalculate -copy 2 -client st31bora01 -policy ORA_PASPROD -d 04/20/2013 00:00:00 -sched 2 Are you SURE you want to recalculate expiration dates on all images that meet the following criteria: client st31bora01 policy ORA_PASPROD scheduletype 2 copy 2 to expire on 4/20/2013 12:00:00 AM Continue?(y/n)y unable to process request
Does anyone have a recommendation why this isn't working? Any help would be greatfully appreciated.
Ken
Solved! Go to Solution.
04-09-2013 10:46 AM
My solution was to hack together a Windos bat file that scrolled through all the backup ID's and changed the expiry date one by one. I did this before I saw the post from Mark_Solutions that recommended using "bpimagelist -idonly -hoursago 900 -client st31bora01" so my code is a bit uglier. Below is the code for a script called NB_REP_CHNG_EXP.bat (NetBackup Report Change Expiry.bat) which is located in <NetBackup_Home>\bin\admincmd. I'm not proud of it but it did solve my problem.
Ken
@ECHO OFF REM REM nb_rep_chng_exp.bat REM REM Usage: nb_rep_chng_exp.bat NETBACKUP_POLICY client ret_level REM REM This script changes the expiry of each backups COPY 2 REM to the retention level passed in as a parameter. REM REM Level Retention Period REM 0 1 week REM 1 2 weeks REM 2 3 weeks REM 3 1 month REM 4 2 months REM 5 3 months REM 6 6 months REM 7 9 months REM 8 1 year REM 9 Infinity (9 cannot be changed) REM 10 2 years REM 11-24 Infinity REM @if X%1==X ( @echo. @echo No NetBackup Policy passed as parameter on command line goto ParamExit ) set NB_POLICY=%1 @if X%2==X ( @echo. @echo No Client passed as parameter on command line goto ParamExit ) set NB_CLIENT=%2 @if X%3==X ( @echo. @echo No Retention level passed as parameter on command line goto ParamExit ) set NB_RET=%3 SETLOCAL ENABLEDELAYEDEXPANSION @echo REM Policy_Name: %NB_POLICY%, client: %NB_CLIENT%, New Retention Level: %NB_RET% @FOR /F "eol=H usebackq tokens=1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,19,20,21,22,24,25,45" %%a in (`bpimagelist.exe -policy %NB_POLICY% -l -d 11/27/2011 05:00:00`) do ( @if %%a==IMAGE ( @echo bpexpdate -recalculate -backupid %%e -copy 2 -ret %NB_RET% -force REM @echo REM %%e %%f %%i %%j !CTIME! %%n !ETIME! %%s ) ) goto Exit :ParamExit echo Missing required parameters: echo. echo usage is: nb_report.bat NETBACKUP_POLICY client Retention_level echo. echo where echo Level Retention Period echo 0 1 week echo 1 2 weeks echo 2 3 weeks echo 3 1 month echo 4 2 months echo 5 3 months echo 6 6 months echo 7 9 months echo 8 1 year echo 9 Infinity (9 cannot be changed) echo 10 2 years echo 11-24 Infinity echo. :Exit
03-20-2013 11:01 AM
I forgot one detail: Prior to trying to change the backup expiration time, I go into the NetBackup Administration Console, select Catalog in the treeview on the left, search for all "Copy 2" backups for my ORA_PASPROD policy, click "Search Now", select all the backup ID's in the results section, right-click and select "Set Primary Copy". Doing this ensures that my restore commands use the backups at the DR site. I'm not sure is this make any difference to my retention period problem.
Ken
03-20-2013 11:15 AM
Uh-oh, I can't even change the retention of individual backups even if I wanted to:
bpimmedia -policy ORA_PASPROD -client st31bora01 -d 3/18/2013 12:59:00 -e 3/20/2013 00:00:00 -L Backup-ID Policy Type RL Files C E T PC Expires Copy Frag KB Type Density FNum Off Host DWO MPX Expires RL MediaID ------------------------------------------------------------------------------------------------ st31bora01_136363320 ORA_PASPRO UBAK 0 1 N N R 2 13:00 03/25/2013 1 1 31264 Disk - - - inf-srv17 - N 13:00 03/25/2013 0 @aaaac 2 1 31264 Disk - - - inf-srv17 - N 13:00 03/25/2013 0 @aaaae 3 1 31264 RMed hcart 870 27321361 inf-srv17 9 N 13:00 03/25/2013 0 APA083 bpexpdate -recalculate -backupid st31bora01_136363320 -copy 2 Are you SURE you want to recalculate expiration dates on all images that meet the following criteria: backupid st31bora01_136363320 copy 2 Continue?(y/n)y no entity was found
03-20-2013 11:24 AM
03-20-2013 11:28 AM
Removing "-recalculate" causes both commands to fail:
bpexpdate -copy 2 -client st31bora01 -policy ORA_PASPROD -ret 3 invalid command usage bpexpdate -copy 2 -client st31bora01 -policy ORA_PASPROD -d 04/20/2013 00:00:00 -sched 2 invalid command usage
03-20-2013 11:34 AM
OK, I can change individual backup ID's. The problem is that bpimmedia with the -L flag doesn't show the whole backup ID. It does if I use -l:
bpimmedia -policy ORA_PASPROD -client st31bora01 -d 3/18/2013 12:59:00 -e 3/20/2013 00:00:00 -l IMAGE st31bora01 8 st31bora01_1363633202 ORA_PASPROD 4 Oracle_Daily_Backup 2 0 1 1364238002 0 0 FRAG 1 1 31264 0 0 0 0 @aaaac inf-srv17 262144 0 0 -1 0 1;DataDomain;DD670-1;dd670;DDSTU1;0 1364238002 0 0 6 *NULL* FRAG 2 1 31264 0 0 0 0 @aaaae inf-srv17 262144 0 0 -1 0 1;DataDomain;dd670-2;dd670-dr;DDDRSTU1;0 1364238002 0 0 6 *NULL* FRAG 3 1 31264 0 2 6 870 APA083 inf-srv17 65536 27321361 1363303971 9 0 *NULL* 1364238002 0 0 1 *NULL* bpexpdate -recalculate -backupid st31bora01_1363633202 -copy 2 -ret 3 Are you SURE you want to recalculate expiration dates on all images that meet the following criteria: backupid st31bora01_1363633202 copy 2 retention will be changed to 3(1 month) Continue?(y/n)y bpimmedia -policy ORA_PASPROD -client st31bora01 -d 3/18/2013 12:59:00 -e 3/20/2013 00:00:00 -L Backup-ID Policy Type RL Files C E T PC Expires Copy Frag KB Type Density FNum Off Host DWO MPX Expires RL MediaID ------------------------------------------------------------------------------------------------ st31bora01_136363320 ORA_PASPRO UBAK 3 1 N N R 2 13:00 03/25/2013 1 1 31264 Disk - - - inf-srv17 - N 13:00 03/25/2013 0 @aaaac 2 1 31264 Disk - - - inf-srv17 - N 13:00 04/18/2013 3 @aaaae 3 1 31264 RMed hcart 870 27321361 inf-srv17 9 N 13:00 03/25/2013 0 APA083
OK, worst case scenario I have to build over 1000 bpexpdate comands using the backupid. It sure would be nice if the -policy parameter would work.
Ken
03-20-2013 01:55 PM
You didn't tell us what version you're at!
But I feel like you're at some earlier 7.5.0.x and may be hitting this issue which was resolved in 7.5.0.5:
Etrack Incident: 2957724
■ Associated Primary Etrack: N/A
■ Associated Service Request Etrack(s): N/A
■ Description:
Thebpexpdate -recalculate command failed with an error message reading
"unable to process images"
Thing is, this was discovered internally (see all the "N/As") and I don't think a customer had ever reported it to us. Fortunately, we fixed it anyway. ;)
What I'm saying is if your master isn't at 7.5.0.5, please apply 7.5.0.5 to it and I THINK this will work as you're expecting.
03-21-2013 04:48 AM
04-09-2013 10:35 AM
In reply to the question from CRZ, bpgetconfig reports the following:
D:\Program Files\Veritas\NetBackup\bin\admincmd>bpgetconfig -M inf-srv17 ... Client_Version = 500 ... VERSIONINFO = "Windows2008" "6" "nt" "NetBackup" "7.1" 710000 ...
04-09-2013 10:46 AM
My solution was to hack together a Windos bat file that scrolled through all the backup ID's and changed the expiry date one by one. I did this before I saw the post from Mark_Solutions that recommended using "bpimagelist -idonly -hoursago 900 -client st31bora01" so my code is a bit uglier. Below is the code for a script called NB_REP_CHNG_EXP.bat (NetBackup Report Change Expiry.bat) which is located in <NetBackup_Home>\bin\admincmd. I'm not proud of it but it did solve my problem.
Ken
@ECHO OFF REM REM nb_rep_chng_exp.bat REM REM Usage: nb_rep_chng_exp.bat NETBACKUP_POLICY client ret_level REM REM This script changes the expiry of each backups COPY 2 REM to the retention level passed in as a parameter. REM REM Level Retention Period REM 0 1 week REM 1 2 weeks REM 2 3 weeks REM 3 1 month REM 4 2 months REM 5 3 months REM 6 6 months REM 7 9 months REM 8 1 year REM 9 Infinity (9 cannot be changed) REM 10 2 years REM 11-24 Infinity REM @if X%1==X ( @echo. @echo No NetBackup Policy passed as parameter on command line goto ParamExit ) set NB_POLICY=%1 @if X%2==X ( @echo. @echo No Client passed as parameter on command line goto ParamExit ) set NB_CLIENT=%2 @if X%3==X ( @echo. @echo No Retention level passed as parameter on command line goto ParamExit ) set NB_RET=%3 SETLOCAL ENABLEDELAYEDEXPANSION @echo REM Policy_Name: %NB_POLICY%, client: %NB_CLIENT%, New Retention Level: %NB_RET% @FOR /F "eol=H usebackq tokens=1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,19,20,21,22,24,25,45" %%a in (`bpimagelist.exe -policy %NB_POLICY% -l -d 11/27/2011 05:00:00`) do ( @if %%a==IMAGE ( @echo bpexpdate -recalculate -backupid %%e -copy 2 -ret %NB_RET% -force REM @echo REM %%e %%f %%i %%j !CTIME! %%n !ETIME! %%s ) ) goto Exit :ParamExit echo Missing required parameters: echo. echo usage is: nb_report.bat NETBACKUP_POLICY client Retention_level echo. echo where echo Level Retention Period echo 0 1 week echo 1 2 weeks echo 2 3 weeks echo 3 1 month echo 4 2 months echo 5 3 months echo 6 6 months echo 7 9 months echo 8 1 year echo 9 Infinity (9 cannot be changed) echo 10 2 years echo 11-24 Infinity echo. :Exit