Oracle 10g Hot Backup without RMAN (UN*X)

This page describes Oracle hot backup without using an rman database. It can have some missing parts, so please share your knowledge if anything is missing according to you.

Pre-requisites:

You must have Oracle license on Netbackup. (Correction. Oracle license is not required for this approach, Thanks to Bahadır)

Policy Creation:

1. Create the following scripts under directory /usr/openv/netbackup/bin

bpstart_notify

Change the following lines (arguments in bold) for your system. Lines 62 to 72.
——————————————————————————————————————-
“FULL”)
echo `date` full backup started on $1 – policy $2 schedule $3 >> $OUTF
/usr/openv/netbackup/bin/db_begin_bkup -user oracle -home /u01/app/oracle/product/10.2.0/db_1 -base /u01/app/oracle -sid orcl -init /u01/app/oracle/product/10.2.0/db_1/admin/orcl/pfile/init.ora >> $OUTF
;;
“INCR”)
echo `date` differential incremental backup started on $1 – policy $2 schedule $3 >> $OUTF
/usr/openv/netbackup/bin/db_begin_bkup -user oracle -home /u01/app/oracle/product/10.2.0/db_1 -base /u01/app/oracle -sid orcl -init /u01/app/oracle/product/10.2.0/db_1/admin/orcl/pfile/init.ora >> $OUTF
;;
“CINC”)
echo `date` cumulative incremental backup started on $1 – policy $2 schedule $3 >> $OUTF
/usr/openv/netbackup/bin/db_begin_bkup -user oracle -home /u01/app/oracle/product/10.2.0/db_1 -base /u01/app/oracle -sid orcl -init /u01/app/oracle/product/10.2.0/db_1/admin/orcl/pfile/init.ora >> $OUTF
;;
——————————————————————————————————————-

bpend_notify
Change the following lines (arguments in bold) for your system. Lines 64 to 75.
——————————————————————————————————————-

“FULL”)
echo `date` full backup finished on $1 – policy $2 schedule $3. Exit status = $5 >> $OUTF
/usr/openv/netbackup/bin/db_end_bkup -user oracle -home /u01/app/oracle/product/10.2.0/db_1 -base /u01/app/oracle -sid orcl -init /u01/app/oracle/product/10.2.0/db_1/admin/orcl/pfile/init.ora >> $OUTF
;;
“INCR”)
echo `date` differential incremental backup finished on $1 – policy $2 schedule $3. Exit status = $5 >> $OUTF
/usr/openv/netbackup/bin/db_end_bkup -user oracle -home /u01/app/oracle/product/10.2.0/db_1 -base /u01/app/oracle -sid orcl -init /u01/app/oracle/product/10.2.0/db_1/admin/orcl/pfile/init.ora >> $OUTF
;;
“CINC”)
echo `date` cumulative incremental backup finished on $1 – policy $2 schedule $3. Exit status = $5 >> $OUTF
/usr/openv/netbackup/bin/db_end_bkup -user oracle -home /u01/app/oracle/product/10.2.0/db_1 -base /u01/app/oracle -sid orcl -init /u01/app/oracle/product/10.2.0/db_1/admin/orcl/pfile/init.ora >> $OUTF
;;
——————————————————————————————————————-

db_begin_bkup
Change the following lines (at the end of the file, CUSTOMIZATION section)
——————————————————————————————————————-
line 471
ORACLE_DBA=${ORACLE_DBA:=oracle}
line 479
ORACLE_BASE=${ORACLE_BASE:=/u01/app/oracle}
line 488
ORACLE_HOME=${ORACLE_HOME:=/u01/app/oracle/product/10.2.0/db_1}
line 494
ORACLE_SID=${ORACLE_SID:=orcl}
line 501
SQLCMD=${SQLCMD:=${ORACLE_HOME}/bin/sqlplus}
line 508
ORACLE_INIT=${ORACLE_INIT:=${ORACLE_HOME}/admin/${ORACLE_SID}/pfile/init.ora}
lines 516 and 517
MAIL_ADDR_SUCCESS=${MAIL_ADDR_SUCCESS:=root@localhost}
MAIL_ADDR_FAILURE=${MAIL_ADDR_FAILURE:=root@localhost}
line 529
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:=${ORACLE_HOME}/lib}
line 536
CONTROL_DIR=/tmp/ORACLE_BACKUP
——————————————————————————————————————-

db_end_bkup
Change the following lines (at the end of the file, CUSTOMIZATION section)
——————————————————————————————————————-
line 410
ORACLE_DBA=${ORACLE_DBA:=oracle}
line 418
ORACLE_BASE=${ORACLE_BASE:=/u01/app/oracle}
line 427
ORACLE_HOME=${ORACLE_HOME:=/u01/app/oracle/product/10.2.0/db_1}
line 433
ORACLE_SID=${ORACLE_SID:=orcl}
line 440
SQLCMD=${SQLCMD:=${ORACLE_HOME}/bin/sqlplus}
line 447
ORACLE_INIT=${ORACLE_INIT:=${ORACLE_HOME}/admin/${ORACLE_SID}/pfile/init.ora}
lines 455 and 456
MAIL_ADDR_SUCCESS=${MAIL_ADDR_SUCCESS:=root@localhost}
MAIL_ADDR_FAILURE=${MAIL_ADDR_FAILURE:=root@localhost}
line 468
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:=${ORACLE_HOME}/lib}
line 475
CONTROL_DIR=/tmp/ORACLE_BACKUP

——————————————————————————————————————-

2. Create a policy, choose Policy Type to be standard and choose Oracle data directories and Archivelog directories in Backup Selections.

3. Name bpstart_notify as bpstart_notify.policy_name (e.g: if your backup policy name is OracleBackup then the file name should be bpstart_notify.OracleBackup)
Do the same for bpend_notify as well.
Do not rename db_begin_bkup and bp_end_bkup as they will be called by the first two scripts.

4. Make all the scripts executable and owned by root.

chown root bpstart_notify*
chown root bpend_notify*
chown root db_begin_bkup
chown root db_end_bkup

chmod 755 bpstart_notify*
chmod 755 bpend_notify*
chmod 755 db_begin_bkup
chmod 755 db_end_bkup

5. Try a manual backup and see if it works.

Ps : The scripts create the following files, so you can monitor script processes while the backup process continues.
BPRD_CALLED
SESSION_START_CALLED
BPSTART_CALLED
BACKUP_CALLED
BACKUP_EXIT_CALLED
SESSION_CALLED
BPEND_CALLED

You can leave a response, or trackback from your own site.

2 Responses to “Oracle 10g Hot Backup without RMAN (UN*X)”

  1. Bahadir says:

    Pre-requisites:
    You must have Oracle license on Netbackup.

    The statement given above is not correct. Such approach is completely scripted solution and it does not require any sort of integration with RMAN.

    You need to have a standard client license that allows you to backup oracle datafiles at file system level.

  2. Savaş İREZ says:

    Right, my mistake. Sorry, and thanks :)

Leave a Reply

 
Powered by WordPress | Designed by: video game | Thanks to search engine optimization, seo agency and Privater Sicherheitsdienst