General
cancel
Showing results for 
Search instead for 
Did you mean: 

Crontab, tar command, Oracle export

Yvette Johnson_1
Occasional Advisor

Crontab, tar command, Oracle export

I have instructions on performing an Oracle export to a tape drive, "exp userid/password file=/ev/rmt0 table=emp volsize=1.2G".

I have 2 problems: 1. when I check my results, tar -tvf /dev/rmt/0m, I receive this message, "Tar: blocksize = 16 directory checksum error". The tape is OK. I performed a tar using a the tmp directory; 2. Where did the export dump file go? I created a file to on the server that states "Export terminated successfully without warnings"

Also, I will need to export a file to tape that will exceed UNIX 2GB limit.
8 REPLIES
Patrick Wallek
Honored Contributor

Re: Crontab, tar command, Oracle export

The first problem I see is that you have the device file specified as /ev/rmt0. There are 2 problems with that. 1) It should be /dev 2) there is no such thing as rmt0 in HP-UX. You probably want the device file to be /dev/rmt/0m

Check your /dev directory for a file called rmt0. I bet that is where your archive is.

The tar command, by default, cannot handle files larger than 2GB. However, if you install the latest tar patches, that will enable you to handle files up to 8GB.
Steven E. Protter
Exalted Contributor

Re: Crontab, tar command, Oracle export

There is a tar release that supports files bigger than 2 GB.

http://www1.itrc.hp.com/service/patch/patchDetail.do?BC=patch.breadcrumb.main|patch.breadcrumb.search|&patchid=PHCO_28992&context=hpux:800:11:11

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
A. Clay Stephenson
Acclaimed Contributor

Re: Crontab, tar command, Oracle export

Your first problem is that you are trying to use tar to read a non-tar format file. The command you need to use to read the tape is dd.

You might find that a better option is to do your exports to a named pipe:

mknod /xxx/mypipe p

Next you do something like this:
dd if=/xxx/mypipe ibs=1b obs=500b of=/dev/rmt/0m

(This command will just sit there waiting for input.)

Next you do your export using file=/xxx/mypipe

When the export finishes, the dd command also terminates and you have the data on tape.


Man 1m mknod and dd for details.

If it ain't broke, I can fix that.
Yvette Johnson_1
Occasional Advisor

Re: Crontab, tar command, Oracle export

THANK YOU for helping me!!!

To Patrick, in my cronjob, I'm using /dev/rmt/0m. The dump file is not listed in this directory.

To Patrick and Steven, I'll check with my UNIX Sys Admin regarding installing the tar patch.

To Clay, I have these instructions for handling 2GB+ files but wasn't sure if I could use this in a script to run in crontab, "
mknod exp.dmp p
split -b2047m exp scott/tiger file=/tmp/data/exp.dmp
I'll try this to see if it works after I get the smaller file to work.

Thanks again!!
A. Clay Stephenson
Acclaimed Contributor

Re: Crontab, tar command, Oracle export

Actually if you use the named pipe, there is no reason to split the file. Simply let it dd directly to the tape device. Since you then bypass tar there is no 2GB (or 8GB) restriction. The restriction is now the capacity of the medium.
If it ain't broke, I can fix that.
Yvette Johnson_1
Occasional Advisor

Re: Crontab, tar command, Oracle export

I used your instructions for the "pipe". When I used the tar command,
"tar -tvf /dev/rmt/0m" I get this message,
Tar: blocksize = 1
directory checksum error

Should I use this command to check the tape to see if the file exists?
A. Clay Stephenson
Acclaimed Contributor

Re: Crontab, tar command, Oracle export

You still are not grasping that if you did not use a tar command to create the backup, tar cannot be used to read the tape. Tar expects the data to contain headers that tell it the name of the file, length, permissions and file type (mode), etc. You could almost think of this as the difference between a filesystem and a raw disk --- there is no "filesystem" on a dd'ed tape.
If it ain't broke, I can fix that.
Yvette Johnson_1
Occasional Advisor

Re: Crontab, tar command, Oracle export

After talking with my UNIX Sys Admin, we're going to use the Brocade Storage Area Network to store the large export file.

Thanks for your help!!