cancel
Showing results for 
Search instead for 
Did you mean: 

Backing up oracle database using netbackup

Satish_Kumar_3
Level 4
Hi

I would like to backup my oracle database running on red hat linux 4.0. I need help in configuring netbackup to do a cold backup of oracle database. Please help me on how do i configure the coldbackup script and do the database backup.

Thanks in advance.

Regards
Satish
3 REPLIES 3

Yasuhisa_Ishika
Level 6
Partner Accredited Certified
1. Configure policy of Standatd type, and add schedule of User Backup type. Before you do it, you should understand what the User Backup means.

2. Run scrit on client to do cold backup.
The script below is not tested, just sample. In this sample, policy name is oracle, and schedule name is user.

#! /bin/sh

DBA_USER="oracle"
ORACLE_SID="mydb"
ORACLE_HOME="/opt/oracle/app/product/10.2.0"
UBAK_POLICY="oracle"
UBAK_SCHED="user"
UBAK_TARGET="/opt/oracle/app/product/10.2.0/oradata"
UBAK_WAITLIMIT="6:00:00"

SQLPLUS="${ORACLE_HOME}/bin/sqlplus"


# shutdown instance
su - ${DBA_USER} -c "env ORACLE_SID=${ORACLE_SID} ORACLE_HOME=${ORACLE_HOME} ${SQLPLUS} '/ as sysdba' <
shutdown immediate
EOM
"

# backup by user backup
/usr/openv/netbackup/bin/bpbackup -p ${UBAK_POLICY} -s ${UBAK_SCHED} ${UBAK_TARGET}


# startup instance
su - ${DBA_USER} -c "env ORACLE_SID=${ORACLE_SID} ORACLE_HOME=${ORACLE_HOME} ${SQLPLUS} '/ as sysdba' <
startup
EOM
"

Yasuhisa_Ishika
Level 6
Partner Accredited Certified
Another way.

1. Configure policy of Standatd type, and add schedule of Full Backup type. File list of this schedule must contain the path where DB data resides.

2. Create bpstart_notify and bpend_notify scripts under /usr/openv/netbackup/bin.
The script below is not tested, just sample. In this sample, policy name is oracle. This sample is harmfull in multistreaming configuration. Don't allow multistreaming.


### /usr/openv/netbackup/bin/bpstart_notify.oracle
#! /bin/sh
DBA_USER="oracle"
ORACLE_SID="mydb"
ORACLE_HOME="/opt/oracle/app/product/10.2.0"
SQLPLUS="${ORACLE_HOME}/bin/sqlplus"

# shutdown instance
su - ${DBA_USER} -c "env ORACLE_SID=${ORACLE_SID} ORACLE_HOME=${ORACLE_HOME} ${SQLPLUS} '/ as sysdba' <
shutdown immediate
EOM
"


### /usr/openv/netbackup/bin/bpend_notify.oracle
#! /bin/sh
DBA_USER="oracle"
ORACLE_SID="mydb"
ORACLE_HOME="/opt/oracle/app/product/10.2.0"
SQLPLUS="${ORACLE_HOME}/bin/sqlplus"

# startup instance
su - ${DBA_USER} -c "env ORACLE_SID=${ORACLE_SID} ORACLE_HOME=${ORACLE_HOME} ${SQLPLUS} '/ as sysdba' <
startup
EOM
"

Yasuhisa_Ishika
Level 6
Partner Accredited Certified
And if you have enough money and prefer standardized way, it's better to buy NetBackup for Oracle. ;)