1827794 Members
2677 Online
109969 Solutions
New Discussion

sheduling a DB Backup

 
SOLVED
Go to solution
akarayil
Frequent Advisor

sheduling a DB Backup

Dear friends,
I want to take the incremental backup of our oracle database in every four hours.Before creating the new backup, the existing one should be copied to another file.At present we are taking the backup of DB (full) every day.Current script is given below.

#!/usr/local/bin/bash
#su - oracle
export ORACLE_HOME=/u01/app/oracle/product/10.0.0
flnm=bkp`date +%a_%H%M`.dat
echo "Exporting Backup to : $flnm on `date +%d/%m/%Y-%H:%M:%S`" >> /home/orabkup/backup.log
if [ $UID == 200 ]; then
$ORACLE_HOME/bin/exp system/mastermind@ppms file=(/u02/orabkp/1_$flnm,/u02/orabkp/2_$flnm,/u02/orabkp/3_$flnm) filesize=4G owner=(iwall,tico_dev) trigge
rs=y compress=y rows=y statistics=none log=/home/orabkup/logbkp.log1
#exp system/mastermind file=/u02/orabkp/$flnm full=Y log=/home/orabkup/logbkp.log1
#>/dev/null 2>/dev/null
else
echo "You must logged in as ORACLE user"
fi
echo "====== Backup Completed on `date +%d/%m/%Y-%H:%M:%S` =====" >> /home/orabkup/backup.log
echo "====== Backup transfer start `date +%d/%m/%Y-%H:%M:%S` =====" >> /home/orabkup/backup.log
scp /u02/orabkp/*_$flnm oracle@202.25.10.245:/u02/pms_bkp/.
echo "====== Backup transfer end `date +%d/%m/%Y-%H:%M:%S` =====" >> /home/orabkup/backup.log

orabkp: END


We use rx 7620 server with hpux 11.23 os

kindly give me a solution.
4 REPLIES 4
Yogeeraj_1
Honored Contributor
Solution

Re: sheduling a DB Backup

Hi,

You should start thinking in terms of Oracle RMAN backup.

EXP only gives you a snapshot of your data as at a specific point in time. You will not be able to recover your database at *any* desired point in time in cases of failure. There will always be data lost!!!

How critical is your system?

What you really need a system that allows you to backup your database online and at the same time allows you to recover the database in case of any failures till the latest transaction committed.

Is this a Linux machine?

if you need any further assistance on how to implement RMAN, please do let us know.

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Yogeeraj_1
Honored Contributor

Re: sheduling a DB Backup

Hi again,

Please note that RMAN allows you to perform Incremental Merge backup and also takes advantage of the changed_blocks_tracking feature.

Scheduling of your backup scripts can be done using the CRONTAB.

Below a simple template that we commonly use:

#*******************************************************************************
# min|hour |day |month|day | |script
# | |of mo| |of wk| |
#----|-----|-----|-----|-----|-------|-----------------------------------
#*******************************************************************************

00 04,08,12,16,20,00 * * * echo "/home/yogeeraj/admin/scripts/oracle/rman/rman_fullbackup.sh;exit"|su - oracle 1>/home/yogeeraj/admin/scripts/logfiles/oracle/output-rman_fullbackup.crn 2>/home/yogeeraj/admin/scripts/logfiles/oracle/error-rman_fullbackup.crn


#
#*******************************************************************************
# END OF TABLE day0->Sunday day6->Saturday
#*******************************************************************************

hope this helps!

kind regards
yogeeraj

No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
akarayil
Frequent Advisor

Re: sheduling a DB Backup

Thank you yogeeraj for your kind response.

Here we use hp unix OS. Like "logrotate" in Linux, is there any utility in hp-ux.If I've my last full backup and latest two or three incremental backups,which has been taken every four hours,I hope that we can do better recovery.
akarayil
Frequent Advisor

Re: sheduling a DB Backup

I want to add a new tread with better info.