Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: OH YEAH - switching raw device to fs
Igor <igor.news_at_merkudelete.org> wrote in message news:<pan.2004.09.16.15.20.38.126417_at_merkudelete.org>...
> [SECOND STEP]
> Now I have an database on file system, right?
> So, what I will do, tomorrow (I hear your yawns, sorry, but my kids are
> waiting), is, to back up the open fs database to raw device via dd.
> Just a few lines of commands, isn't it ...
>
> Of course, now I have to understand how to let dd skip first 4096 in
> output, so that dd does not overwrite the LVCB. But this is for tomorrow.
ah yes, the funny AIX LVM header. Here is the doco straight from
"man dd":
dd [ bs=BlockSize ][ cbs=BlockSize ] [ conv= [ ascii | block | ebcdic | ibm |
unblock ] [ lcase | ucase ] [ iblock ] [ noerror ] [ swab ] [ sync ] [ oblock ]
[ notrunc ] ] [ count=InputBlocks ] [ files=InputFiles ] [ fskip=SkipEOFs ] [
ibs=InputBlockSize ] [ if=InFile ] [ obs=OutputBlockSize ][ of=OutFile ] [
seek=RecordNumber ] [ skip=SkipInputBlocks ][ span=yes|no ]
See that little "seek=RecordNumber"? That's what you want. Make sure the "obs" is at least as big as what you want to skip. And it should work if you set seek=1. Ie, the seek has to "move forward" the amount you want expressed in terms of the obs.
Something like this:
dd if=/cooked/file.dbf of=/raw/devwhatever obs=4096 seek=1
and Roberto should be your uncle.
But don't take this for granted: try it out with some text files
in a normal login in AIX and see what I mean. Try for example to
use dd to append a file to another. It works. At least it does in
my AIX:
-rwxrwxrwx 1 oracle dba 65065 Sep 16 12:10 cleanDB.sql*
/home/oracle/Scripts$ dd if=cleanDB.sql of=zot.sql
127+1 records in.
-rwxrwxrwx 1 oracle dba 65065 Sep 16 12:10 cleanDB.sql* -rw-r--r-- 1 oracle dba 65065 Sep 17 11:04 zot.sqlNow the tricky one:
-rwxrwxrwx 1 oracle dba 65065 Sep 16 12:10 cleanDB.sql* -rw-r--r-- 1 oracle dba 130130 Sep 17 11:05 zot.sqlSee what I mean?