data pump export and import - community wiki

16
Best Practice Document Version: 1.0 – 2015-10-07 PUBLIC Oracle Data Pump Export and Import Oracle Test

Upload: others

Post on 14-Nov-2021

25 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Data Pump export and import - Community Wiki

Best Practice

Document Version: 1.0 – 2015-10-07

PUBLIC

Oracle Data Pump Export and Import Oracle Test

Page 2: Data Pump export and import - Community Wiki

2

PUBLIC

© 2015 SAP SE or an SAP affiliate company. All rights reserved.

Oracle Data Pump Export and Import

Document History

Document History

Version Date Change

1.0 2015-10-07 Document creation

Page 3: Data Pump export and import - Community Wiki

Oracle Data Pump Export and Import

Table of Contents

PUBLIC

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 3

Table of Contents

1 General Information ......................................................................................................................4

2 References...................................................................................................................................... 5

3 Important Information .................................................................................................................. 6

4 Data Pump Export ......................................................................................................................... 7 4.1 Some Important Parameters available in Export Mode .................................................................. 7 4.2 Invoking Data Pump Export ............................................................................................................. 7

4.2.1 Table-Mode Export .......................................................................................................... 8 4.2.2 Data-Only Export.............................................................................................................. 9 4.2.3 Estimating Disk Space in Table-Mode Export ............................................................... 10 4.2.4 Schema-Mode Export .................................................................................................... 10 4.2.5 Parallel Export ................................................................................................................ 10

5 Data Pump Import ........................................................................................................................ 11 5.1 Some Important Parameters available in Import Mode................................................................. 11 5.2 Invoking Data Pump Import........................................................................................................... 12

5.2.1 Table-Mode Import ........................................................................................................ 12 5.2.2 Data-Only Import ........................................................................................................... 13 5.2.3 Schema-Mode Import .................................................................................................... 13 5.2.4 Parallel Import................................................................................................................ 13

6 Data Pump Performance ............................................................................................................ 14 6.1 Key Elements of improved performance....................................................................................... 14 6.2 Tuning Performance ...................................................................................................................... 14

6.2.1 Controlling Resource Consumption .............................................................................. 14 6.2.2 Effect of Compression and Encryption on Performance............................................... 15 6.2.3 Memory Considerations When Exporting and Importing Statistics ............................. 15 6.2.4 Initialization Parameters That affect Data Pump Performance .................................... 15

Page 4: Data Pump export and import - Community Wiki

4

PUBLIC

© 2015 SAP SE or an SAP affiliate company. All rights reserved.

Oracle Data Pump Export and Import

General Information

1 General Information

Caution

There may be slight differences depending on your OS and DB version.

Note

This guide shows you the basic setup to execute export and import procedures through Oracle Data

Pump

OS Platform: Oracle Linux R6U5

DB Release: 12.1.0.2

Page 5: Data Pump export and import - Community Wiki

Oracle Data Pump Export and Import

References

PUBLIC

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 5

2 References

105047 Support for Oracle functions in the SAP environment

1013049 FAQ: Oracle Data Pump

541538 FAQ: Reorganization

778426 Special exports and imports with BRSPACE

976435 Support for Oracle Data Pump in BRSPACE

Oracle Database Utility Guide

Page 6: Data Pump export and import - Community Wiki

6

PUBLIC

© 2015 SAP SE or an SAP affiliate company. All rights reserved.

Oracle Data Pump Export and Import

Important Information

3 Important Information

Although usage in and within BR*Tools is integrated and supported. Pure EXPDP/IMPDP usage is allowed, but no

SAP Support is provided!

Page 7: Data Pump export and import - Community Wiki

Oracle Data Pump Export and Import

Data Pump Export

PUBLIC

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 7

4 Data Pump Export

It is a Utility for unloading data and metadata into a set of operating system files called a dump file set. This file

however can be imported only by the Data Pump Import Utility.

4.1 Some Important Parameters available in Export Mode

o COMPRESSION

o COMPRESSION_ALGORITHM

o CONTENT

o DIRECTORY

o DUMPFILE

o ESTIMATE

o ESTIMATE_ONLY

o LOGFILE

o PARALLEL

o TABLES

o TABLESPACES

4.2 Invoking Data Pump Export

SQL> create directory DATA_PUMP_DIRECTORY as '/oracle/dir4datapump';

Directory created.

SQL> grant read, write on directory DATA_PUMP_DIRECTORY to sapsr3;

Grant succeeded.

Page 8: Data Pump export and import - Community Wiki

8

PUBLIC

© 2015 SAP SE or an SAP affiliate company. All rights reserved.

Oracle Data Pump Export and Import

Data Pump Export

4.2.1 Table-Mode Export

testserver:ol1adm 91> expdp sapsr3 TABLES=TESTCOMP DUMPFILE=testcomp_exp

Export: Release 12.1.0.2.0 - Production on Wed Oct 7 14:57:45 2015

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

Password:

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

Starting "SAPSR3"."SYS_EXPORT_TABLE_01": sapsr3/******** TABLES=TESTCOMP

DUMPFILE=testcomp_exp

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

Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER

. . exported "SAPSR3"."TESTCOMP" 5.132 KB 11 rows

Master table "SAPSR3"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded

******************************************************************************

Dump file set for SAPSR3.SYS_EXPORT_TABLE_01 is:

/oracle/OL1/admin/OL1/dpdump/testcomp_exp.dmp

Job "SAPSR3"."SYS_EXPORT_TABLE_01" successfully completed at Wed Oct 7 14:58:12 2015 elapsed 0

00:00:22

Page 9: Data Pump export and import - Community Wiki

Oracle Data Pump Export and Import

Data Pump Export

PUBLIC

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 9

4.2.2 Data-Only Export

testserver:ol1adm 92> expdp sapsr3/test1234 TABLES=TESTCOMP CONTENT=DATA_ONLY

DUMPFILE=testcomp_exp_dataonly

Export: Release 12.1.0.2.0 - Production on Wed Oct 7 15:04:34 2015

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

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

Starting "SAPSR3"."SYS_EXPORT_TABLE_01": sapsr3/******** TABLES=TESTCOMP CONTENT=DATA_ONLY

DUMPFILE=testcomp_exp_dataonly

Estimate in progress using BLOCKS method...

Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

Total estimation using BLOCKS method: 64 KB

. . exported "SAPSR3"."TESTCOMP" 5.132 KB 11 rows

Master table "SAPSR3"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded

******************************************************************************

Dump file set for SAPSR3.SYS_EXPORT_TABLE_01 is:

/oracle/OL1/admin/OL1/dpdump/testcomp_exp_dataonly.dmp

Job "SAPSR3"."SYS_EXPORT_TABLE_01" successfully completed at Wed Oct 7 15:04:37 2015 elapsed 0

00:00:02

Page 10: Data Pump export and import - Community Wiki

10

PUBLIC

© 2015 SAP SE or an SAP affiliate company. All rights reserved.

Oracle Data Pump Export and Import

Data Pump Export

4.2.3 Estimating Disk Space in Table-Mode Export

testserver:ol1adm 93> expdp sapsr3/test1234 ESTIMATE_ONLY=YES TABLES=TESTCOMP

Export: Release 12.1.0.2.0 - Production on Wed Oct 7 15:08:12 2015

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

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

Starting "SAPSR3"."SYS_EXPORT_TABLE_01": sapsr3/******** ESTIMATE_ONLY=YES TABLES=TESTCOMP

Estimate in progress using BLOCKS method...

Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

. estimated "SAPSR3"."TESTCOMP" 64 KB

Total estimation using BLOCKS method: 64 KB

Job "SAPSR3"."SYS_EXPORT_TABLE_01" successfully completed at Wed Oct 7 15:08:14 2015 elapsed 0

00:00:02

4.2.4 Schema-Mode Export

Excluding TABLES parameter invokes a schema export!

4.2.5 Parallel Export

Use PARALLEL parameter.

Page 11: Data Pump export and import - Community Wiki

Oracle Data Pump Export and Import

Data Pump Import

PUBLIC

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 11

5 Data Pump Import

It is a utility for loading an export dump file set into a target system.

5.1 Some Important Parameters available in Import Mode

o CONTENT

o DIRECTORY

o DUMPFILE

o ESTIMATE

o LOGFILE

o PARALLEL

o TABLES

o TABLESPACES

Page 12: Data Pump export and import - Community Wiki

12

PUBLIC

© 2015 SAP SE or an SAP affiliate company. All rights reserved.

Oracle Data Pump Export and Import

Data Pump Import

5.2 Invoking Data Pump Import

5.2.1 Table-Mode Import

-sh-4.1$ impdp sapsr3/test1234 TABLES=TESTCOMP DIRECTORY=DATA_PUMP_DIRECTORY

DUMPFILE=testcomp_exp.dmp NOLOGFILE=YES

Import: Release 12.1.0.2.0 - Production on Mon Oct 12 15:20:08 2015

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

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

Master table "SAPSR3"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded

Starting "SAPSR3"."SYS_IMPORT_TABLE_01": sapsr3/******** TABLES=TESTCOMP

DIRECTORY=DATA_PUMP_DIRECTORY DUMPFILE=testcomp_exp.dmp NOLOGFILE=YES

Processing object type TABLE_EXPORT/TABLE/TABLE

Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

. . imported "SAPSR3"."TESTCOMP" 5.132 KB 11 rows

Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER

Job "SAPSR3"."SYS_IMPORT_TABLE_01" successfully completed at Mon Oct 12 15:20:29 2015 elapsed 0

00:00:21

Page 13: Data Pump export and import - Community Wiki

Oracle Data Pump Export and Import

Data Pump Import

PUBLIC

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 13

5.2.2 Data-Only Import

-sh-4.1$ impdp sapsr3/test1234 TABLES=TESTCOMP DIRECTORY=DATA_PUMP_DIRECTORY

DUMPFILE=testcomp_exp_dataonly.dmp NOLOGFILE=YES

Import: Release 12.1.0.2.0 - Production on Mon Oct 12 15:23:55 2015

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

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

Master table "SAPSR3"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded

Starting "SAPSR3"."SYS_IMPORT_TABLE_01": sapsr3/******** TABLES=TESTCOMP

DIRECTORY=DATA_PUMP_DIRECTORY DUMPFILE=testcomp_exp_dataonly.dmp NOLOGFILE=YES

Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

. . imported "SAPSR3"."TESTCOMP" 5.132 KB 11 rows

Job "SAPSR3"."SYS_IMPORT_TABLE_01" successfully completed at Mon Oct 12 15:24:00 2015 elapsed 0

00:00:04

5.2.3 Schema-Mode Import

Excluding TABLES parameter invokes a schema export!

Instead use SCHEMAS parameter!

5.2.4 Parallel Import

Use PARALLEL parameter.

Page 14: Data Pump export and import - Community Wiki

14

PUBLIC

© 2015 SAP SE or an SAP affiliate company. All rights reserved.

Oracle Data Pump Export and Import

Data Pump Performance

6 Data Pump Performance

Data Pump is designed for very large databases! Data Pump is showing reduced export and import times

compared to exp/imp utilities.

6.1 Key Elements of improved performance

Multiple worker processes performs intertable and interpartition parallelism to load and unload tables in

multiple, parallel, direct-path streams

For very large tables and partitions, single worker processes can choose parallelism through multiple parallel

queries and parallel DML I/O server processes in case of external tables method is used to access data

Data Pump uses parallelism to build up indexes and load package bodies

Dump files are read and written directly by the server

Dump file storage format is the internal stream format of the direct path API

The supported data access methods are faster than conventional SQL

Metadata and data extraction can be overlapped during export

6.2 Tuning Performance

Data Pump is designed to fully us all available resources to maximize throughput and minimize elapsed job time.

Because of this, the system needs and must to be balanced across CPU, memory and I/O. E.g. for maximum

performance one should ensure that the files that are members of a dump file set resides on different disks.

6.2.1 Controlling Resource Consumption

Data Pump export and import tools lets us to dynamically increase and decrease resource consumptions for each

job. For this one have to use PARALLEL parameter to specify the degree of parallelism. With increasing of this

parameter the overall resource consumption jumps, so be careful.

One can use substitution variables (like file%u.dmp) to maximize parallelism.

Page 15: Data Pump export and import - Community Wiki

Oracle Data Pump Export and Import

Data Pump Performance

PUBLIC

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 15

6.2.2 Effect of Compression and Encryption on Performance

The use of Data Pump parameters related to compression and encryption can have a positive effect on

performance, particularly in the case of jobs performed in network mode. But you should be aware that there can

also be a negative effect on performance because of the additional CPU resources required to perform

transformations on the raw data.

6.2.3 Memory Considerations When Exporting and Importing Statistics

To avoid running out of memory during the import operation, be sure to allocate enough memory before

beginning the import. The exact amount of memory needed will depend upon how much data you are importing,

the platform you are using, and other variables unique to your configuration.

To avoid high memory consumptions use parameter EXCLUDE = STATISTICS on either the export or import

operations.

6.2.4 Initialization Parameters That affect Data Pump Performance

Below Oracle Parameters can have some influence on the performance, however the effect may be different on all

platforms.

DISK_ASYNCH_IO = TRUE

DB_BLOCK_CHECKING = FALSE

DB_BLOCK_CHECKSUM = FALSE

Set below parameters to high enough:

PROCESSES

SESSIONS

PARALLEL_MAX_SERVERS

SHARED_POOL_SIZE

Page 16: Data Pump export and import - Community Wiki

www.sap.com/contactsap

© 2015 SAP SE or an SAP affiliate company. All rights reserved.

No part of this publication may be reproduced or transmitted in any

form or for any purpose without the express permission of SAP SE

or an SAP affiliate company.

The information contained herein may be changed without prior

notice. Some software products marketed by SAP SE and its

distributors contain proprietary software components of other

software vendors. National product specifications may vary.

These materials are provided by SAP SE or an SAP affiliate company

for informational purposes only, without representation or warranty

of any kind, and SAP or its affiliated companies shall not be liable for

errors or omissions with respect to the materials. The only

warranties for SAP or SAP affiliate company products and services

are those that are set forth in the express warranty statements

accompanying such products and services, if any. Nothing herein

should be construed as constituting an additional warranty.

SAP and other SAP products and services mentioned herein as well

as their respective logos are trademarks or registered trademarks of

SAP SE (or an SAP affiliate company) in Germany and other

countries. All other product and service names mentioned are the

trademarks of their respective companies. Please see

www.sap.com/corporate-en/legal/copyright/index.epx for

additional trademark information and notices.

Material Number: