cancel
Showing results for 
Search instead for 
Did you mean: 

Can Variables be passed to netbackup

new_user_netbac
Level 3

Hello all,

 

I work as a DBA and have NO vizibility into the netbackup Piece.  The only vizibility that i have from Netbackup end is console where i can manually kick of the backup.  But my questions is with regards to passing in a variable.  Currently we have net backup setup (Veritas NetBackup for Oracle - Release 7.1) and the netbackup Admin said netbackup CANNOT take any variables... so lets say i have 2 database on my server, then i need 2 scripts for it....currently netbackup take the below script(backup_DB1.ksh) and that script in truns call another script(rman_backup.ksh) which passes in the variable(DB1)...and then same for DB2

 

$ cat backup_DB1.ksh
#!/bin/ksh
/oracle/scripts/rman_backup.ksh DB1
$
$ cat backup_DB2.ksh
#!/bin/ksh
/oracle/scripts/rman_backup.ksh DB2
$
 
The reason why this is a problem, we have a server that has 20 Database on it, so we have to create 20 scripts for netbackup to call....if netbackup can take variables in then we would old need to call rman_backup.ksh script and netbackup can pass the DB name as variables....So i wanted to find out if what was said to me was true (as netbackup cannot take variables) or we are just missing some info.  This seems like a really simple request to ask from a tool like netbackup.
 
 
7 REPLIES 7

Will_Restore
Level 6

bpstart_notify script, example on the Master Server under netbackup/bin/goodies

 

# Parameters passed are:
CLIENTNAME="$1"
POLICYNAME="$2"
SCHEDNAME="$3"
SCHEDTYPE="$4"

 

also described in this old thread: https://www-secure.symantec.com/connect/forums/bpstartbpendnotify-script-and-multistreaming-about-do...

 

watsons
Level 6

I think it's possible, but if you call Netbackup support, they won't do it for you. as they don't create/modify script for you.

For database backup, all netbackup use (most commonly) is also a script (.sh) at the database server end. So if you take a look into that backup script (for example Oracle RMAN):

/usr/openv/netbackup/ext/db_ext/oracle/samples/rman/hot_database_backup.sh

It is possible to specify what database instance to backup. For that, you can modify that script to read a environment variable value of what databases you want to backup, then simply set the environment variable before you run the backup.

new_user_netbac
Level 3

Thank you for the comment but that would still require us to pass in a variable (that is the DB name)...so if we have 10 DB we can create a for loop to do that...but our problem is...if for watever reason one of the backup fails...that script(for loop) will read all of the DB again and back them up all over again.....and we want to avoid that....

we created 10 policy one of each DB and each policy is callings it own script, so if one fails we can just restart one instead of all 10 in a for loop....

new_user_netbac
Level 3

the script you mentioned has the below...ORACLE_SID...so 10 DB will reach 10 different scripts of same kind just with different name....

 

 

# ---------------------------------------------------------------------------
# Replace /db/oracle/product/ora102, below, with the Oracle home path.
# ---------------------------------------------------------------------------
 
ORACLE_HOME=/db/oracle/product/ora102
export ORACLE_HOME
 
# ---------------------------------------------------------------------------
# Replace ora102, below, with the Oracle SID of the target database.
# ---------------------------------------------------------------------------
 
ORACLE_SID=ora102
export ORACLE_SID
 

Will_Restore
Level 6

That is probably the best way, especially if DB are large size. 

Genericus
Moderator
Moderator
   VIP   

YES, you can pass variables. But as indicated, mostly only the client, policy and schedule name.

I have policy1 that runs on the oracle SID, runs a script that uses uname to determine which VCS system the DB is on, and then calls the script with that client name - so if the DB is on system2 it uses policy2, if it is on system3 it calls policy3. That way it uses the correct storage which is fiber attached to the various servers.

 

NetBackup passes control of the RMAN backup to the RMAN scripts, and RMAN runs a series of user requested backups - which is why failures always end with error 6 and the DBA has to review the log file.

My RMAN backup ends with RMAN creating a new control file which I copy to a set area - then the RMAN script runs a seperate OS backup of that control file, so step one of restoring the DB is restoring the last good control file. A good tip!

 

 

NetBackup 9.1.0.1 on Solaris 11, writing to Data Domain 9800 7.7.4.0
duplicating via SLP to LTO5 & LTO8 in SL8500 via ACSLS

new_user_netbac
Level 3

how do you manage a system that has 10 SID on same box....do you just loop through /etc/oratab ?? if so what do you do if lets say backup for DB#5 fails and everything else worked??  if you run the policy again wouldnt in loop though etc/oratab and backup all other SID as well ?