Oracle数据泵的兼容性 Export/Import DataPump Parameter VERSION - Compatibility of Data Pump Between Different Oracle Versions (Doc ID 553337.1)

0    895    1

Tags:

👉 本文共约24758个字,系统预计阅读时间或需94分钟。

In this Document

APPLIES TO:

Enterprise Manager for Oracle Database - Version 10.1.0.2 and later
Oracle Database Backup Service - Version N/A and later
Oracle Database Cloud Service - Version N/A and later
Oracle Database - Standard Edition - Version 10.1.0.2 and later
Gen 1 Exadata Cloud at Customer (Oracle Exadata Database Cloud Machine) - Version N/A and later
Information in this document applies to any platform.

PURPOSE

This article describes issues related to the compatibility of the different versions of the Oracle Export Data Pump and Import Data Pump utilities.

SCOPE

The article is intended for users of the Oracle10g and Oracle11g databases who wish to use Export Data Pump (expdp) and Import Data Pump (impdp) to export data from an Oracle database release x and import this data into an Oracle database release y. The article gives information how to create an Export Data Pump dumpfile that can be imported into a higher or lower release database, and how the compatibility applies when Data Pump is used over a database link.
For the compatibility of the original export and import clients (exp resp. imp), see:
Note:132904.1 "Compatibility Matrix for Export & Import Between Different Oracle Versions"
For the transportable tablespaces export/import, see:
Note:291024.1 "Compatibility and New Features when Transporting Tablespaces with Export and Import"
In the text below, the following terminology is used:

  • Source database = the database where the data is exported from.
  • Target database = the database where the data is imported into.
  • Database compatibility level = the value of init.ora/spfile parameter COMPATIBLE.
  • Data Pump client version = the release version of the Data Pump client (software version).
  • Database version = the release version (the first four digits) of the ORACLE_HOME (= version of database dictionary).

DETAILS

1. Summary

The following are the most important guidelines regarding Data Pump compatibility:

  1. The compatibility level of the Data Pump dumpfile set is determined by the compatibility level of the source database.

  2. Use the Export Data Pump client (expdp) that matches the version of the source database (up to one major version lower expdp client can be used, but this is not recommended).

  3. Use the Import Data Pump client (impdp) that matches the version of the target database (up to one major version lower impdp client can be used, but this is not recommended).

  4. Use the Export Data Pump parameter VERSION in case the target database has a lower compatibility level than the source database.

  5. Transferring data over a database link is supported even if the compatibility level of the (remote) source database differs from the (local) connected database (up to one major version difference is supported).

  6. Import Data Pump can always read Export Data Pump dumpfile sets created by older versions of the database.

  7. Export dumpfiles created with the Export Data Pump client (expdp) cannot be read by the original Import client (imp).

  8. Export dumpfiles created with the original Export client (exp) cannot be read by the Import Data Pump client (impdp).

Overview of Data Pump dumpfile compatibility.

Export Use Export Data Pump parameter VERSION=...
From if dumpfile needs to be imported into a
Source Target Database with compatibility level
Database (value of init.ora/spfile parameter COMPATIBLE):
With

Overview of Data Pump client/server compatibility.

For details about generic interoperability between Oracle client and server versions, see also:
Note:207303.1 "Client / Server / Interoperability Support Between Different Oracle Versions"

Overview of Data Pump dumpfile set file versions.

Overview of Data Pump client/feature compatibility.

2. Introduction

2.1. Data Pump.
With Oracle10g Release 1 (10.1.0.x) we have introduced the new Export DataPump (expdp) and Import DataPump (impdp) utilities. These utilities have a better performance and increased flexibility when compared to the original export (exp) and import (imp) clients. All Data Pump Export and Import processing, including the reading and writing of dump files, is done on the system (server) selected by the specified database connect string.
With the Oracle Export Data Pump and Import Data Pump utilities you can transfer data objects between Oracle databases, even if they reside on platforms with different hardware and software configurations. With Export Data Pump the object definitions and table data can be extracted from an Oracle database and stored in an Oracle binary-format export Data Pump dumpfile located on the server.
The dumpfile set can then be transferred using FTP in binary mode or physically transported to a different site. With the Import Data Pump client the object definitions and table data can be read from the dumpfile set and then inserted into the Oracle database.


2.2. How to determine the database compatibility level ?
To determine the compatibility level of the database, run the following in SQL*Plus:

When checking for compatibility, Data Pump examins the major database release number and the database maintenance release number (i.e.: 11.1 in the example output above).
For details about version numbers, see also:
Note:39691.1 "VERSION NUMBER - Oracle version numbers explained"


2.3. How to determine the software version of the database and the Data Pump client ?
The software version of the Export Data Pump and Import Data Pump clients can be obtained by invoking the utilities with the parameter HELP=Y. The banner of the help page shows the version of the utility:

For details, see also:
Note:175627.1 "Export-Import iSR - How to Find the Database and Export/Import Version"


2.4. How to obtain the version of an export Data Pump dumpfile ?
Every export dumpfile starts with a header (usually 4 kb in size) which contains details about the dumpfile. Starting with Oracle10g Release 2 (10.2.0.1.0), this header information can be extracted from the dumpfile by calling the procedure DBMS_DATAPUMP.GET_DUMPFILE_INFO.
Possible output based on an example procedure SHOW_DUMPFILE_INFO:

In the example above, the dumpfile set has the compatibility level 12.2 (12.02.00.00.00) and is using a file version format 5.1. This dumpfile set can only be imported into a database with the same or a higher compatibility level.
For details, and the example procedure SHOW_DUMPFILE_INFO which can be called to obtain the export dumpfile header details, see:
Note:462488.1 "How to Gather the Header Information and the Content of an Export Dumpfile ?"

3. Basic Data Pump Compatibility

3.1. Data Pump dumpfile file version versus Data Pump job version.
When an Export Data Pump dumpfile set is created, we store information in the header block of each dumpfile. Besides the version of the Data Pump job, we also store the version of the dumpfile. The version of the dumpfile determines the internal structure of the dumpfile:

  • In Oracle10g Release 1 we create an Export Data Pump dumpfile with version 0.1.
  • In Oracle10g Release 2 we create an Export Data Pump dumpfile with version 1.1.
  • In Oracle11g Release 1 we create an Export Data Pump dumpfile with version 2.1.
  • In Oracle11g Release 2 we create an Export Data Pump dumpfile with version 3.1.
  • In Oracle12c Release 1 we create an Export Data Pump dumpfile with version 4.1.
  • In Oracle12c Release 2 we create an Export Data Pump dumpfile with version 5.1.
  • In Oracle18c we create an Export Data Pump dumpfile with version 5.1.
  • In Oracle19c we create an Export Data Pump dumpfile with version 5.1.

Note that the version of Data Pump dumpfile set is used internally to keep track of Data Pump specific features that result in a change of the internal structure of the dumpfile.
It is not possible to create a dumpfile with a higher version, e.g.: a 11.2.0.4.0 source database cannot create a version 4.1 dumpfile because that dumpfile version has a structure that was introduced in Oracle12c. It is possible though to create a dumpfile with a lower version, e.g.: a 11.2.0.4.0 source database can also create a version 1.1 dumpfile by specifying the Export Data Pump parameter VERSION (see section 4.2. "Export Data Pump parameter: VERSION" below). The reason why you would do this is to make the dumpfile set compatible with the lower release target database so it can be imported.

With the VERSION parameter you can specify the Data Pump job version and indirectly control the version of the dumpfile set. E.g.: if you specify VERSION=11.2 then Data Pump will create a dumpfile set that can be imported into an Oracle11g Release 2 database (dumpfile version: 3.1). When specified, you also determine which version of the objects will be exported. Database objects or attributes that are incompatible with the specified version will not be exported.

During the initial stage of an Import Data Pump job, the header block of each file in the dumpfile set is examined. We compare the value of the dumpfile version to the server's current file_version to make sure that the version of the dumpfile is equal to or less than that of the server.

  • Oracle10g Release 1 can import from a Data Pump dumpfile set with the file version 0.1.
  • Oracle10g Release 2 can import from a Data Pump dumpfile set with the file version 0.1 or 1.1.
  • Oracle11g Release 1 can import from a Data Pump dumpfile set with the file version 0.1 or 1.1 or 2.1.
  • Oracle11g Release 2 can import from a Data Pump dumpfile set with the file version 0.1 or 1.1 or 2.1 or 3.1.
  • Oracle12c Release 1 can import from a Data Pump dumpfile set with the file version 0.1 or 1.1 or 2.1 or 3.1 or 4.1.
  • Oracle12c Release 2 can import from any Data Pump dumpfile set, except dump files created with 18.x version.
  • Oracle18c can import from any Data Pump dumpfile set, except dump files created with 19.x version.
  • Oracle19c can import from any Data Pump dumpfile set.

An overview of the Data Pump dumpfile versions:

Remark:
Due to a regression in DataPump after installation of 12.1.0.2.180417DBBP or 12.1.0.2.180717DBBP, the dump file version written to the external table dump file in SQL mode will be 4.2, instead of 4.1. More details and the solution to fix the 12.1.0.2 DataPump regression can be found from Document 2422236.1 - Alert - Regression in DataPump After Applying 12.1.0.2.180417DBBP or 12.1.0.2.180717DBBP.

3.2. Data Pump server versus Data Pump clients.
Data Pump is server based and not client based. This means that most Data Pump specific defects will be fixed on the server side (changes in packages in source and target database) and not on the client side (Export or Import Data Pump client). If a Data Pump defect that occurs during an import job is fixed in a later patchset (e.g. 11.2.0.4.0) and the target database is still on the base release (11.2.0.1.0) then the defect will still occur when importing with a 11.2.0.4.0 Import Data Pump client into this 11.2.0.1.0 target database. The same applies to export jobs. It is therefore recommended that both the source database and the target database have the latest patchset installed.

3.3. Data Pump dumpfiles versus original export dumpfiles.

Data Pump versus original export/import clients:

  1. Export dumpfiles created with the Export Data Pump client (expdp) can only be read by the Import Data Pump client (impdp).

  2. Export dumpfiles created with the original Export client (exp) cannot be read by the Import Data Pump (impdp) client.

For details about the compatibility of the original export and import clients (exp resp. imp), see:
Note:132904.1 "Compatibility Matrix for Export & Import Between Different Oracle Versions

4. Export Data Pump Compatibility

4.1. Export Data Pump Compatibility Details.

Export Data Pump compatibility:

  1. The compatibility level of the Data Pump dumpfile set is determined by the compatibility level of the source database.

  2. When exporting data, use the same version Export Data Pump client as the version of the source database (up to one major version lower expdp client is possible, but this is not recommended).

  3. If the dumpfile needs to be imported into a lower version target database, use the Export Data Pump parameter VERSION to match the compatibility level of the target database.

Client/server compatibility:

Remarks\:

  1. Connecting with a lower version Export Data Pump client (e.g. 10.2.0.4.0) to a higher version source database (e.g. 11.2.0.4.0) is possible, but not recommended.
  • We support a compatibility between the database and the Data Pump client where the database may have a higher version with a maximum difference of one major database release. This means that any 10.x Data Pump client can start a Data Pump job on any higher release database (up to 11.x.). For example, you can use a 10.1.0.2.0 Export Data Pump client to start an export Data Pump job on an 11.2.0.4.0 database.
  • If the source database had COMPATIBLE=11.1.0, then the resulting dumpfile set will have the same compatibility level as the source database, even if the Export Data Pump job was started with a 10.1.0.2.0 or 10.2.0.4.0 Export Data Pump client.
  • It is not recommended to connect with a lower version Export Data Pump client (e.g. 10.2.0.4.0) to a higher version source database (e.g. 11.2.0.4.0).
    • If you are connecting with an older Export Data Pump client, certain Export Data Pump features may be unavailable. For example, if you connect with a 10.2.0.4.0 Export Data Pump client to an 11.2.0.4.0 database, an error will occur if you have also specified COMPRESSION=all because the value 'all' from the COMPRESSION parameter is not recognized by the 10.2.0.4.0 Export Data Pump client.
    • Certain Data Pump client specific defects may not have been fixed in the earlier release of the Export Data Pump client. Note however, that most Data Pump defects are fixed on the server side (source database) and not on the client side (export client).
  1. Connecting with a higher version Export Data Pump client (e.g. 11.2.0.4.0) to a lower version source database (e.g. 10.2.0.4.0) is not supported. Attempting to run such a job, will fail with UDE-18 (Data Pump client is incompatible with database version 11.2.0.4.0).
  • In exception to the above: within the same maintenance release (e.g. 10.2.0), it is possible to connect with an Export Data Pump client of a later patchset (e.g. 10.2.0.3.0) to a lower version source database (e.g. 10.2.0.1.0).
  • Note that Data Pump is server based and not client based. This means that most Data Pump specific defects are fixed on the server side (source database) and not on the client side (export client). If a Data Pump defect is fixed in a later patchset (e.g. 10.2.0.4.0) and the source database is still on the base release (10.2.0.1.0) then the defect will still occur when exporting with a 10.2.0.4.0 Export Data Pump client from this 10.2.0.1.0 source database.
  • Beware that there is a known defect when exporting with a 10.2.0.4.0 Export Data Pump client from a 10.2.0.3.0 or lower release database. For details, see also section 9.4. "Bug:7489698 - Schema Export with 10.2.0.4.0 expdp client from 10.2.0.3.0 or lower source fails".
  1. In a downgrade scenario, perform the Export Data Pump job with the same version Export Data Pump client as the version of the source database (recommended), and specify the VERSION parameter which is set to the lower compatibility level of the target database.
  • If the source database already had the same compatibility of the target database (e.g.: an 11.1.0.6.0 source database with COMPATIBLE=10.2.0, and a 10.2.0.4.0 target database with COMPATIBLE=10.2.0), then it is not required to specify the parameter VERSION=10.2.0 for the Export Data Pump job. However, to avoid confusion we recommend the usage of the VERSION parameter whenever the target database has a lower compatibility or release number.
  • See also section 4.2. "Export Data Pump parameter: VERSION" below.
  1. If the source database is a read-only database, then an Export Data Pump job that is started on that database will fail because Data Pump cannot create its so-called Master table. To workaround this, consider the read-only source database as a remote database and start the export Data Pump job on a different local database which has a database link to the remote read-only source database. Specify the NETWORK_LINK parameter when connecting with the Export Data Pump client to that different local database. The data from the remote read-only source database instance is transferred over the database link and written to a dump file set on the connected (local) database instance. See also section 4.3. "Export Data Pump NETWORK_LINK compatibility." below.


4.2. Export Data Pump parameter: VERSION
With the Export Data Pump parameter VERSION, you can control the version of the dumpfile set, and make the set compatible to be imported into a database with a lower compatibility level. Note that this does not mean that dumpfile set can be used with versions of Oracle Database prior to 10.1.0 because Export and Import Data Pump only work with Oracle Database 10g release 1 (10.1) or later.
When specified, internal Data Pump components like the Metadata Application Program Interface (API) make sure that the metadata objects are comptible with the specified version. As a result of this you have the ability to determine which version of the objects will be exported. Database objects or attributes that are incompatible with the specified version will not be exported. For example, tables containing new datatypes that are not supported in the specified version will not be exported.

Syntax Export Data Pump parameter: VERSION

VERSION={COMPATIBLE | LATEST | version_string}

COMPATIBLE = The version of the metadata corresponds to the database compatibility level. Database compatibility must be set to 9.2 or higher. This is the default value.
LATEST = The version of the metadata corresponds to the database release version.
version_string = A specific database version (e.g.: 11.1.0).

Remarks:\

  1. The minimum value of 'version_string' that can be specified is: 9.2 (e.g. if the dumpfile set needs to be imported into a 10.1.0.5.0 database which has COMPATIBLE=9.2 in the init.ora).

  2. The maximum value of 'version_string' that can be specified is equal to the release version of the source database. Note that this would be similar to specifying: VERSION=LATEST

  3. If you specify a VERSION for an Export Data Pump job that is older than the current database version, certain Export Data Pump features may be unavailable. For example, specifying VERSION=10.1 will cause an error if data compression is also specified for the job (e.g.: COMPRESSION=all), because compression was not supported in 10.1. See also section 8.6. "ORA-39055 (The AAA feature is not supported in version xx.yy.zz)" below.

  4. If you specify a VERSION for an Export Data Pump job that is older than the source database version, then a dumpfile set is created that you can import into that older version target database. However, this dumpfile set will not contain any objects that the older specified version does not support. For example, if you export from a version 10.2 database in order to import into a version 10.1 database (i.e. by specifying VERSION=10.1), comments on indextypes will not be exported into the dumpfile set.

  5. For an overview of the new database features introduced, see:

  • Manual Part No. B10763-01 "Oracle Database Upgrade Guide 10g Release 1 (10.1)", Chapter 5 "Compatibility and Interoperability", Section "Compatibility and Interoperability Issues Introduced in Oracle Database 10g Release 10.1"
  • Manual Part No. B14238-01 "Oracle Database Upgrade Guide 10g Release 2 (10.2)", Chapter 5 "Compatibility and Interoperability", Section "Compatibility and Interoperability Issues Introduced in Oracle Database 10g Release 10.2"
  • Manual Part No. B28300-02 "Oracle Database Upgrade Guide 11g Release 1 (11.1)", Chapter 5 "Compatibility and Interoperability", Section "Compatibility and Interoperability Issues Introduced in 11g Release 1 (11.1)"

Example\:
To create an Export Data Pump dumpfile set from a 11.1.0.6.0 source database with default compatibility level (COMPATIBLE=11.1.0.0.0) and which needs to be imported into a 10.2.0.4.0 target database that has a default compatibility level (COMPATIBLE=10.2.0.4.0), run the export Data Pump job with the 11.1.0.6.0 (or 10.2.0.4.0) Export Data Pump client that connects to the 11.1.0.6.0 source database and provide the Export Data Pump parameter: VERSION=10.2.0.4 (or VERSION=10.2 which means the same).


4.3. Export Data Pump NETWORK_LINK compatibility.
Export Data Pump can be started with the NETWORK_LINK parameter which enables an export from a remote (source) database that is identified by a valid database link. The data from the source database instance is transferred over the database link and written to a dump file set on the connected (local) database instance.
The compatibility rules are similar to those of the standard Export Data Pump compatibility:

Export Data Pump NETWORK_LINK compatibility:

  1. The compatibility level of the Data Pump dumpfile set is determined by the compatibility level of the (remote) source database or the (local) connected database, whichever is the lowest.

  2. When exporting data, use the same version Export Data Pump client as the version of the (local) connected database (up to one major version lower expdp client can be used, but this is not recommended).

  3. The compatibility level of the (remote) source database can differ from the (local) connected database.

  4. If the dumpfile needs to be imported into a lower version target database, use the Export Data Pump parameter VERSION to match the compatibility level of the target database.

Remarks:
\
1. See section 4.1. "Export Data Pump Compatibility Details" above for the standard Export Data Pump compatibility details.

本人提供Oracle(OCP、OCM)、MySQL(OCP)、PostgreSQL(PGCA、PGCE、PGCM)等数据库的培训和考证业务,私聊QQ646634621或微信dbaup66,谢谢!
AiDBA后续精彩内容已被站长无情隐藏,请输入验证码解锁本文!
验证码:
获取验证码: 请先关注本站微信公众号,然后回复“验证码”,获取验证码。在微信里搜索“AiDBA”或者“dbaup6”或者微信扫描右侧二维码都可以关注本站微信公众号。

标签:

Avatar photo

小麦苗

学习或考证,均可联系麦老师,请加微信db_bao或QQ646634621

您可能还喜欢...

发表回复