Exforsys

Home arrow Reviews arrow Oracle Database Management Utilities

Oracle Utilities - Inter-Version Compatibility

Author: Packt Publishing     Published on: 14th Jan 2010

In, the previous example a 10g data pump generated an External Table that was transparently read by the 11g release.

 

Ads

Let's create an 11g data pump External Table named DP_DEPARTMENTS:

Sample Code
  1.  
  2.     create table dp_departments
  3.        organization external(
  4.                type oracle_datapump
  5.                default directory EXTTABDIR
  6.                    access parameters
  7.                    (
  8.                            version '10.2.0'
  9.                    )
  10.                    location ('dp_departments.dmp')
  11.           )
  12.      as
  13.         select * from departments
  14.      Table created.
  15.      SQL> select count(*) from dp_departments
  16.        COUNT(*)
  17.      ----------
  18.              27
  19.  
Copyright exforsys.com


In the previous example it is important to point out that the VERSION keyword defines the compatibility format.

access parameters ( version '10.2.0' )

If this clause is not specified then an incompatibility error will be displayed.

Sample Code
  1.  
  2. SQL> select count(*) from dp_departments
  3. select count(*) from dp_departments
  4. *
  5. ERROR at line 1:
  6. ORA-29913: error in executing ODCIEXTTABLEOPEN callout
  7. ORA-39142: incompatible version number 2.1 in dump file "/home/oracle/external_table_dest/dp_departments.dmp"
  8. ORA-06512: at "SYS.ORACLE_DATAPUMP", line 19
  9.  
Copyright exforsys.com


Now let's use the 10g version to read from it.

Sample Code
  1.  
  2. SQL> select count(*) from dp_departments
  3.  
  4.     COUNT(*)
  5. ----------
  6.               27
  7.  
Copyright exforsys.com


 

Ads

The VERSION clause is interpreted the same way as the VERSION clause for the data pump export, it has three different values:

· COMPATIBLE: This states that the version of the metadata corresponds to the database compatibility level.
· LATEST: This corresponds to the database version.
· VERSION NUMBER: This refers to a specific oracle version that the file is compatible with. This value cannot be lower than 9.2.0.



 
This tutorial is part of a Oracle Database Management Utilities tutorial series. Read it from the beginning and learn yourself.

Oracle Database Management Utilities

 

Comments