Operating System - HP-UX
1826203 Members
3016 Online
109691 Solutions
New Discussion

Re: Backup Utilities for Single Files

 
SOLVED
Go to solution
Jeanine Kone
Trusted Contributor

Backup Utilities for Single Files

I am trying to choose a backup utility to use for performing hot backups of an Oracle database. I need a utility that will allow the backup of individual files or a file list (as opposed to a whole directory or filesystem). So far, cpio is the only one I can find. Does anybody know of any others?

Thanks!
9 REPLIES 9
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Backup Utilities for Single Files

Hi Jeanine,

Actually tar will backup just one file as well.
If you specify a file then only the file is backed up; on the other hand if you specify a directory then the directory will be backed up.

e.g. tar cvf /dev/rmt/0m /tmp/myfile2 /tmp/myfile3

will backup just those files.

You can also use fbackup or OmniBack.

Regards, Clay
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: Backup Utilities for Single Files

Hi:

'tar' or 'fbackup' are the obvious choices. I've used 'tar' for this purpose, but my personal favorite is 'fbackup'.

Take a look at the man pages for both. Don't be intimidated by 'fbackup'. 'fbackup' and its companion, 'frecover' can handle largefiles (those > 2GB). 'tar', 'pax' (it's cousin) and 'cpio' cannot -- something to keep in mind.

...JRF...
Jeanine Kone
Trusted Contributor

Re: Backup Utilities for Single Files

Thanks for the quick response. The man pages for fbackup don't mention single files, but I tried it and it does work. Although it does not allow you to specify wildcards to get multiple files. I am guessing a graph file could be used to specify multiple single files. I'll play more with that later.

One more question though...The man pages also state that you should not use the no rewind device. I will be needing to write multiple archives one after the other to the tape. Is their any easy way to get the tape positioned to the correct spot for each archive?

Thanks!
James R. Ferguson
Acclaimed Contributor

Re: Backup Utilities for Single Files

Hi Jeanine:

You are right on target. 'fbackup' doesn't allow wildcard specifications (too bad). However, with include and exclude statements oin a graph file, you can approximate this fairly closely.

'tar' can be used with no-rewind tape devices to stack archives on the tape. You'll be interested too in the 'mt' tape positioning command.

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: Backup Utilities for Single Files

Hi Jeanine,

Don't overlook the ability to build your graphfile 'on the fly' in a script possibly by reading a file generated by sqlplus.

Clay
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: Backup Utilities for Single Files

Hi Jeanine,

Since you are doing Oracle backups, let me throw out one method you might not have considered. Have you thought about doing
a vxfs snapshot? The idea is that you shutdown the database, snapshot mount, and then start the database. This entire process takes less than two minutes and you can then backup at leisure. This gives you all the warm, fuzzy of a cold database backup with almost all the benefits of a hotbackup. Restores are also then trivially easy.

Food for thought, Clay
If it ain't broke, I can fix that.
Satish Y
Trusted Contributor

Re: Backup Utilities for Single Files

Hi,

Yes, fbackup doesn't allow wildcards, u need to specify each file to be excluded.
For ur requirement(need to write multiple archives on a single tape) unfortunately fbackup doesn't serve this purpose that is why it is specified in man page that u should not use no rewind tape.

To append archives u can use tar with mt(to position the tape at the end of archive to append next archive).

Cheers...
Satish.
Difference between good and the best is only a little effort
Jeanine Kone
Trusted Contributor

Re: Backup Utilities for Single Files

Ok - Just to get this straight. I can not write multiple archives to a single tape with fbackup? Even if I use the mt command to fast forward after each archive I write? I was thinking I could keep a counter in my shell script and forward x amount each time I wrote a new archive.

Eveyone keeps mentioning tar. I know it is very popular, but my HP-UX book stated that it was very slow and should not be used for large backups. For that reason we had discounted it as an option. Is the book wrong?
A. Clay Stephenson
Acclaimed Contributor

Re: Backup Utilities for Single Files

Hi again,

Especially in the old days, tar was slow when writing to tape devices becuase of small block sizes but the workaround is easy.

Do somrthing like like:

tar cvf - myfile1 myfile2 | dd ibs=512 obs=64k

of=/dev/rmt/0mn

You may need to experiment with obs to optimize performmance.

You can also specify blocking in the tar command itself. But I think you will find that tar is reasonable in terms of performance. The barrier that will get you is the 2GB limit.

Clay

If it ain't broke, I can fix that.