Quantcast
Channel: Oracle DBA - RajaBaskar Blog
Viewing all articles
Browse latest Browse all 25

Version parameter in oracle expdp and impdp - Part II

$
0
0

Recently I wrote the article "Version parameter in oracle expdp and impdp"

KannanDreams asked the  below question..

Will this issue occur even when we migrate the data from Oracle 11.2.0 to 11.1.0 ?

Thank you Kannan for writing in..

I tested the below scenario on my test environment. I would like to share with you all.

Planning to take 11.2.0.2 schema export and will import into 11.1.0.7

DB version: 11.2.0.2


SQL> create user AM identified by AM;

User created.

SQL> grant connect,resource,dba to AM;

Grant succeeded.

SQL> create table AM.AM_objects  as select * from dba_objects;

Table created.

Export from 11.2.0.2 database without version parameter:

$  expdp dumpfile=exp_AM_11g.dmp logfile=exp_AM_11g.log directory=DP schemas=AM

Export: Release 11.2.0.2.0 - Production on Thu Apr 26 08:24:08 2012

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Username: / as sysdba

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
FLASHBACK automatically enabled to preserve database integrity.
Starting "SYS"."SYS_EXPORT_SCHEMA_01":  /******** AS SYSDBA dumpfile=exp_AM_11g.dmp logfile=exp_AM_11g.log directory=DP schemas=AM
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 7.476 MB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
. . exported "AM"."AM_OBJECTS"                           5.930 MB   61495 rows
Master table "SYS"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYS.SYS_EXPORT_SCHEMA_01 is:
  /u01/backup/export/dump/dp/exp_AM_11g.dmp
Job "SYS"."SYS_EXPORT_SCHEMA_01" successfully completed at 08:26:48


Import into 11.1.0.7 database:

$  impdp dumpfile=exp_AM_11g.dmp logfile=imp_AM_11g_10g.log directory=EXP_DIR1 schemas=AM

Import: Release 11.1.0.7.0 - 64bit Production on Thursday, 26 April, 2012 8:32:06

Copyright (c) 2003, 2007, Oracle.  All rights reserved.

Username: AM
Password:

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-39142: incompatible version number 3.1 in dump file "/u01/backup/export/dump/dp/exp_AM_11g.dmp"

Export from 11.2.0.2 database with version parameter:


$ expdp dumpfile=exp_AM_11g.dmp logfile=exp_AM_11g.log directory=DP schemas=AM  version=11.1.0 REUSE_DUMPFILES=y

Export: Release 11.2.0.2.0 - Production on Thu Apr 26 08:44:18 2012

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Username: AM
Password:

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
FLASHBACK automatically enabled to preserve database integrity.
Starting "AM"."SYS_EXPORT_SCHEMA_01":  AM/******** dumpfile=exp_AM_11g.dmp logfile=exp_AM_11g.log directory=DP schemas=AM version=11.1.0 REUSE_DUMPFILES=y
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 7.476 MB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
. . exported "AM"."AM_OBJECTS"                           5.930 MB   61495 rows
Master table "AM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for AM.SYS_EXPORT_SCHEMA_01 is:
  /u01/app/backup/dp/exp_AM_11g.dmp
Job "AM"."SYS_EXPORT_SCHEMA_01" successfully completed at 08:44:42


Import into 11.1.0.7 database:


$ impdp dumpfile=exp_AM_11g.dmp logfile=imp_AM_11g_10g.log directory=EXP_DIR1 schemas=AM

Import: Release 11.1.0.7.0 - 64bit Production on Thursday, 26 April, 2012 8:49:42

Copyright (c) 2003, 2007, Oracle.  All rights reserved.

Username: AM
Password:

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "AM"."SYS_IMPORT_SCHEMA_01" successfully loaded/unloaded
Starting "AM"."SYS_IMPORT_SCHEMA_01":  AM/******** dumpfile=exp_AM_11g.dmp logfile=imp_AM_11g_10g.log directory=EXP_DIR1 schemas=AM
Processing object type SCHEMA_EXPORT/USER
ORA-31684: Object type USER:"AM" already exists
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "AM"."AM_OBJECTS"                           5.930 MB   61495 rows
Job "AM"."SYS_IMPORT_SCHEMA_01" completed with 1 error(s) at 08:51:06


Conclusion:

Will this issue occur even when we migrate the data from Oracle 11.2.0 to 11.1.0 ?

Yes... Without version parameter we can't migrate the data using expdp/impdp across 11.2.0 to 11.1.0

Note: I have few more thoughts on the same issue. 

This version parameter may be internally working based on Compatible parameter.
eg:-
Source  database is running 11.2.0.2, but compatible parameter is 11.1.0

If we take export without version parameter from 11.2.0.2 and import into 11.1.0.7 database which compatible is 11.1.0.

Both source and target database compatible parameter is same(11.1.0). We need to check, whether expdp/impdp is working for this scenario without version parameter.

I will test and keep you post asap...


I Hope this article helped you. Suggestions are welcome.
Thanks !!!




Viewing all articles
Browse latest Browse all 25

Trending Articles