Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Auto advance of tape during backup

Auto advance of tape during backup

From: Lou Avrami <L.Avrami_at_dialogic.com>
Date: 1997/01/31
Message-ID: <32F2B18E.4E78@dialogic.com>#1/1

Hello all,

        I'm in the midst of writing a hot backup script for our Oracle databases, and I've run into a roadblock that I'm hoping that someone might be able to offer some help with.

        We're on a SUN Sparc 1000E running Solaris 2.5. We have a "stacker" in our tape drive, which allows us to put a "stack" of 12 4 mm tapes that can be accessed by the one drive, sequentially. Currently, we do cold backups, shutting down our databases and then using the tar command to backup different directories. The tape changes are hard-coded; after tar'ing specific directories, an 'mt -f /dev/rmt/0 rewind' is executed, the next tape in the stack is brought online, other directories are tar'ed, etc.

        With a hot backup script, we can leave the database up while backing it up. We query the database for the datafiles that make up the database, put a database object into "BACKUP" mode, copy the UNIX file(s) to tape, end the "BACKUP" mode and go on to the next database object.

        The problem that we're experiencing is that our largest databases are over 10 gig, and the capacity of the 4mm tapes are just under 10 gig. So towards the end of the backup we get "End of Medium" messages, and files don't get sent to tape.

        I want to avoid hard-coding tape switches, because the databases could grow any-which-way, and I would have to update the scripts whenever a database object might be changed. I thought that I could use the '-O' option of the cpio command to advance the tape automatically, according to the cpio man page:

        find /db/file.dbf -print | cpio -ocuvdB -O /dev/rmt/0n

        but the '-O" doesn't seem to work, at least not the way I would like it to. I'm still get the "end of medium" messages, not advancing the tape and not copying some files to tape.

        One answer would be to compress the datafiles when writing them to the tape, either via the -z option of GNU tar (which calls gzip) or from the command line

	tar cvf - /db/file.dbf | compress -c | dd=of/dev/rmt/0n obs=20b
	(thanks to Kjell Egerdal for this)	

	This would "fix" fitting the DB backup onto one tape for now.
It would probably slow the backups quite a bit, since all of the datafiles would have to be compressed AND written to tape. We also could potentially run out of tape, especially since we're doing individual
writes to tape, instead of directory-level tars or cpios.

        Does anyone know how to advance a tape automatically via a tar, cpio or any other UNIX archiving command? Am I doing something wrong?

        Any info would be greatly appreciated.
Thanks,

Lou Avrami ( avramil_at_dialogic.com )
Dialogic Corporation

P.S. Is there a way to pipe a file through compress and cpio and write it to a character special device, similar to the 'tar - dd' example above, without writing a "temp" file? Received on Fri Jan 31 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US