Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Estimate the Size of an Full Database Export

Re: Estimate the Size of an Full Database Export

From: Dave Wotton <Dave.Wotton_at_dwotton.nospam.clara.co.uk>
Date: 2000/05/27
Message-ID: <y6QX4.1215$fq2.131979@nnrp4.clara.net>#1/1

Michael Kroh wrote in message <392E3404.C833574D_at_basf-ag.de>...
>Has anyone a script to estimate the size if a full database export.
>I need this the check the disk before the export runs.

It's virtually impossible to do this. An export file is basically one huge SQL script (you can view it with any text viewing utility), which contains CREATE TABLE and CREATE INDEX statements, and lots of INSERT INTO .... VALUES (.....) statements.

A large table in your db, but with very few rows, will generate only a few Kb in your export file, whereas a medium sized table with lots of rows, containing lots of columns will generate more Kb in your export file than the table takes in the db (where it is held in a fairly compact format). So there is no correlation between database size and export size.

Big Al suggest 4:1 compression, but that's just for his particular application.

Billy missed the point a bit, by exlaining how to compress the export on the fly, but still didn't tell you how to estimate the size of the export, either compressed or uncompressed. However, you could modify his script to do a dry-run, to count the number of bytes output, rather than save them to disc:

   mknod -p pipe.dmp
   compress < pipe.dmp | wc -c &
   exp userid=sys/password file=pipe.dmp full=y log=export.log

Note the "wc -c" to count the number of bytes output from the compress statment, rather than actually create the compressed export. If you want to calculate the number of bytes in an uncompressed export, replace the "compress" command in the above script by "cat".

Of course, I'm assuming you're on Unix. I haven't got a clue how to do it in Windows NT!

Dave.

--
If you reply to this posting by email, remove the "nospam" from my email
address first.
Received on Sat May 27 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US