Video Screencast Help

Can Variables be passed to netbackup

Created: 18 Jul 2012 | 7 comments

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
/oracle/scripts/rman_backup.ksh DB1
$ cat backup_DB2.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.

Comments 7 CommentsJump to latest comment

Will Restore's picture

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

# Parameters passed are:

also described in this old thread:

Will Restore -- where there is a Will there is a way

watsons's picture

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):


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_netbackup's picture

Thank you for the comment but that would still require us to pass in a variable (that is the DB name) 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_netbackup's picture

the script you mentioned has the 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.
# ---------------------------------------------------------------------------
# ---------------------------------------------------------------------------
# Replace ora102, below, with the Oracle SID of the target database.
# ---------------------------------------------------------------------------
Will Restore's picture

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

Will Restore -- where there is a Will there is a way

Genericus's picture

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 on Solaris 10
EMC Data Domain 990 & 7200 VTL via FC
acsls 8.3.0
SL500 & SL8500 LTO5

new_user_netbackup's picture

how do you manage a system that has 10 SID on same 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 ?