Oracle® Database Utilities 10g Release 1 (10.1) Part No. B10825-01 December 2003 Oracle Database Utilities, 10g Release 1 (10.1) Part No. B10825-01 Copyright © 1996, 2003 Oracle Corporation. All rights reserved. Primary Author: Kathy Rich Contributors: Lee Barton, Ellen Batbouta, Janet Blowney, George Claborn, Jay Davison, Steve DiPirro, Bill Fisher, Dean Gagne, John Galanes, John Kalogeropoulos, Jonathan Klein, Cindy Lim, Eric Magrath, Brian McCarthy, Rod Payne, Ray Pfau, Rich Phillips, Paul Reilly, Mike Sakayeda, Francisco Sanchez, Marilyn Saunders, Jim Stenoish, Carol Tagliaferri The Programs (which include both the software and documentation) contain proprietary information of Oracle Corporation; they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright, patent and other intellectual and industrial property laws. Reverse engineering, disassembly or decompilation of the Programs, except to the extent required to obtain interoperability with other independently created software or as specified by law, is prohibited. The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. Oracle Corporation does not warrant that this document is error-free. Except as may be expressly permitted in your license agreement for these Programs, no part of these Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Oracle Corporation. If the Programs are delivered to the U.S. Government or anyone licensing or using the programs on behalf of the U.S. Government, the following notice is applicable: Restricted Rights Notice Programs delivered subject to the DOD FAR Supplement are "commercial computer software" and use, duplication, and disclosure of the Programs, including documentation, shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement. Otherwise, Programs delivered subject to the Federal Acquisition Regulations are "restricted computer software" and use, duplication, and disclosure of the Programs shall be subject to the restrictions in FAR 52.227-19, Commercial Computer Software - Restricted Rights (June, 1987). Oracle Corporation, 500 Oracle Parkway, Redwood City, CA 94065. The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of such applications if the Programs are used for such purposes, and Oracle Corporation disclaims liability for any damages caused by such use of the Programs. Oracle is a registered trademark, and Oracle Store, Oracle8, Oracle8i, Oracle9i, PL/SQL, SQL*Net, and SQL*Plus are trademarks or registered trademarks of Oracle Corporation. Other names may be trademarks of their respective owners. iii Contents Send Us Your Comments xli Preface xliii Audience xliii Documentation Accessibility xliv Organization xliv Related Documentation xlvii Conventions xlviii What's New in Database Utilities? liii New Features in Oracle Database 10g liii Volume 1 Part I Oracle Data Pump 1 Overview of Oracle Data Pump Data Pump Components 1-1 What New Features Do Data Pump Export and Import Provide? 1-2 How Does Data Pump Access Data? 1-4 Direct Path Loads and Unloads 1-5 External Tables 1-6 Accessing Data Over a Network 1-6 What Happens During Execution of a Data Pump Job? 1-7 iv Coordination of a Job 1-7 Tracking Progress Within a Job 1-7 Filtering Data During a Job 1-8 Transforming Metadata During a Job 1-8 Maximizing Job Performance 1-8 Loading and Unloading of Data 1-9 Monitoring Job Status 1-9 The DBA_DATAPUMP_JOBS and USER_DATAPUMP_JOBS Views 1-10 The DBA_DATAPUMP_SESSIONS View 1-11 Monitoring the Progress of Executing Jobs 1-11 File Allocation 1-12 Specifying Files and Adding Additional Dump Files 1-12 Default Locations for Dump, Log, and SQL Files 1-13 Using Directory Objects When Automatic Storage Management Is Enabled 1-14 Setting Parallelism 1-15 Using Substitution Variables 1-16 Original Export and Import Versus Data Pump Export and Import 1-16 2 Data Pump Export What Is Data Pump Export? 2-1 Invoking Data Pump Export 2-2 Data Pump Export Interfaces 2-3 Data Pump Export Modes 2-3 Full Export Mode 2-4 Schema Mode 2-4 Table Mode 2-4 Tablespace Mode 2-4 Transportable Tablespace Mode 2-5 Network Considerations 2-5 Filtering During Export Operations 2-6 Data Filters 2-6 Metadata Filters 2-6 Parameters Available in Export's Command-Line Mode 2-8 ATTACH 2-9 CONTENT 2-10 v DIRECTORY 2-10 DUMPFILE 2-12 ESTIMATE 2-14 ESTIMATE_ONLY 2-14 EXCLUDE 2-15 FILESIZE 2-17 FLASHBACK_SCN 2-18 FLASHBACK_TIME 2-18 FULL 2-19 HELP 2-20 INCLUDE 2-20 JOB_NAME 2-22 LOGFILE 2-22 NETWORK_LINK 2-23 NOLOGFILE 2-24 PARALLEL 2-25 PARFILE 2-27 QUERY 2-27 SCHEMAS 2-29 STATUS 2-29 TABLES 2-30 TABLESPACES 2-31 TRANSPORT_FULL_CHECK 2-32 TRANSPORT_TABLESPACES 2-33 VERSION 2-34 How Data Pump Export Parameters Map to Those of the Original Export Utility 2-35 Commands Available in Export's Interactive-Command Mode 2-37 ADD_FILE 2-38 CONTINUE_CLIENT 2-39 EXIT_CLIENT 2-39 HELP 2-39 KILL_JOB 2-40 PARALLEL 2-40 START_JOB 2-41 STATUS 2-41 vi STOP_JOB 2-42 Examples of Using Data Pump Export 2-43 Performing a Table-Mode Export 2-43 Data-Only Unload of Selected Tables and Rows 2-43 Estimating Disk Space Needed in a Table-Mode Export 2-44 Performing a Schema-Mode Export 2-44 Performing a Parallel Full Database Export 2-45 Using Interactive Mode to Stop and Reattach to a Job 2-45 Syntax Diagrams for Data Pump Export 2-46 3 Data Pump Import What Is Data Pump Import? 3-1 Invoking Data Pump Import 3-2 Data Pump Import Interfaces 3-2 Data Pump Import Modes 3-3 Full Import Mode 3-4 Schema Mode 3-4 Table Mode 3-4 Tablespace Mode 3-4 Transportable Tablespace Mode 3-5 Network Considerations 3-5 Filtering During Import Operations 3-6 Data Filters 3-6 Metadata Filters 3-6 Parameters Available in Import's Command-Line Mode 3-7 ATTACH 3-8 CONTENT 3-9 DIRECTORY 3-10 DUMPFILE 3-11 ESTIMATE 3-12 EXCLUDE 3-13 FLASHBACK_SCN 3-15 FLASHBACK_TIME 3-16 FULL 3-17 HELP 3-18 vii INCLUDE 3-18 JOB_NAME 3-20 LOGFILE 3-20 NETWORK_LINK 3-22 NOLOGFILE 3-23 PARALLEL 3-23 PARFILE 3-24 QUERY 3-25 REMAP_DATAFILE 3-27 REMAP_SCHEMA 3-27 REMAP_TABLESPACE 3-29 REUSE_DATAFILES 3-30 SCHEMAS 3-30 SKIP_UNUSABLE_INDEXES 3-31 SQLFILE 3-32 STATUS 3-33 STREAMS_CONFIGURATION 3-33 TABLE_EXISTS_ACTION 3-34 TABLES 3-35 TABLESPACES 3-36 TRANSFORM 3-37 TRANSPORT_DATAFILES 3-39 TRANSPORT_FULL_CHECK 3-40 TRANSPORT_TABLESPACES 3-41 VERSION 3-41 How Data Pump Import Parameters Map to Those of the Original Import Utility 3-42 Commands Available in Import's Interactive-Command Mode 3-44 CONTINUE_CLIENT 3-45 EXIT_CLIENT 3-46 HELP 3-46 KILL_JOB 3-47 PARALLEL 3-47 START_JOB 3-48 STATUS 3-48 STOP_JOB 3-49 viii Examples of Using Data Pump Import 3-49 Performing a Data-Only Table-Mode Import 3-50 Performing a Schema-Mode Import 3-50 Performing a Network-Mode Import 3-50 Syntax Diagrams for Data Pump Import 3-51 4 Data Pump Performance Data Performance Improvements for Data Pump Export and Import 4-1 Tuning Performance 4-2 Controlling Resource Consumption 4-2 Initialization Parameters That Affect Data Pump Performance 4-3 5 The Data Pump API How Does the Client Interface to the Data Pump API Work? 5-1 Job States 5-2 What Are the Basic Steps in Using the Data Pump API? 5-4 Examples of Using the Data Pump API 5-4 Part II SQL*Loader 6 SQL*Loader Concepts SQL*Loader Features 6-1 SQL*Loader Parameters 6-3 SQL*Loader Control File 6-4 Input Data and Datafiles 6-5 Fixed Record Format 6-5 Variable Record Format 6-6 Stream Record Format 6-7 Logical Records 6-8 Data Fields 6-9 LOBFILEs and Secondary Datafiles (SDFs) 6-9 Data Conversion and Datatype Specification 6-10 Discarded and Rejected Records 6-10 The Bad File 6-11 ix SQL*Loader Rejects 6-11 Oracle Database Rejects 6-11 The Discard File 6-11 Log File and Logging Information 6-12 Conventional Path Loads, Direct Path Loads, and External Table Loads 6-12 Conventional Path Loads 6-12 Direct Path Loads 6-13 Parallel Direct Path 6-13 External Table Loads 6-13 Choosing External Tables Versus SQL*Loader 6-14 Loading Objects, Collections, and LOBs 6-14 Supported Object Types 6-14 column objects 6-14 row objects 6-15 Supported Collection Types 6-15 Nested Tables 6-15 VARRAYs 6-15 Supported LOB Types 6-15 Partitioned Object Support 6-16 Application Development: Direct Path Load API 6-16 7 SQL*Loader Command-Line Reference Invoking SQL*Loader 7-1 Alternative Ways to Specify Parameters 7-3 Command-Line Parameters 7-3 BAD (bad file) 7-3 BINDSIZE (maximum size) 7-4 COLUMNARRAYROWS 7-4 CONTROL (control file) 7-4 DATA (datafile) 7-5 DATE_CACHE 7-5 DIRECT (data path) 7-6 DISCARD (filename) 7-6 DISCARDMAX (integer) 7-6 ERRORS (errors to allow) 7-6 x EXTERNAL_TABLE 7-7 Restrictions When Using EXTERNAL_TABLE 7-8 FILE (file to load into) 7-9 LOAD (records to load) 7-9 LOG (log file) 7-9 MULTITHREADING 7-9 PARALLEL (parallel load) 7-10 PARFILE (parameter file) 7-10 READSIZE (read buffer size) 7-10 RESUMABLE 7-11 RESUMABLE_NAME 7-12 RESUMABLE_TIMEOUT 7-12 ROWS (rows per commit) 7-12 SILENT (feedback mode) 7-13 SKIP (records to skip) 7-14 SKIP_INDEX_MAINTENANCE 7-14 SKIP_UNUSABLE_INDEXES 7-15 STREAMSIZE 7-15 USERID (username/password) 7-16 Exit Codes for Inspection and Display 7-16 8 SQL*Loader Control File Reference Control File Contents 8-2 Comments in the Control File 8-4 Specifying Command-Line Parameters in the Control File 8-4 OPTIONS Clause 8-4 Specifying Filenames and Object Names 8-5 Filenames That Conflict with SQL and SQL*Loader Reserved Words 8-5 Specifying SQL Strings 8-5 Operating System Considerations 8-5 Specifying a Complete Path 8-6 Backslash Escape Character 8-6 Nonportable Strings 8-6 Using the Backslash as an Escape Character 8-6 Escape Character Is Sometimes Disallowed 8-7 [...]... 17-1 Ramifications of Changing the DBID and DBNAME 17-2 Considerations for Global Database Names 17-2 Changing the DBID and DBNAME of a Database 17-3 Changing the DBID and Database Name 17-3 Changing Only the Database ID 17-6 Changing Only the Database Name 17-7 Troubleshooting DBNEWID 17-9 DBNEWID Syntax ... External Table Using ORACLE_ LOADER Using External Tables to Load and Unload Data Loading Data Unloading Data Using the ORACLE_ DATAPUMP Access Driver Dealing with Column Objects Datatype Conversion During External Table Use Parallel Access to External Tables Parallel Access with ORACLE_ LOADER Parallel Access with ORACLE_ DATAPUMP ... Loading Columns Containing Final Object Types Tables of Final Object Types Reserved Words for the ORACLE_ DATAPUMP Access Driver Part IV 15-2 15-2 15-2 15-3 15-3 15-3 15-4 15-8 15-9 15-10 15-11 15-11 15-14 15-15 15-16 15-18 Other Utilities xxiii 16 DBVERIFY: Offline Database Verification Utility Using DBVERIFY to Validate Disk Blocks of a Single Datafile Syntax ... lobfile_attr_list Reserved Words for the ORACLE_ LOADER Access Driver 15 14-28 14-28 14-29 14-30 14-31 14-32 14-33 14-33 14-34 14-34 14-34 14-34 14-34 14-35 14-36 The ORACLE_ DATAPUMP Access Driver access_parameters Clause comments LOGFILE | NOLOGFILE Filenames for LOGFILE Example of LOGFILE Usage for ORACLE_ DATAPUMP VERSION Clause ... 19-22 19-23 19-24 19-24 19-25 19-26 xxv Calling DBMS_LOGMNR.START_LOGMNR Multiple Times Supplemental Logging Database- Level Supplemental Logging Minimal Supplemental Logging Database- Level Identification Key Logging Disabling Database- Level Supplemental Logging Table-Level Supplemental Logging Table-Level Identification Key Logging ... Supported Datatypes, Storage Attributes, and Database and Redo Log File Versions Supported Datatypes and Table Storage Attributes Unsupported Datatypes and Table Storage Attributes Supported Databases and Redo Log File Versions 20 19-82 19-82 19-84 19-85 19-85 19-86 19-86 Original Export and Import What Are the Export and Import Utilities? Before Using Export and Import... a Database Migration Advantages of Partitioning a Migration Disadvantages of Partitioning a Migration How to Use Export and Import to Partition a Database Migration Using Different Releases and Versions of Export Restrictions When Using Different Releases and Versions of Export and Import Examples of Using Different Releases of Export and Import Creating Oracle. .. 14-23 length 14-23 datatype_spec Clause 14-24 [UNSIGNED] INTEGER [EXTERNAL] [(len)] 14-26 DECIMAL [EXTERNAL] and ZONED [EXTERNAL] 14-26 ORACLE_ DATE 14-26 ORACLE_ NUMBER 14-27 Floating-Point Numbers 14-27 DOUBLE 14-27 FLOAT [EXTERNAL] 14-27 BINARY_DOUBLE 14-28 BINARY_FLOAT... ORACLE_ LOADER Parallel Access with ORACLE_ DATAPUMP Performance Hints When Using External Tables Performance Hints Specific to the ORACLE_ LOADER Access Driver External Table Restrictions Restrictions Specific to the ORACLE_ DATAPUMP Access Driver Behavior Differences Between SQL*Loader and External Tables Multiple Primary Input Datafiles Syntax... Restrictions for Direct Path Exports Exporting from a Read-Only Database 20-73 20-74 20-74 20-74 20-75 20-75 20-75 20-75 20-76 20-77 20-77 20-77 20-78 20-78 20-78 20-79 20-79 20-80 20-80 20-80 20-81 20-82 20-82 20-82 20-83 20-83 20-83 20-83 20-84 20-84 20-84 20-85 20-85 20-86 20-86 xxxi Considerations When Exporting Database Objects 20-87 Exporting Sequences 20-87 . Oracle Database Utilities 10g Release 1 (10.1) Part No. B10825-01 December 2003 Oracle Database Utilities, 10g Release 1 (10.1) Part. xlviii What's New in Database Utilities? liii New Features in Oracle Database 10g liii Volume 1 Part I Oracle Data Pump 1 Overview of Oracle Data Pump Data