How to deal with Tar error ?


 
Thread Tools Search this Thread
Operating Systems AIX How to deal with Tar error ?
# 8  
Old 05-31-2016
Oracle EBS 11.5.9
Database 9i
Two tier config
Database on one server
Apps on another server

@hicksd8
Database in no archive mode, so when I make tar/gunzip, I will shutdown Database and then make tar/zip ;

yes, that's true, you can use RMAN (Oracle Backup Tool) but for that you have to make it in archive log mode...

@Bakunin
thank you,

Database if off, and
Code:
root@clodb:/clodbvg>/opt/freeware/bin/tar cvf -  /oradata | gzip > /clodbvg/bkp_30MAY16.tgz
/opt/freeware/bin/tar: Removing leading `/' from member names
/oradata/
.........
.......
/oradata/proddata/apd01.dbf
/oradata/proddata/applsysd01.dbf
/oradata/proddata/applsysd02.dbf
/opt/freeware/bin/tar: /oradata/proddata/applsysd02.dbf: Read error at byte 4767080960, r       eading 10240 bytes: There is an input or output error.
/oradata/proddata/applsysd03.dbf
.....
......
oradata/proddata/zfax01.dbf
/oradata/proddata/zsad01.dbf
/oradata/proddata/zsax01.dbf
/opt/freeware/bin/tar: Error exit delayed from previous errors
root@clodb:/clodbvg>


root@clodb:/oradata>cp /oradata/proddata/applsysd02.dbf /backup/applsysd02.dbf
cp: /oradata/proddata/applsysd02.dbf: There is an input or output error.


root@clodb:/oradata>dd if=/oradata/proddata/applsysd02.dbf of=/dev/null bs=1024
dd: 0511-051 The read failed.
: There is an input or output error.
4655364+0 records in.
4655364+0 records out.
root@clodb:/oradata>


root@clodb:/oradata>lsvg oradbvg
VOLUME GROUP:       oradbvg                  VG IDENTIFIER:  00c7780e00004c000000014977a0c65e
VG STATE:           active                   PP SIZE:        128 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      1439 (184192 megabytes)
MAX LVs:            256                      FREE PPs:       86 (11008 megabytes)
LVs:                4                        USED PPs:       1353 (173184 megabytes)
OPEN LVs:           4                        QUORUM:         2 (Enabled)
TOTAL PVs:          1                        VG DESCRIPTORS: 2
STALE PVs:          0                        STALE PPs:      0
ACTIVE PVs:         1                        AUTO ON:        yes
MAX PPs per VG:     32512
MAX PPs per PV:     2032                     MAX PVs:        16
LTG size (Dynamic): 256 kilobyte(s)          AUTO SYNC:      no
HOT SPARE:          no                       BB POLICY:      non-relocatable

root@clodb:/oradata>chvg -by oradbvg

root@clodb:/oradata>lsvg oradbvg
VOLUME GROUP:       oradbvg                  VG IDENTIFIER:  00c7780e00004c000000014977a0c65e
VG STATE:           active                   PP SIZE:        128 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      1439 (184192 megabytes)
MAX LVs:            256                      FREE PPs:       86 (11008 megabytes)
LVs:                4                        USED PPs:       1353 (173184 megabytes)
OPEN LVs:           4                        QUORUM:         2 (Enabled)
TOTAL PVs:          1                        VG DESCRIPTORS: 2
STALE PVs:          0                        STALE PPs:      0
ACTIVE PVs:         1                        AUTO ON:        yes
MAX PPs per VG:     32512
MAX PPs per PV:     2032                     MAX PVs:        16
LTG size (Dynamic): 256 kilobyte(s)          AUTO SYNC:      no
HOT SPARE:          no                       BB POLICY:      relocatable


Last edited by filosophizer; 05-31-2016 at 07:25 AM..
# 9  
Old 06-01-2016
Question:

Follow up from here:

17. Listing or viewing errors in Tar

Code:
gunzip < test.tgz | tar tvf -

will not list the error which happened while making backup (see above)

Code:
/opt/freeware/bin/tar: /oradata/proddata/applsysd02.dbf: Read error at byte 4767080960, reading 10240 bytes: There is an input or output error.

Is there a way to know if the tar file test.tgz has files which had problems ?
# 10  
Old 06-01-2016
In general you should at this point be very carefully what you do. Because your diskstorage is about to die. If you do another 10 or 20 tests then the disk maybe finally dead beyond any affordable repair.

The most important thing to do, is to create an exact 1:1 copy of the problematic disks. If you have that, make another copy from those new created disks. The last disk(s) are the working copy. There you can do experiments with and if the experiments fail. you can create another set of working copies.

Maybe it's time to hire a specialist, who can handle such a situation - depends of course on how important your data is for you.

Quote:
Is there a way to know if the tar file test.tgz has files which had problems ?
(I'm not quite sure if AIX-tar works equally like the linux tar, but it may help.)

You can try a test-run with tar(Watch at dash before tvf, which is different from your command):

Code:
gunzip <test.tgz  | tar -tvf -

You should see filenames running on your console. When tar stops because of the error, all missing files may be lost.

That's the only thing I can say to this.

Other options require additional work at setup-time of your backup. That would indeed be a good idea for a change for your backup procedures. (Instead of tar, you can use cpio with "CRC"-Format, which is checksumming your data. You can create checksums manually for all backed up files before the backup.

Last edited by stomp; 06-01-2016 at 03:19 PM..
# 11  
Old 06-01-2016
Quote:
Originally Posted by filosophizer
Code:
/opt/freeware/bin/tar: /oradata/proddata/applsysd02.dbf: Read error at byte 4767080960, reading 10240 bytes: There is an input or output error.

Is there a way to know if the tar file test.tgz has files which had problems ?
I have already said it and i will repeat it here: THIS IS NOT A TAR-ERROR! It is an error reading the disk, tar just reports that error.

What you need to do includes: repair the filesystem (which might well be beyond repair), get another disk, recreate the correct contents of the file somehow (maybe database methods might help, like rolling back archive logs, etc.).

Look: you have a file and some part of that file is not readable, because it is damaged. Regardless of the tool you use to read it - cat, tar, cpio, whatever - all these tools will fail for the exact same reason: some part of the file is not readable. If you give a book to someone and he complains that page 245 is missing you are not going to "correct the persons reading" - you need to provide the missing page for the complaint to go away. For the same reason there is nothing you can do with tar or the file it produces, only with the reason for the error it reports.

I hope this helps.

bakunin
# 12  
Old 06-01-2016
sorry, if my question was misunderstood, what i meant was, how to check if a tar file has all the files in it without any errors / problems

like in our case, the file applsysd02.dbf had problems when we made the tar

Code:
opt/freeware/bin/tar: /oradata/proddata/applsysd02.dbf: Read error at byte 4767080960, reading 10240 bytes: There is an input or output error.


but when checking the contents of the tar file, it doesn't mention that the file applsysd02.dbf had problems

Code:

telnet (clodb)


AIX Version 6
Copyright IBM Corporation, 1982, 2010.
login: root
root's Password:
*******************************************************************************
*                                                                             *
*                                                                             *
*  Welcome to AIX Version 6.1!                                                *
*                                                                             *
*                                                                             *
*  Please see the README file in /usr/lpp/bos for information pertinent to    *
*  this release of the AIX Operating System.                                  *
*                                                                             *
*                                                                             *
*******************************************************************************


root@clodb:/clodbvg>gunzip < bkp_30MAY16_oradata.tgz | tar tvf -
drwxrwsrwx 500 502       0 Jun 03 21:01:49 2010 oradata/
drwxrwsrwx 500 502       0 Jun 12 12:43:53 2005 oradata/JAVA/
-rwxrwxrwx 500 502    1560 Jun 12 12:43:53 2005 oradata/JAVA/.toc
-rwxrwxrwx 500 502 29389824 Dec 06 19:51:01 2001 oradata/JAVA/Java131.rte
........
.........
-rw-r--r-- 500 502 3460308992 May 31 01:34:33 2016 oradata/proddata/applsysd01.dbf
-rw-r--r-- 500 502 7235182592 May 31 01:34:35 2016 oradata/proddata/applsysd02.dbf
-rw-r----- 500 502 6501179392 May 31 01:34:36 2016 oradata/proddata/applsysd03.dbf
-rw-r----- 500 502 2306875392 May 31 01:34:36 2016 oradata/proddata/applsysd04.dbf
-rw-r----- 500 502 2306875392 May 31 01:34:36 2016 oradata/proddata/applsysd05.dbf
......
......
......
-rw-r----- 500 502 1572872192 Jan 09 12:52:40 2014 oradata/proddata/temp01.dbf
tar: 0511-169 A directory checksum error on media; 27 not equal to 29210.
root@clodb:/clodbvg>


My question : How can a user find out if his/her tar file has some files with errors/problems or no errors/problems
# 13  
Old 06-01-2016
Quote:
Originally Posted by filosophizer
sorry, if my question was misunderstood, what i meant was, how to check if a tar file has all the files in it without any errors / problems

My question : How can a user find out if his/her tar file has some files with errors/problems or no errors/problems
OK, i indeed have misunderstood the question. Sorry, my bad.

Well, there are diagnostic messages and a return code when you create the tar-file. These are always to be observed when creating an archive non-interactively (like inside a batch). In general it is good style to check return-codes in scripts, regardless of which command it is.

This is bad style:

Code:
command1
command2
command3

this is better and safer:

Code:
if ! command1 ; then
     echo "command1 failed" >> errorlog
fi
if ! command2 ; then
     echo "command2 failed, aborting." >> errorlog
     exit 1
fi
[...]

If you take your tar-archive this way you will notice upon creation that something was rotten in the state of Denmark.

Now, if you only have the archive and restore files: you can't know (at least not for sure) if the content is corrupt or not. The content of a tar-archive are archived files. tar can find out if the archive itself is damaged (by taking and testing checksums), but if a wrongly read file is archived correctly it will be "correct" from tars POV.

I hope this helps.

bakunin
# 14  
Old 06-02-2016
Do you really believe that the Oracle database content is corrupt? Wouldn't you detect that in the Oracle error log for day-to-day operation?

I'm not an Oracle DBA but I used to have one work for me when I was a system manager. I remember that in the situation of potentially corrupt data inside the dB he would use an Oracle utility to 'export' all the database out to a flat file (this could take a long time if the dB was huge), empty the dB of data, and then import all the data back in. He would watch for errors during the export and the export utility would take care of most things.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Tar error

do you have idea what is the limit to zip the file. + tar -cvf - today.txt tar: Size of today.txt >= 8GB. Not dumped. (3 Replies)
Discussion started by: ramkumar15
3 Replies

2. Shell Programming and Scripting

tar command to explore multiple layers of tar and tar.gz files

Hi all, I have a tar file and inside that tar file is a folder with additional tar.gz files. What I want to do is look inside the first tar file and then find the second tar file I'm looking for, look inside that tar.gz file to find a certain directory. I'm encountering issues by trying to... (1 Reply)
Discussion started by: bashnewbee
1 Replies

3. Shell Programming and Scripting

How to deal with .tar.gz files in Linux?x

Dear all, there are more than 10 files with .tar.gz extension in my folder i didnt want to extract them i just want to run the query to fetch my necessary data from all the files. but when i run the command it untar the files in that folder. gunzip -c abc.tar.gz | tar -xf - | grep REC |... (0 Replies)
Discussion started by: jojo123
0 Replies

4. Programming

How to deal with this error: floating constant exponent has no digits

A conditional statement cause it: if(strlen(str) < n1+1) { ------- } (7 Replies)
Discussion started by: cdbug
7 Replies

5. UNIX for Dummies Questions & Answers

tar -cvf test.tar `find . -mtime -1 -type f` only tar 1 file

Hi all, 4 files are returned when i issue 'find . -mtime -1 -type f -ls'. ./ora_475244.aud ./ora_671958.aud ./ora_934052.aud ./ora_934050.aud However, when I issued the below command: tar -cvf test.tar `find . -mtime -1 -type f`, the tar file only contains the 1st file -... (2 Replies)
Discussion started by: ahSher
2 Replies

6. Linux

tar error exit delayed form pervious error

Hi when use "tar cpvzf /dev/st0 --exclude=/proc --exclude-/lost+found --exclude=/mnt --exclude=/media --exclude=/sys /" to tape, get the following message "tar: error exit delayed form pervious error", What is the mean ? Please suggest some solution for these errors. thx (1 Reply)
Discussion started by: chayato
1 Replies

7. Solaris

Error while using tar

Hi, WHile decompressing the files, i get the error tar: directory checksum error. After decompressing when i check the size of file, it is less than the original file. Due to this error, there is loss of data. How can this error be removed? Thanks in advance. (7 Replies)
Discussion started by: agarwal
7 Replies

8. AIX

Tar error

When Im trying to untar a file I get an error message tar: 0511-169 A directory checksum error on media; 804399248 not equal to 46325. What can I do to untar my file Thanks (3 Replies)
Discussion started by: joemad
3 Replies

9. UNIX for Advanced & Expert Users

Error in tar

Hi i am facing one problem with one file dxagent.ss, this file has most of the binary contents. when i m running following command on unix machine tar xpf dxagent.ss output should be: removing leading '/' from members name. and should create 'usr' and 'var' directory. but i am getting some... (5 Replies)
Discussion started by: yogini nemade
5 Replies

10. Solaris

TAR error

When I tried to decompress using TAR the following error was popped up.. tar: blocksize = 0 ..Can anyone tell me wht this means and how to rectify this error... (3 Replies)
Discussion started by: hemin_pm
3 Replies
Login or Register to Ask a Question