Operating System - HP-UX
1822143 Members
3555 Online
109640 Solutions
New Discussion юеВ

Re: Backup/Copy Database Files to Tape

 
SOLVED
Go to solution
Adrian Sobers2
Super Advisor

Backup/Copy Database Files to Tape

How do you copy files to tape under HP-UX. The directory is:

/opt/oracle/data/orabackup

the files to copy to tape are:

IRDS.tar.Z
IRDS2.tar.Z

The tape drive is an HP Dat-72, address is:

0/0/1/0.3.0 [HP C7438A]

How do I go about this? Can I automate it? Also the files (IRDS.tar.Z, IRDS2.tar.Z) are a result of manally compressing IRDS.tar and IRDS2.tar respectively.

So can I automate:

compressing the files and copying them to tape?

Any help would be greatly appreicated. OS is 11.11 with all latest patches applied.
26 REPLIES 26
Marcel Boogert_1
Trusted Contributor

Re: Backup/Copy Database Files to Tape

Hi there,

Just use fbackup in combination with cron.

MB.
Steven E. Protter
Exalted Contributor

Re: Backup/Copy Database Files to Tape

based on the name, it appears that the tar fils are already compressed. gzip usually gets a better compression ratio when compress.

tar cvf IRDS*.tar /dev/rmt/0m

Will copy the files to tape.

cpio can do it.

fbackup can do it.

fbackup can handle files bigger than 2 GB. tar and cpio require patching to do that.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Adrian Sobers2
Super Advisor

Re: Backup/Copy Database Files to Tape

Newbie here. Could you post actual commands? Thanks...
Marcel Boogert_1
Trusted Contributor

Re: Backup/Copy Database Files to Tape

Hi there,

Just create the file /mytools/mybackup.sh

#! /bin/sh

your tar command
your compress command

fbackup -f /dev/rmt/om -i /opt/oracle/data/orabackup/IRDS.tar.Z
fbackup -f /dev/rmt/om -i /opt/oracle/data/orabackup/IRDS2.tar.Z

Now you can edit the cron and add the line /mytools/mybackup.sh >> /tmp/mybackup.output

Remember to us full path names: /usr/bin/tar, etc...

Regards, MB.
Adrian Sobers2
Super Advisor

Re: Backup/Copy Database Files to Tape

Thanks all, will try now and close thread once I verify backup files.

One more query though. We have the Dat 72 HP tape drive. Tapes can hold like up to 72GB. The two files are 1.9GB and 2.5GB respectively. I plan on just overwriting the files as need be. Since my total is not even 5GB. Will this impact tape life and or files? Also how do I verify if files on tape are not corrupt and have in fact been copied successfully?

Many thanks again.
Prashant Zanwar_4
Respected Contributor

Re: Backup/Copy Database Files to Tape

Hi,

Steve,

You mentioed the device in last,

it shall be tar cvf /dev/rmt/0mn

just thought the newbie will get little puzzled..

Also you can copy the required files to a new directory..

cp -pr file1 file2 /tmp/

then

tar cvf /dev/rmt/0mn /tmp/

or

fbackup -fv /dev/rmt/0mn -i /tmp//*

or

fbackup -fv /dev/rmt/0mn -i file1 -i file2

This shall work for you..

file1 and file2 will be absolute path name to your files..

Thanks
Prashant

"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
Adrian Sobers2
Super Advisor

Re: Backup/Copy Database Files to Tape

running first fbackup command now. It started but it gave the message:

fbackup (3025) WARNING: unable to read a volume header?

I'm using a 72GB tape, brand new. Should this warning be a concern?
Marcel Boogert_1
Trusted Contributor

Re: Backup/Copy Database Files to Tape

Hi there,

That's a warning because fbackup never wrote any data to the tape.

Try and write again and the message shouldn't be there.

MB.
Prashant Zanwar_4
Respected Contributor

Re: Backup/Copy Database Files to Tape

what happens to

mt -t /dev/rmt/0mn stat

or paste the output of what you are doing and what is the result..

you can also do

THanks
Prashant
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
Adrian Sobers2
Super Advisor

Re: Backup/Copy Database Files to Tape

How do I access the tape device/drive to see a listing of it's contents?

Also I have to keep typing /usr/sbin/fbackup instead of just fbackup is there a way around this?

Many thanks
Marcel Boogert_1
Trusted Contributor
Solution

Re: Backup/Copy Database Files to Tape

Hi there,

use:

frecover -f /dev/rmt/0m -xNv

to list the tape device.

MB.
Marcel Boogert_1
Trusted Contributor

Re: Backup/Copy Database Files to Tape

Adrian,

Edit your .profile and add the /usr/bin path to it.

MB.
Adrian Sobers2
Super Advisor

Re: Backup/Copy Database Files to Tape

some confusion about using fbackup

i do fbackup .... file 1 then fbackup file 2 but then I do the frecover and try to verify both files but only see the last file (file 2) listed. What gives?

also I then tried using tar but I don't think it worked. How do you verify if a file was copied to tape?

Urgent help required...
Marcel Boogert_1
Trusted Contributor

Re: Backup/Copy Database Files to Tape

Hi Adrian,

Try this:

fbackup -f /dev/rmt/om -i /opt/oracle/data/orabackup/IRDS.tar.Z /opt/oracle/data/orabackup/IRDS2.tar.Z

you can use frecover to view the data on the tape as I mentioned above.

Regards, MB.
Adrian Sobers2
Super Advisor

Re: Backup/Copy Database Files to Tape

Nope, this is what I get:

fbackup(1401): extra argument: /opt/oracle/data/orabackup/IRDS2.tar.Z ignored
fbackup(1004): session begins on Wed Oct 20 13:02:19 2004
fbackup(3041): output file /dev/rmt/0m is currently being used and not available
fbackup(3019): would you like to enter a new output file?
Adrian Sobers2
Super Advisor

Re: Backup/Copy Database Files to Tape

tried tar, nope!

irddba:INLAND8>tar cvf IRDS*.tar /dev/rmt/0m
a /dev/rmt/0m 0 blocks
irddba:INLAND8>
Marcel Boogert_1
Trusted Contributor

Re: Backup/Copy Database Files to Tape

Adrian,

You should create a graph file containing the following lines:

i /opt/oracle/data/orabackup/IRDS.tar.Z
i /opt/oracle/data/orabackup/IRDS2.tar.Z

Now use the command:

fbackup -f /dev/rmt/0m -g graph

Regards, MB.
Adrian Sobers2
Super Advisor

Re: Backup/Copy Database Files to Tape

How do you create the graph file?

TOTAL newbie here. Please explain more...
Marcel Boogert_1
Trusted Contributor

Re: Backup/Copy Database Files to Tape

Do you know vi? If so, just use it and create a file named graph.
Put the two lines in there I mentioned before and there is your file named graph.

MB.
Marcel Boogert_1
Trusted Contributor

Re: Backup/Copy Database Files to Tape

I added the file to the forum, just download it to your HP-UX Server.
Adrian Sobers2
Super Advisor

Re: Backup/Copy Database Files to Tape

created a backup.graph file with the entry. ran the command and got:

irddba:INLAND8>/usr/sbin/fbackup -f /dev/rmt/0m -g backup.graph

fbackup(1417): cannot open the dates file /var/adm/fbackupfiles/dates for reading
fbackup(1004): session begins on Wed Oct 20 14:44:58 2004
fbackup(3042): output file /dev/rmt/0m is not in a valid device state
fbackup(3019): would you like to enter a new output file?
Marcel Boogert_1
Trusted Contributor

Re: Backup/Copy Database Files to Tape

Sorry,

Create the folder /var/adm/fbackupfiles if not exist and put the file graph in there. Your file should be renamed to graph instead of backup.graph and moved to /var/adm/fbackupfiles

$ cd /var/adm/fbackupfiles
$ fbackup -f /dev/rmt/0m -g graph

This should do the thing...

Regards, MB.
Marcel Boogert_1
Trusted Contributor

Re: Backup/Copy Database Files to Tape

Adrian,

Do you also configured a cron job on your server?

Use the following command to edit your cron:

$ crontab -e

The fields are:
# Minute Hour MonthDay Month Weekday Command

Regards, MB.
Adrian Sobers2
Super Advisor

Re: Backup/Copy Database Files to Tape

fbackup is running will do the verify afterwards and post the results.