Вы находитесь на странице: 1из 4

Import / export datapump using FLASHBACK_TIME or FLASHBACK_SCN ( an...

Pgina 1 de 4

remidian.com (http://remidian.com) > oracle (http://remidian.com/category/oracle/) > Import /


export datapump using FLASHBACK_TIME or FLASHBACK_SCN ( and NETWORK_LINK ) fails
with ORA-31693, ORA-01031

Import / export datapump using


FLASHBACK_TIME or
FLASHBACK_SCN ( and
NETWORK_LINK ) fails with
ORA-31693, ORA-01031
Published on Aug 29 2013
# 1,990 (1,990 reads)
oracle (http://remidian.com/category/oracle/)

Im writing a shellscript that loads a remote schema into my database using impdp network_link
all goes well. Only once I add the FLASHBACK_TIME I got error below;
ORA-31693: Table data object "<TABLE_OWNER>"."<TABLE_NAME>" failed to load/
nload and is being skipped due to error:
ORA-01031: insufficient privileges
ORA-02063: preceding line from <DATABASE_NAME>

Here is my impdp command;

http://remidian.com/2013/08/import-datapump-impdp-using-flashback_time-and-netw... 26/09/2015

Import / export datapump using FLASHBACK_TIME or FLASHBACK_SCN ( an...

Pgina 2 de 4

${ORACLE_HOME}/bin/impdp
USERID=${_DB_IMPDP_USERNAME}/${_DB_IMPDP_PASSWORD}@${OPT_DB_TARGET}
JOB_NAME=${_IMPDP_JOBNAME}
NETWORK_LINK=${OPT_DB_SOURCE}
SCHEMAS=${OPT_DB_SCHEMA}
PARALLEL=${_DB_IMPDP_PARALLEL}
NOLOGFILE=Y
FLASHBACK_TIME=systimestamp
KEEP_MASTER=Y

\
\
\
\
\
\
\
\

_impdp_return_code=$?
echo "IMPDP exit code = ${_impdp_return_code}";
if [ ! ${_impdp_return_code} -eq 0 ] ; then
program_error ${ERR_DATAPUMP_IMP} ${_IMPDP_JOBNAME}
fi
.
.

What? My database link user (username of database / network_ link OPT_DB_SOURCE) does
have the EXP_FULL_DATABASE system privilege already on the database it connects to.
Luckily this one has an easy fix, as per metalink note; Doc ID 436106.1 Ora-01031: Insufficient
Privileges, When Using The Flashback_time Option with EXPDP/IMPDP Network_link
(https://support.oracle.com/epmos/faces/DocContentDisplay?id=436106.1)
User needs FLASHBACK (any) table privilege.
To use expdp/impdp FLASHBACK_TIME or FLASHBACK_SCN the network_link must
connect to the remote instance as user which has flashback query privileges granted on object
to be exported/imported. Grant FLASHBACK and SELECT privileges on specific objects to be
accessed during export/import or grant the FLASHBACK ANY TABLE privilege to allow
export/import on all tables.
Granting the network_link user EXP_FULL_DATABASE and/or IMP_FULL_DATABASE role is
not sufficient to access other schema objects when using FLASHBACK_TIME or
FLASHBACK_SCN via expdp/impdp network_link.

OK so heres the fix;


SQL> grant flashback any table to <username>
2 /
Grant succeeded.

http://remidian.com/2013/08/import-datapump-impdp-using-flashback_time-and-netw... 26/09/2015

Import / export datapump using FLASHBACK_TIME or FLASHBACK_SCN ( an...

Pgina 3 de 4

All the above applies to expdp with flashback_scn or flashback_time as well.

One thought on Import / export datapump using


FLASHBACK_TIME or FLASHBACK_SCN ( and NETWORK_LINK )
fails with ORA-31693, ORA-01031
1.

Andy Stonham says:


September 13, 2014 at 3:48 pm (http://remidian.com/2013/08/import-datapump-impdp-usingflashback_time-and-network_link-parameter-fails-with-ora-31693-ora-01031/#comment-85967)

Just what I needed to fix my impdp using network_link and flashback,


thanks
Reply (/2013/08/import-datapump-impdp-using-flashback_time-and-network_link-parameter-failswith-ora-31693-ora-01031/?replytocom=85967#respond)

Leave a Reply
Helpful? - leave your note below so I can brag
Name (required)

Email (will not be published) (required)

You may use these HTML (HyperText Markup Language) tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del
datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Submit Comment

http://remidian.com/2013/08/import-datapump-impdp-using-flashback_time-and-netw... 26/09/2015

Import / export datapump using FLASHBACK_TIME or FLASHBACK_SCN ( an...

Pgina 4 de 4

Running Wordpress (//wordpress.org) - with plugins: WP Code Highlight (//wordpress.org/extend/plugins/wp-codehighlight/), Better WordPress Minify (//wordpress.org/extend/plugins/bwp-minify/) & WP Supercache
(//wordpress.org/extend/plugins/wp-super-cache/)

Enhanced with Twitter Bootstrap (//twitter.github.io/bootstrap/) / LESS (//lesscss.org/) / Font Awesome


(//fortawesome.github.io/Font-Awesome/) / TimThumb (//code.google.com/p/timthumb/) / Fancybox
(//fancyapps.com/fancybox/) / Flexslider (//www.woothemes.com/flexslider/) /

http://remidian.com/2013/08/import-datapump-impdp-using-flashback_time-and-netw... 26/09/2015

Вам также может понравиться