Monday, September 8, 2008

DIFFERENCES BETWEEN 'ESTIMATE' AND 'ESTIMATE_ONLY' IN EXPORT DATAPUMP

1. Parameter ESTIMATE
With the parameter ESTIMATE you can specify the method that Export will use to estimate how much disk space each table in the export job will consume (in bytes). The estimate is printed in the log file and displayed on your standard output device. The estimate is for table row data only; it does not include metadata.

The value for this parameter is either BLOCKS (default) or STATISTICS.
BLOCKS: The estimate is calculated by multiplying the number of database blocks used by the target objects times the appropriate block sizes.
STATISTICS: The estimate is calculated using statistics for each table. For this method to be as accurate as possible, all tables should have been analyzed recently.

Example:
SQL> CONNECT scott/tiger
Connected.
SQL> EXECUTE dbms_stats.gather_schema_stats('scott')
PL/SQL procedure successfully completed.
$ expdp scott/tiger DIRECTORY=my_dir DUMPFILE=exp_scott.dmp  LOGFILE=exp_scott.log ESTIMATE=statistics

Size estimates done via ESTIMATE=STATISTICS method could be inaccurate in the  following scenarios:
a) When statistics have not been collected in a while;
b) When statistics have been explicitly set via the DBMS_STATS package in order to force certain optimizer plans, instead of being directly collected from the data.

Similarly, ESTIMATE=BLOCKS method could be inaccurate when:
a) The table was created with a much bigger initial extent size than it was needed for the actual table data;
b) Many rows have been deleted from the table, or a very small percentage of each block is used.

2. Parameter ESTIMATE_ONLY
With the parameter ESTIMATE_ONLY you can estimate the space in bytes that would be consumed without actually performing the export operation. Using this Parameter will not generate the dump file other than a logfile (if specified).

The value for this parameter is either Y (yes) or N (no = default).
Y: Export estimates the space that would be consumed, but quits without actually performing the export operation.
N: Export does not estimate the space, but performs an actual export of data.

Example:
% expdp scott/tiger NOLOGFILE=y ESTIMATE_ONLY=y

No comments:

search engine

Custom Search