Operating System - HP-UX
1826975 Members
3205 Online
109705 Solutions
New Discussion

Re: Temporary backup scheme

 
SOLVED
Go to solution
Haitham Hamad
Regular Advisor

Temporary backup scheme

I have a D370 server that has Oracle database (almost 24 hrs) and users data (8-5). Early in the morning, we shutdown the database and copy all datafile to /backup directory and then open the database. We then backup userdata and /backup to tape.
I am upgrading the Server to HP11.0 and Oracle 8i and due to the new disk requirements, I can not have /backup anymore (Until my clients buy new disks). To make the downtime as short as possible, I was planning to copy the datafiles to tape before opening the database again and then backup userdata directories to the same tape. My problem is that I don't know how to automate this process. SAM's automated backup
will rewind the tape after the database backup since it is using fbackup. Recovering from cpio will be lengthy if a user only lost one file!. The only solution I have at hand is to put all directories (datafiles and users) in one backup scheme and estimate when the oracle backup will finish so that I can open the database before the tape finishes with the usersdata. Any alternatives,...thanks Haitham
7 REPLIES 7
Ron Irving
Trusted Contributor

Re: Temporary backup scheme

just guessing here...use mount with no-rewind option, to position the tape, and use tar...see if that does the trick.

ron
Should have been an astronaut.
A. Clay Stephenson
Acclaimed Contributor

Re: Temporary backup scheme

A good alternative would be to look into OnlineJFS's xvfs snapshot. A small logical volume (~10% of total oracle data) is used to log the delta's. You first shutdown the database. Next snapshot mount the filesystem(s). Next bring the database back up for nornal use. Your snapshot mountpoint(s) then contain a static copy of the shutdown database.
The entire process should take less than 2 minutes including bouncing the database. You can then backup the snapshots at your convenience.
If it ain't broke, I can fix that.
Thierry Poels_1
Honored Contributor

Re: Temporary backup scheme

Hi,
copying you database to tape will require your database to be down for a much longer period.
The cost of one (or more) large disks would normally not weigh up to the cost of the downtime. Also recovery would be many times faster from your backup directory than from tape.
Another option would be an online database backup, so you can keep your database up and running during the backup.
regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Ed Ulfers
Frequent Advisor
Solution

Re: Temporary backup scheme

Just a thought for the frugal disk systems...

Instead of "copying" the files, take the input file through "compress" and output the results to your destination location. Your backup disk requirement is significantly less and CPU cycles for compress are often quicker than IO cycles for tape drives.

I use that for many of my databases, even when doing hot backups. Here is an example for compressing one directory files to a second directory (all files in parallel):

DIR1=/oradata/DBNAME/disk1
DIR2=/archives/DBNAME
cd $DIR1
for name in *
do
compress -f -c $name > $DIR2/$name.Z &
done
wait

Again, always document/test recovery whenever a new backup method is implemented.
Put a smile on your users face, offer them a kiss (Hershey's Kiss).
Paula J Frazer-Campbell
Honored Contributor

Re: Temporary backup scheme

Hi

What is the disk structure that your database resides on (Mirror?)

If it is a mirror them split the mirror, mount the split and then backup the split volume, merge the split volume back online.

Hey Presto an one line backup.


Paula
If you can spell SysAdmin then you is one - anon
Haitham Hamad
Regular Advisor

Re: Temporary backup scheme

Thanks for all of your responses. Yes I do have a mirror system, I will try first the compress method and see if I can fit my datafiles in the limited space I have and then the mirror option otherwise. For the mirror, I will need to write a script to automate the process..
Paula J Frazer-Campbell
Honored Contributor

Re: Temporary backup scheme

Hi

Mirrow backup routine :-

# When started
date >> ~/var/adm/n0cronlog
################################
# Flush memory
################################
sync
sync

################################
echo "Splitting disks"
lvsplit -s _copy /dev/avro/avro

################################
echo "FSCK on split disk"
################################
fsck /dev/avro/avro_copy

################################
echo "Making mount dir"
# Just in case it was deleted
################################
mkdir /avrobackup

################################
echo "Mounting split disk to /avrobackup"
################################
mount /dev/avro/avro_copy /avrobackup


################################

COPY ROUTINE HERE FBACKUP,TAR,CPIO ETC

find .|cpio -pudvm /avroTWO

################################
# Create Complete copy file
# Used as a Flag file
################################
touch /avroTWO/COPYCOMPLETE

################################
echo "Unmounting the split disk"
################################

umount /dev/avro/avro_copy

################################
echo "Removing the mount dir"
################################
rmdir /avrobackup
################################
echo "Merging the disk back online"
################################
lvmerge /dev/avro/avro_copy /dev/avro/avro
################################
echo "Avrocopy to avroTWO complete"
###############################
date >> ~/var/adm/n0cronlog
# When finished


HTH

Paula
If you can spell SysAdmin then you is one - anon