Operating System - HP-UX
1825691 Members
3354 Online
109686 Solutions
New Discussion

Sparse Oracle files on a copy - bdf, du and ll

 
Steve Howie
Occasional Advisor

Sparse Oracle files on a copy - bdf, du and ll

hi,

This is probably a very frequently asked question, but here goes:

I am migrating a bunch of file systems from an XP512 to a Netapp FAS 3170. I'm using

tar cf - . | (cd xxxx;tar xvf -)

to move the data.

Since these are primarily Oracle files, the question of sparse files was churning about in my head. Anyway, I copied from /oracle/db6 to /netapp/db6 and was struck with the huge discrepancy shown by bdf:

# bdf |grep db6
/dev/vx02/lvol6 3145728 1024176 1988960 34% /oracle/db6
/dev/netapp/lvol13 3276800 2142144 1063745 67% /netapp/oracle/db6

However, listing the file sizes using ls -l gave the identical result in both file systems:

# cd /netapp/oracle/db6
# ls -la
total 1228848
drwxr-xr-x 5 oramaint oradba 96 Mar 18 11:00 .
drwxr-xr-x 24 root sys 8192 Jun 9 15:57 ..
drwxrwxrwx 2 root sys 96 Nov 9 2004 .EZtmp.d
drwxr-xr-x 2 oramaint oradba 96 Nov 26 2006 ftstdata
-rw-r----- 1 oramaint oradba 629153792 Mar 18 11:00 ftstdata ap.tmp
drwxr-xr-x 2 root root 96 Apr 21 2008 lost+found
# ls -al ftstdata
total 3051648
drwxr-xr-x 2 oramaint oradba 96 Nov 26 2006 .
drwxr-xr-x 5 oramaint oradba 96 Mar 18 11:00 ..
-rw-r----- 1 oramaint oradba 629153792 Feb 15 2005 ap.tmp
-rw-r----- 1 oramaint oradba 41951232 Mar 18 11:00 ar.tmp
-rw-r----- 1 oramaint oradba 314580992 Mar 18 10:59 oa.tmp
-rw-r----- 1 oramaint oradba 52436992 Mar 18 10:59 po.tmp
-rw-r----- 1 oramaint oradba 524296192 Jun 9 20:38 uogx01.dbf
# cd /oracle/db6
# ls -la
total 162
drwxr-xr-x 5 oramaint oradba 1024 Mar 18 11:00 .
drwxrwxr-x 24 oramaint applfin 8192 Sep 3 2008 ..
drwxrwxrwx 2 root sys 96 Nov 9 2004 .EZtmp.d
drwxr-xr-x 2 oramaint oradba 96 Nov 26 2006 ftstdata
-rw-r----- 1 oramaint oradba 629153792 Mar 18 11:00 ftstdata ap.tmp
drwxr-xr-x 2 root root 96 Apr 21 2008 lost+found
# ls -al ftstdata
total 2044466
drwxr-xr-x 2 oramaint oradba 96 Nov 26 2006 .
drwxr-xr-x 5 oramaint oradba 1024 Mar 18 11:00 ..
-rw-r----- 1 oramaint oradba 629153792 Feb 15 2005 ap.tmp
-rw-r----- 1 oramaint oradba 41951232 Mar 18 11:00 ar.tmp
-rw-r----- 1 oramaint oradba 314580992 Mar 18 10:59 oa.tmp
-rw-r----- 1 oramaint oradba 52436992 Mar 18 10:59 po.tmp
-rw-r----- 1 oramaint oradba 524296192 Jun 9 20:38 uogx01.dbf

So my question is - is bdf reporting sparse files incorrectly at the source, and not the destination? is this an issue of blocksizes on the Netapp vs the XP512? The data seems to be identical, and presumably it'll be ok to go ahead and use it on the Netapp - I just need to be reassured that this is just a disk utilization reporting issue, not a broken copy.

many thanks!

Scotty


1 REPLY 1
James R. Ferguson
Acclaimed Contributor

Re: Sparse Oracle files on a copy - bdf, du and ll

Hi Scotty:

If you want to copy a sparse file and not expand it at the destination, you 'fbackup/frecover' or 'pax'. Using 'tar' or 'cp' expands the file.

The number of characters reported by 'ls' is the actual offset for the file and hence remains constant.

You could use:

# cd srcdir && fbackup -i . -f - | ( cd dstdir && frecover -Xsrf - )

or:

# cd srcdir && pax -w . | ( cd dstdir && pax -r -pe )

Regards!

...JRF...