Data Movement Utilities Guide and Reference
Total Page:16
File Type:pdf, Size:1020Kb
IBM® DB2 Universal Database™ Data Movement Utilities Guide and Reference Ve r s i o n 8 SC09-4830-00 IBM® DB2 Universal Database™ Data Movement Utilities Guide and Reference Ve r s i o n 8 SC09-4830-00 Before using this information and the product it supports, be sure to read the general information under Notices. This document contains proprietary information of IBM. It is provided under a license agreement and is protected by copyright law. The information contained in this publication does not include any product warranties, and any statements provided in this manual should not be interpreted as such. You can order IBM publications online or through your local IBM representative. v To order publications online, go to the IBM Publications Center at www.ibm.com/shop/publications/order v To find your local IBM representative, go to the IBM Directory of Worldwide Contacts at www.ibm.com/planetwide To order DB2 publications from DB2 Marketing and Sales in the United States or Canada, call 1-800-IBM-4YOU (426-4968). When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. © Copyright International Business Machines Corporation 1999, 2002. All rights reserved. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents About This Book ..........vii Parallelism and Loading .......110 Who Should Use this Book .......vii Privileges, Authorities, and Authorizations How this Book is Structured ......vii Required to Use Load ........111 Using Load ............112 Chapter 1. Export ..........1 Read Access Load Operations ......114 Export Overview ...........1 BuildingIndexes..........117 Privileges, Authorities and Authorization Using Load with Identity Columns ....119 Required to Use Export ........3 Using Load with Generated Columns . 121 Using Export ............3 Checking for Integrity Violations.....123 Using export with identity columns ....4 Refreshing Dependent Immediate Recreating an exported table .......5 Materialized Query Tables .......126 Exporting large objects (LOBS) ......5 Propagating Dependent Immediate Staging Exporting data in parallel ........6 Tables..............127 EXPORT .............8 Multi-Dimensional Clustering Delimiter Restrictions ........16 Considerations...........129 sqluexpr - Export ..........17 Restarting an Interrupted Load Operation 130 SQLUEXPT-OUT ..........29 Restarting or Terminating an Allow Read Export Sessions - CLP Examples .....30 Access Load Operation .......130 Using the Load Copy Location File ....131 Chapter 2. Import ..........31 LOAD .............133 ImportOverview..........32 LOAD QUERY...........178 Privileges, Authorities, and Authorization db2Load - Load ..........181 RequiredtoUseImport........33 db2LoadQuery - Load Query ......223 UsingImport...........33 Load Exception Table ........229 Using Import in a Client/Server Environment 35 Load Dump File ..........230 Using Import with Buffered Inserts ....36 Load Temporary Files ........230 Using Import with Identity Columns....36 Load Utility Log Records .......231 Using Import with Generated Columns . 38 Table Locking, Table States and Table Space Using Import to Recreate an Exported Table 39 States..............231 Importing Large Objects (LOBS) .....41 Character Set and National Language Importing User-defined Distinct Types (UDTs) 42 Support .............235 TableLockingDuringImport......42 Pending States After a Load Operation. 235 IMPORT.............42 Optimizing Load Performance .....237 sqluimpr-Import..........67 Load - CLP Examples ........243 SQLUIMPT-IN ...........92 SQLUIMPT-OUT ..........93 Chapter 4. Loading Data in a Partitioned Character Set and NLS Considerations . 95 Database Environment.......249 Import Sessions - CLP Examples .....95 Loading Data in a Partitioned Database - Overview............249 Chapter 3. Load ..........101 Using Load in a Partitioned Database Load Overview ..........102 Environment ...........251 Changes to Previous Load Behavior Monitoring a Partitioned Database Load Introduced in Version 6 and Version 7 . 107 Using Load Query .........258 Changes to Previous Load Behavior Restarting or Terminating a Load Operation Introduced in Version 8 .......108 in a Partitioned Database Environment . 260 © Copyright IBM Corp. 1999, 2002 iii Partitioned Database Load Configuration Export/Import/Load Utility File Formats 323 Options.............262 Delimited ASCII (DEL) File Format ....324 Example Partitioned Database Load Sessions 267 Example and Data Type Descriptions . 326 Migration and Back-level Compatibility . 271 Example DEL File.........326 Loading Data in a Partitioned Database DEL Data Type Descriptions .....327 Environment - Hints and Tips......273 Non-delimited ASCII (ASC) File Format . 330 Example and Data Type Descriptions . 331 Chapter 5. Moving DB2 Data Links Example ASC File.........331 Manager Data...........275 ASC Data Type Descriptions .....332 Moving DB2 Data Links Manager Using PC Version of IXF File Format .....335 Export - Concepts..........275 PC Version of IXF File Format - Details . 337 Using Export to Move DB2 Data Links PC/IXF Record Types .......337 Manager Data ...........279 PC/IXF Data Types ........356 Using Import to Move DB2 Data Links PC/IXF Data Type Descriptions ....363 Manager Data ...........279 General Rules Governing PC/IXF File Using Load to Move DB2 Data Links ImportintoDatabases.......369 Manager Data ...........281 Data Type-Specific Rules Governing PC/IXF File Import into Databases . 371 Chapter 6. Moving Data Between Systems 283 FORCEIN Option .........374 Moving Data Across Platforms - File Format Differences Between PC/IXF and Version Considerations...........283 0 System/370 IXF .........383 PC/IXF File Format ........283 WorksheetFileFormat(WSF)......383 Delimited ASCII (DEL) File Format . 284 WSFFileFormat.........284 Appendix E. Export/Import/Load Utility Moving Data With DB2 Connect .....285 Unicode Considerations .......385 db2move - Database Movement Tool . 287 Restrictions for Code Pages 1394, 1392 and db2relocatedb - Relocate Database ....292 5488 ..............386 Moving Data Between Typed Tables . 293 Incompatibilities ..........387 Moving Data Between Typed Tables - Details 294 Traverse Order..........294 Appendix F. Bind Files Used by the Selection During Data Movement . 295 Export, Import and Load Utilities ....389 Examples of Moving Data Between Typed Tables.............296 Appendix G. Warning, Error and Using Replication to Move Data .....298 Completion Messages........391 IBM Replication Tools ........299 The IBM Replication Tools by Component 299 Appendix H. DB2 Universal Database Using the Data Warehouse Center to Move technical information ........393 Data..............300 Overview of DB2 Universal Database Moving Data Using the Cursor File Type . 302 technicalinformation........393 Categories of DB2 technical information 393 Appendix A. How to Read the Syntax Printing DB2 books from PDF files ....401 Diagrams ............305 Ordering printed DB2 books ......402 Accessing online help ........402 Appendix B. Differences Between the Finding topics by accessing the DB2 Import and Load Utility .......309 InformationCenterfromabrowser....404 Finding product information by accessing Appendix C. Export/Import/Load Sessions the DB2 Information Center from the - API Sample Program........311 administration tools .........406 Appendix D. File Formats ......323 iv Data Movement Utilities Viewing technical documentation online Alternative Alert Cues .......414 directly from the DB2 HTML Documentation Compatibility with Assistive Technologies 414 CD...............407 Accessible Documentation ......414 Updating the HTML documentation installed DB2tutorials...........414 on your machine ..........408 DB2InformationCenterfortopics....415 Copying files from the DB2 HTML DocumentationCDtoaWebServer....410 Appendix I. Notices ........417 Troubleshooting DB2 documentation search Trademarks............420 with Netscape 4.x ..........410 SearchingtheDB2documentation....411 Index .............423 Online DB2 troubleshooting information . 412 Accessibility ...........413 Contacting IBM ..........427 Keyboard Input and Navigation ....413 Product information .........427 Accessible Display ........414 Contents v vi Data Movement Utilities About This Book This book provides information about, and shows you how to use, the following IBM DB2 Universal Database (UDB) data movement utilities: v The Import and Export utilities move data between a table or view and another database or spreadsheet program; between DB2 databases; and between DB2 databases and host databases using DB2 Connect. The export utility moves data from a database into operating system files; you can then use those files to import or load that data into another database. v The Load utility moves data into tables, extends existing indexes, and generates statistics. Load moves data much faster than the import utility when large amounts of data are involved. Data unloaded using the export utility can be loaded with the load utility. v When the Load utility is used in a partitioned database environment, large amounts of data can be partitioned and loaded into different database partitions. v DataPropagator (DPROP) is a component of DB2 Universal Database that allows automatic copying of table updates to other tables in other DB2 relational databases. v The Data Warehouse Center (DWC) can be