LOB | BLOB FILE | SLOW | PERFORMANCE | LOB MOVE | LOB EXPORT
dbms_rowid.rowid_block_number SLOW
#!/usr/bin/perl
use strict;
my $PARALLEL=32;
my $PFILE="parallel_table_exp.par";
my @row;
my $sp_flash_time=`sqlplus -S / as sysdba <<EOF
set pages 9999 lines 172
col x format a172
set trimout on
set trimspool on
select 'row:' || TO_CHAR(SYSDATE, 'dd/mon/yyyy hh24:mi:ss') x from dual
/
EOF`;
my $rc = $?;
if ($rc) {
print "sqlplus failed - exiting";
exit $?;
}
my $flash_time;
foreach ( split (/\n/, $sp_flash_time) ) {
chomp;
if ( /^row:/ ) {
s/^row://g;
$flash_time = $_;
}
}
if ( !defined ($flash_time) ) {
print "Unable to get database time - exiting";
}
print "Using flash time of: " . $flash_time . "\n";
open(PARFILE, ">", $PFILE);
print PARFILE "flashback_time=\"to_timestamp('${flash_time}', 'dd/mon/yyyy hh24:mi:ss')\"\n";
print PARFILE "parallel=1\n";
print PARFILE "exclude=statistics\n";
close(PARFILE);
$SIG{CHLD} = 'IGNORE';
my $shard = 0;
my $cmd;
foreach ($shard = 0 ; $shard < $PARALLEL ; $shard++) {
$cmd = "expdp \\\'/ as sysdba\\\' tables=TEST.TESTTABLE dumpfile=TEST_DPUMP:RT${shard}%U logfile=TEST_DPUMP:RT${shard}";
$cmd .= " parfile=${PFILE}";
$cmd .= " query=TEST.TESTTABLE:\'\"where mod(dbms_rowid.rowid_block_number(rowid), ${PARALLEL}) = " . $shard . "\"\'";
$cmd .= " &";
print "Starting: $cmd\n";
my $cpid = system($cmd);
}
Komentarze
Prześlij komentarz