0% found this document useful (0 votes)
18 views4 pages

Document 3008530.1

This document explains that the Datapump impdp can successfully import data into a target table with fewer or more columns than the source table, provided there are no constraints on the columns not being imported. The operation is contingent on the TABLE_EXISTS_ACTION parameter being set to APPEND. The document includes examples of the export and import processes demonstrating this functionality in Oracle Database versions 11.2.0.3 and later.

Uploaded by

splivegma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views4 pages

Document 3008530.1

This document explains that the Datapump impdp can successfully import data into a target table with fewer or more columns than the source table, provided there are no constraints on the columns not being imported. The operation is contingent on the TABLE_EXISTS_ACTION parameter being set to APPEND. The document includes examples of the export and import processes demonstrating this functionality in Oracle Database versions 11.2.0.3 and later.

Uploaded by

splivegma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

7/3/25, 19:36 Document 3008530.

1
Copy right (c) 2025, Oracle. A ll rights reserv ed. Oracle Confidential.

Datapump Impdp Can Import Data Into Target Table With Less Or More Columns Than Source
Table Successfully If No Constraint (Doc ID 3008530.1)

In this Document

Goal
Solution
References

APPLIES TO:

Oracle Database - Enterprise Edition - Version 11.2.0.3 and later


Information in this document applies to any platform.

GOAL

The purpose of this Note is to introduce the Datapump impdp behavior when target table with less or more columns than
source table and there are no constraint checks for the columns that are not imported.

SOLUTION

Datapump impdp can import data into target table with less or more columns than source table successfully if there are no
constraint checks for the columns that are not imported. This depends on the parameter TABLE_EXISTS_ACTION where
this is possible when the value is set to APPEND.

Here is a test example:

[<HOST_NAME>]<PATH>> sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue Mar 5 01:20:55 2024

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options

SQL> grant dba to <USER1> identified by <PASS>;


conn <USER1>/<PASS>
create table <TABLE_NAME>(col1 number, col2 varchar2(30));

Grant succeeded.

SQL> Connected.
SQL>
Table created.

SQL> SQL>
SQL>
SQL> insert into <TABLE_NAME> select level, 'A'||level from dual connect by level <=10;

10 rows created.

SQL> commit;

Commit complete.

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=2fx77ycm5_219&id=3008530.1 1/4
7/3/25, 19:36 Document 3008530.1
SQL>
SQL> create or replace directory home as '<PATH>';

Directory created.

SQL>
SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
[<HOST_NAME>]<PATH>> expdp <USER1>/<PASS> directory=home dumpfile=<TABLE_NAME>.dmp tables=
<TABLE_NAME>

Export: Release 11.2.0.3.0 - Production on Tue Mar 5 01:22:53 2024

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
Starting "<USER1>"."SYS_EXPORT_TABLE_01": <USER1>/******** directory=home dumpfile=<TABLE_NAME>.dmp
tables=<TABLE_NAME>
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported "<USER1>"."<TABLE_NAME>" 5.484 KB 10 rows
Master table "<USER1>"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for <USER1>.SYS_EXPORT_TABLE_01 is:
<PATH>/<TABLE_NAME>.dmp
Job "<USER1>"."SYS_EXPORT_TABLE_01" successfully completed at 01:23:03

[<HOST_NAME>]<PATH>> sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue Mar 5 01:23:08 2024

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options

SQL> grant dba to <USER2> identified by <PASS>;

Grant succeeded.

SQL> conn <USER2>/<PASS>


Connected.
SQL>
SQL> create table <TABLE_NAME>(col1 number);

Table created.

SQL> insert into <USER2>.<TABLE_NAME> values(100);

1 row created.

SQL> commit;

Commit complete.

SQL> select * from <TABLE_NAME>;

COL1
----------
100

SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=2fx77ycm5_219&id=3008530.1 2/4
7/3/25, 19:36 Document 3008530.1
[<HOST_NAME>]<PATH>> expdp <USER2>/<PASS> directory=home dumpfile=<USER2>.dmp tables=<USER2>.
<TABLE_NAME>

Export: Release 11.2.0.3.0 - Production on Tue Mar 5 01:24:48 2024

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
Starting "<USER2>"."SYS_EXPORT_TABLE_01": <USER2>/******** directory=home dumpfile=<USER2>.dmp
tables=<USER2>.<TABLE_NAME>
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported "<USER2>"."<TABLE_NAME>" 5 KB 1 rows
Master table "<USER2>"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for <USER2>.SYS_EXPORT_TABLE_01 is:
<PATH>/<USER2>.dmp
Job "<USER2>"."SYS_EXPORT_TABLE_01" successfully completed at 01:24:55

[<HOST_NAME>]<PATH>> impdp <USER2>/26 directory=home dumpfile=<TABLE_NAME>.dmp remap_schema=


<USER1>:<USER2> table_exists_action=append

Import: Release 11.2.0.3.0 - Production on Tue Mar 5 01:25:45 2024

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
Master table "<USER2>"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "<USER2>"."SYS_IMPORT_FULL_01": <USER2>/******** directory=home dumpfile=<TABLE_NAME>.dmp
remap_schema=<USER1>:<USER2> table_exists_action=append
Processing object type TABLE_EXPORT/TABLE/TABLE
Table "<USER2>"."<TABLE_NAME>" exists. Data will be appended to existing table but all dependent
metadata will be skipped due to table_exists_action of append
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported "<USER2>"."<TABLE_NAME>" 5.484 KB 10 rows
Job "<USER2>"."SYS_IMPORT_FULL_01" successfully completed at 01:25:48

[<HOST_NAME>]<PATH>> impdp <USER1>/<PASS> directory=home dumpfile=<USER2>.dmp remap_schema=<USER2>:


<USER1> table_exists_action=append

Import: Release 11.2.0.3.0 - Production on Tue Mar 5 01:26:10 2024

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
Master table "<USER1>"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "<USER1>"."SYS_IMPORT_FULL_01": <USER1>/******** directory=home dumpfile=<USER2>.dmp
remap_schema=<USER2>:<USER1> table_exists_action=append
Processing object type TABLE_EXPORT/TABLE/TABLE
Table "<USER1>"."<TABLE_NAME>" exists. Data will be appended to existing table but all dependent
metadata will be skipped due to table_exists_action of append
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported "<USER1>"."<TABLE_NAME>" 5 KB 1 rows
Job "<USER1>"."SYS_IMPORT_FULL_01" successfully completed at 01:26:11

[<HOST_NAME>]<PATH>> sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue Mar 5 01:26:21 2024

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=2fx77ycm5_219&id=3008530.1 3/4
7/3/25, 19:36 Document 3008530.1
SQL> select * from <USER1>.<TABLE_NAME>;

COL1 COL2
---------- ------------------------------
1 A1
2 A2
3 A3
4 A4
5 A5
6 A6
7 A7
8 A8
9 A9
10 A10
100

11 rows selected.

SQL> select * from <USER2>.<TABLE_NAME>;

COL1
----------
100
1
2
3
4
5
6
7
8
9
10

11 rows selected.

SQL>

REFERENCES
NOTE:5632683.8 - Bug 5632683 - EXPDP / IMPDP may error for DDL modified tables
NOTE:8722752.8 - Bug 8722752 - Datapump import to existing table with fewer columns fails (ORA-2373 / ORA-600) for
multibyte column name
NOTE:819873.1 - Is It Possible To Exclude A Column From a Table Mode Import With Datapump
Didn't find what you are looking for?

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=2fx77ycm5_219&id=3008530.1 4/4

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy