1820300 Members
3110 Online
109622 Solutions
New Discussion юеВ

tar crashed oracle

 
SOLVED
Go to solution
CJENSEN_1
Regular Advisor

tar crashed oracle

I was doing a tar on my controlfiles and redo logs (as a test) while the database was running. It caused the database to crash. The alert log mentions a corrupt block relative... and so on. My question about TAR - does unix do something with the file during the TAR process that prevents Oracle from using the file? Just curious. We are using fbackup/frestore, but are looking at tar to do some incrementals.
19 REPLIES 19
Ross Zubritski
Trusted Contributor

Re: tar crashed oracle

I appears that tar "locked" the control file. tar was never meant to be a "open file" backup solution.

Regards,

RZ
Patrick Wallek
Honored Contributor

Re: tar crashed oracle

As far as I know tar does not lock a file. It just reads it.

I was tar'ing up some files today and had a file change size while I was tar'ing it.

I would not really suspect tar. I suspect it may have just been a case of bad timing.
Ross Zubritski
Trusted Contributor

Re: tar crashed oracle

Good info Patrick

Was the file that changed bin or ascii? I can see tar handling an ascii file on the fly, bin is another story.

Just my 2 cents.

RZ
Patrick Wallek
Honored Contributor

Re: tar crashed oracle

It was an binary file. In fact it was one of Measurewares data files in /var/opt/perf/datafiles/log*.


Ross Zubritski
Trusted Contributor

Re: tar crashed oracle

Ah, the myteries of Oracle ;)~
Ross Zubritski
Trusted Contributor

Re: tar crashed oracle

The plot thickens.. An oracle control file changes each time time SCN (transaction) number changes, this could be nanoseconds. The files in the perf directory changes based on the time you set for data collection, i.e. 5, 10.

Just my 2 cents once again,

Regards,

RZ
Patrick Wallek
Honored Contributor

Re: tar crashed oracle

That is true. I would still wonder if tar is the culprit here though.

I would be tempted to do a 'dd' on the disk that the LV is part of and see what happens. If it completes successfully, then maybe tar did do it. If not, you've got a disk going bad, which what I suspect.
Ross Zubritski
Trusted Contributor

Re: tar crashed oracle

Excellent point sir.
Stan_17
Valued Contributor
Solution

Re: tar crashed oracle

Hi,

Just curious, why would you want to backup redo logs when the databases are open. never backup online redologs during hotbackup, cuz you might restore the backed up redolog file on top of current redolog thereby losing all the redo's that are not yet archived or not being checkpointed and you end up in-complete recoveries.

do not tar controlfiles too...use 'alter database backup controlfile to backup_location;' also, have ascii version of it 'alter database backup controlfile to trace;'

Stan

A. Clay Stephenson
Acclaimed Contributor

Re: tar crashed oracle

Assuming this was a tar reading these files, that should have not caused your problem. Tar and cpio do absolutely no file locking. I think this was a case of "I was running tar; Oracle crashed." The technical term for this is called "coincidence" rather than cause and effect.
If it ain't broke, I can fix that.
Yogeeraj_1
Honored Contributor

Re: tar crashed oracle

hi,

check the oracle alert.log. maybe you will have some clues about the crash there.

hope this helps!

Best Regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
John Jayaseelan
Super Advisor

Re: tar crashed oracle

Hi,

I do not think tar will lock the file during the back or reason for the crash. Could be due to the oracle process. Better to check the log file for the further info.

John Jayaseelan
Steven E. Protter
Exalted Contributor

Re: tar crashed oracle

tar should not have caused the problem, it does not lock the files.

Oracle may not have had the access level it wanted during the process, but this is probably an oracle problem.

You can not use fbackup for anything other than a cold, database down backup.

fbackup will try to lock the files on an open database, might hack oracle off and cause corruption. It will eventually fail to backup open database files resulting in error messages.

If you want to back up hot oracle databases, use rman. It comes with oracle and is a pretty useful and reliable tool.

You can also use omniback, over version 3.5 I think to get oracle 8.1.7 databaes. omniback also uses rman for oracle 8 backups.

If you choose this route, let me know, I can probably find and forward you a document on how to set up and use rman(I might have to mail it snail style it may only be here on paper)

If you mail, make the subject line relavent, I've been sick for two weeks and am nearly 100 emails behind schedule.
stevenprotter@juf.org
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
Raynald Boucher
Super Advisor

Re: tar crashed oracle

Which was the exact tar command issued?

A bad tar command could cause Oracle to error. ex.:
tar -cvf control_file1 control_file2

would corrupt control_file1.

Colin Jensen
Occasional Advisor

Re: tar crashed oracle

it was tav -cvf ... pls explain how this would corrupt it. Thanks.
Ian Lochray
Respected Contributor

Re: tar crashed oracle

In Raynald's example, control_file1 follows the "f" flag of the tar command so control_file1 would be the destination for the tar output. The example command would tar control_file2 into a tar image called control_file1, overwriting the control file.
TwoProc
Honored Contributor

Re: tar crashed oracle

The above posted message is right. The "c" in "cvf" means "create" and the "f" means "file" and the file you gave it was your control file. Basically, you turned your controlfile into a tarball. The correct syntax would have been "tar cvf /tmp/mynewtarfile.tar controlfile1 controlfile2". That would take both controlfile1 and controlfile2 and put them in the newlycreated file /tmp/mynewtarfile.tar.
We are the people our parents warned us about --Jimmy Buffett
Colin Jensen
Occasional Advisor

Re: tar crashed oracle

It did create a .tar file, but also left the oracle files intact. Yes, the command entered was as in the last post.
CJENSEN_1
Regular Advisor

Re: tar crashed oracle

Thanks