1832423 Members
3454 Online
110042 Solutions
New Discussion

Incomplete copy of file

 
SOLVED
Go to solution
BONNAFOUS Jean Marc
Trusted Contributor

Incomplete copy of file

Hello,

Since two days I have problems with copy of some files.

I use "cp -fp" to copy Oracle .dbf files on save directory. I have two files that are not completely copying but i have no error on cp command ???

Thanks for your help.

JMB
Si vous ne faites jamais de bétises, c'est que vous ne faites rien de difficile. Et ça c'est une grosse bétise.
14 REPLIES 14
Uday Kiran Jonnala
New Member

Re: Incomplete copy of file

Can you please let us know the size of the file, what kind of directories are these.
john korterman
Honored Contributor

Re: Incomplete copy of file

Hi,
how do you know that the copying is not complete? Are the files in question by any chance >2GB?

regards,
John K.
it would be nice if you always got a second chance
BONNAFOUS Jean Marc
Trusted Contributor

Re: Incomplete copy of file

One have a size of 105Mo (copy only 80Mo) and the other have 58Mo (copy only 36Mo). It's not the biggest files. Some have size more than 550Mo and copy is OK.

JMB
Si vous ne faites jamais de bétises, c'est que vous ne faites rien de difficile. Et ça c'est une grosse bétise.
Geoff Wild
Honored Contributor

Re: Incomplete copy of file

Uhhh....shouldn't make a difference - but are you copying while the database is up? If so, then the file will be invalid anyways....

Another thing to try is - tar or cpio the files to your save dir.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
john korterman
Honored Contributor

Re: Incomplete copy of file

Hi again,
I guess that rules out the "large files" issue. I assume that the problem occurs fcontinously for the same two files. What happens if you try to copy the files by ftp in bin mode?

regards,
John K.
it would be nice if you always got a second chance
BONNAFOUS Jean Marc
Trusted Contributor

Re: Incomplete copy of file

I know copy is not complete because i compare the size of original files and copied files. And when i make a Dbverify on copied files i have a I/O error. It's normal because files is incomplete.

JMB
Si vous ne faites jamais de bétises, c'est que vous ne faites rien de difficile. Et ça c'est une grosse bétise.
BONNAFOUS Jean Marc
Trusted Contributor

Re: Incomplete copy of file

Hello Geoff,

I copy files when databases is stopped. I use cp command because i control files after copy with dbverify. If OK I start databases again and i save copied files on DAT. How can i control files if i use tar command?

JMB .
Si vous ne faites jamais de bétises, c'est que vous ne faites rien de difficile. Et ça c'est une grosse bétise.
RAC_1
Honored Contributor

Re: Incomplete copy of file

When you are copying files, are they being used by some processes? Check it with fuser -u ./file_name or with lsof command.

If they are not being used, copy them as follows.

tusc -o /tmp/log.txt -fp cp /source_file /destination_file.

You can get tusc utility here.

http://hpux.ee.ualberta.ca/

Anil
There is no substitute to HARDWORK
Geoff Wild
Honored Contributor

Re: Incomplete copy of file

Ok - try cpio:

find /original/directory -depth -print | cpio -pdxm /save/directory

Then do the dbverify

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
john korterman
Honored Contributor

Re: Incomplete copy of file

Hi again Jean,
just wondering about the return code from the cp command: if you execute "echo $?" right after the cp, does it then show "0"?
Another thought - can we absolutely rule out that there is not a hardware problem? Does the copy operation produce any syslog or dmesg messages?

regards,
John K.
it would be nice if you always got a second chance
Michael Schulte zur Sur
Honored Contributor

Re: Incomplete copy of file

Hi JMB,

is the save directory on the same logical volume?
Does the size of the copied file vary?
Have you tried a file compare?

greetings,

Michael
ranthony2cfl.rr.com
Regular Advisor

Re: Incomplete copy of file

By any chance, are you copying from an uncompressed directory to a compressed directory? -- if you copy from a directory where the properties are set for non-compression to one with properties set to compress all contained files, you will get the exact symptom you describe. Such compression is standardly-available on 2000 and (probably) XP. And, what happens when you copy the small-size file back into the previous copy-from directory?
vitam largo et Deus omnipotens
Hein van den Heuvel
Honored Contributor
Solution

Re: Incomplete copy of file

My guess is that there is a hardware problem with the files you are trying to copy and that your script / cp failed to report this correctly.
Where there system level error entries reported in the copy time window?
It could easily be that Oracle had no reason to read the broken pages and thus never reported a problem. The copied file however, missing a large chunk, would report an error.

I would recommend to try copy with dd to the null device an see whether it complains or stops too early. So check whether the reported record count matches the file size or not.

perl -e '$k= (-s "suspect.dbf")/(8*1024); print "$k\n"'

dd bs=8k of=/dev/null if=suspect.dbf

hth,
Hein.
BONNAFOUS Jean Marc
Trusted Contributor

Re: Incomplete copy of file

HI,

John, cp return no error code and no messages. And it's the reason of the difficult to find the real problem.
In fact this saturday, we have detect hardware problem on logical volume where is save directory: BRAVO Hein!


Thanks for yoyr help.

JMB

Si vous ne faites jamais de bétises, c'est que vous ne faites rien de difficile. Et ça c'est une grosse bétise.