Exportación congruente – Flashback_SCN

En exportaciones de data pump, es bueno usar el parámetro  flashback_scn para evadir incongruencias.  
in English



Con el parámetro flashback_scn, la exportación será congruente has el SCN (system change number) dado, de acuerdo con Oracle Utilities Guide. Las instrucciones siguientes agarran el SCN automáticamente y se lo pasan al comando de exportación:


# oradb@svr1
ORACLE_SID=oradb
ORAENV_ASK=NO
. oraenv

$ORACLE_HOME/bin/sqlplus -s ‘/ as sysdba’ <<EOF
set pages 0 echo off feed off
CREATE or REPLACE DIRECTORY bkp_dir as ‘/backups’;
GRANT READ, WRITE ON DIRECTORY bkp_dir to SYSTEM;
quit;
EOF

#Agarrar SCN
#escapar el signo $ de v$database con \\
dbscn=`
$ORACLE_HOME/bin/sqlplus -s ‘/ as sysdba’ <<!
set pages 0 echo off feed off
select to_char(current_scn) from v\\$database;
quit;
!
`

$ORACLE_HOME/bin/expdp system/*** directory=bkp_dir dumpfile=oradb_13_12_01_full_%U.dmp logfile=oradb_13_12_01_full.log flashback_scn=`echo $dbscn`

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s