ebook img

Oracle9i Database Utilities PDF

528 Pages·2001·3.452 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Oracle9i Database Utilities

Oracle9i Database Utilities Release 1 (9.0.1) June 2001 Part No. A90192-01 Oracle9i Database Utilities, Release 1 (9.0.1) Part No. A90192-01 Copyright © 2001, Oracle Corporation. All rights reserved. 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 is prohibited. Theinformationcontainedinthisdocumentissubjecttochangewithoutnotice.Ifyoufindanyproblems 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 Oracle8i, Oracle9i, Oracle Store, SQL*Plus, Oracle7, and PL/SQL are trademarks or registered trademarks of Oracle Corporation. Other names may be trademarks of their respective owners. Contents Send Us Your Comments.............................................................................................................. xxvii Preface........................................................................................................................................................ xxix Audience.............................................................................................................................................. xxx Organization........................................................................................................................................ xxx Related Documentation................................................................................................................... xxxii Conventions...................................................................................................................................... xxxiii Documentation Accessibility......................................................................................................... xxxvi Accessibility of Code Examples in Documentation.................................................................... xxxvi What’s New in Database Utilities?......................................................................................... xxxvii Oracle9i Utilities New Features.................................................................................................... xxxvii Oracle8i Utilities New Features........................................................................................................... xl Part I Export and Import 1 Export What Is the Export Utility?................................................................................................................ 1-2 Before Using Export........................................................................................................................... 1-3 Running catexp.sql or catalog.sql............................................................................................... 1-3 Ensuring Sufficient Disk Space................................................................................................... 1-4 Verifying Access Privileges......................................................................................................... 1-4 Invoking Export.................................................................................................................................. 1-5 Command-Line Entries................................................................................................................ 1-5 iii Interactive Export Prompts......................................................................................................... 1-5 Parameter Files.............................................................................................................................. 1-6 Invoking Export As SYSDBA...................................................................................................... 1-7 Export Modes....................................................................................................................................... 1-8 Table-Level and Partition-Level Export.................................................................................. 1-12 Table-Level Export.............................................................................................................. 1-12 Partition-Level Export......................................................................................................... 1-12 Getting Online Help......................................................................................................................... 1-12 Export Parameters............................................................................................................................. 1-13 BUFFER........................................................................................................................................ 1-15 Example: Calculating Buffer Size...................................................................................... 1-15 COMPRESS.................................................................................................................................. 1-16 CONSISTENT.............................................................................................................................. 1-16 CONSTRAINTS.......................................................................................................................... 1-18 DIRECT........................................................................................................................................ 1-18 FEEDBACK.................................................................................................................................. 1-18 FILE............................................................................................................................................... 1-19 FILESIZE...................................................................................................................................... 1-19 FLASHBACK_SCN..................................................................................................................... 1-20 FLASHBACK_TIME................................................................................................................... 1-21 FULL............................................................................................................................................. 1-21 GRANTS....................................................................................................................................... 1-21 HELP............................................................................................................................................. 1-21 INDEXES...................................................................................................................................... 1-21 LOG............................................................................................................................................... 1-21 OWNER........................................................................................................................................ 1-22 PARFILE....................................................................................................................................... 1-22 QUERY......................................................................................................................................... 1-22 Restrictions........................................................................................................................... 1-23 RECORDLENGTH..................................................................................................................... 1-24 RESUMABLE............................................................................................................................... 1-24 RESUMABLE_NAME................................................................................................................ 1-24 RESUMABLE_TIMEOUT.......................................................................................................... 1-25 ROWS........................................................................................................................................... 1-25 STATISTICS................................................................................................................................. 1-25 iv TABLES........................................................................................................................................ 1-26 Table Name Restrictions..................................................................................................... 1-27 TABLESPACES........................................................................................................................... 1-28 TRANSPORT_TABLESPACE................................................................................................... 1-29 TRIGGERS................................................................................................................................... 1-29 TTS_FULL_CHECK.................................................................................................................... 1-29 USERID (username/password)................................................................................................ 1-29 VOLSIZE...................................................................................................................................... 1-30 Parameter Interactions............................................................................................................... 1-30 Example Export Sessions................................................................................................................. 1-30 Example Export Session in Full Database Mode.................................................................... 1-31 Example Export Session in User Mode................................................................................... 1-34 Example Export Sessions in Table Mode................................................................................ 1-35 Example 1: DBA Exporting Tables for Two Users.......................................................... 1-36 Example 2: User Exports Tables That He Owns............................................................. 1-36 Example 3: Using Pattern Matching to Export Various Tables.................................... 1-37 Example Export Session Using Partition-Level Export......................................................... 1-38 Example 1: Exporting a Table Without Specifying a Partition..................................... 1-38 Example 2: Exporting a Table with a Specified Partition.............................................. 1-39 Example 3: Exporting a Composite Partition.................................................................. 1-40 Using the Interactive Method......................................................................................................... 1-41 Restrictions.................................................................................................................................. 1-45 Warning, Error, and Completion Messages................................................................................. 1-45 Log File ........................................................................................................................................ 1-45 Warning Messages...................................................................................................................... 1-46 Nonrecoverable Error Messages.............................................................................................. 1-46 Completion Messages................................................................................................................ 1-46 Exit Codes for Inspection and Display......................................................................................... 1-46 Conventional Path Export Versus Direct Path Export............................................................... 1-47 Invoking a Direct Path Export........................................................................................................ 1-49 Security Considerations for Direct Path Exports................................................................... 1-49 Performance Issues for Direct Path Exports........................................................................... 1-50 Network Considerations................................................................................................................. 1-50 Transporting Export Files Across a Network......................................................................... 1-50 Exporting and Importing with Oracle Net............................................................................. 1-50 v Character Set and Globalization Support Considerations....................................................... 1-51 Character Set Conversion.......................................................................................................... 1-51 Effect of Character Set Sorting Order on Conversions.......................................................... 1-51 Multibyte Character Sets and Export and Import.................................................................. 1-52 Instance Affinity and Export........................................................................................................... 1-52 Considerations When Exporting Database Objects................................................................... 1-53 Exporting Sequences.................................................................................................................. 1-53 Exporting LONG and LOB Datatypes..................................................................................... 1-53 Exporting Foreign Function Libraries...................................................................................... 1-53 Exporting Offline Bitmapped Tablespaces............................................................................. 1-54 Exporting Directory Aliases...................................................................................................... 1-54 Exporting BFILE Columns and Attributes.............................................................................. 1-54 External Tables............................................................................................................................ 1-54 Exporting Object Type Definitions........................................................................................... 1-54 Exporting Nested Tables............................................................................................................ 1-55 Exporting Advanced Queue (AQ) Tables............................................................................... 1-55 Exporting Synonyms.................................................................................................................. 1-55 Support for Fine-Grained Access Control............................................................................... 1-56 Transportable Tablespaces.............................................................................................................. 1-56 Exporting from a Read-Only Database......................................................................................... 1-57 Using Export and Import to Partition a Database Migration................................................... 1-57 Advantages of Partitioning a Migration.................................................................................. 1-57 Disadvantages of Partitioning a Migration............................................................................. 1-58 How to Use Export and Import to Partition a Database Migration ................................... 1-58 Using Different Versions of Export............................................................................................... 1-58 Using a Previous Version of Export......................................................................................... 1-58 Using a Higher Version of Export............................................................................................ 1-59 Creating Oracle Release 8.0 Export Files from an Oracle9i Database..................................... 1-59 2 Import What Is the Import Utility?............................................................................................................... 2-2 Table Objects: Order of Import................................................................................................... 2-3 Before Using Import........................................................................................................................... 2-4 Running catexp.sql or catalog.sql............................................................................................... 2-5 Verifying Access Privileges......................................................................................................... 2-5 vi Importing Objects into Your Own Schema........................................................................ 2-5 Importing Grants................................................................................................................... 2-7 Importing Objects into Other Schemas.............................................................................. 2-7 Importing System Objects.................................................................................................... 2-7 Importing into Existing Tables......................................................................................................... 2-8 Manually Creating Tables Before Importing Data.................................................................. 2-8 Disabling Referential Constraints.............................................................................................. 2-9 Manually Ordering the Import................................................................................................... 2-9 Effect of Schema and Database Triggers on Import Operations............................................... 2-9 Invoking Import................................................................................................................................ 2-10 Command-Line Entries.............................................................................................................. 2-10 Interactive Import Prompts....................................................................................................... 2-11 Parameter Files............................................................................................................................ 2-11 Invoking Import As SYSDBA................................................................................................... 2-12 Import Modes.................................................................................................................................... 2-13 Getting Online Help........................................................................................................................ 2-14 Import Parameters............................................................................................................................ 2-14 BUFFER........................................................................................................................................ 2-18 CHARSET.................................................................................................................................... 2-18 COMMIT...................................................................................................................................... 2-19 COMPILE..................................................................................................................................... 2-19 CONSTRAINTS.......................................................................................................................... 2-20 DATAFILES................................................................................................................................. 2-20 DESTROY..................................................................................................................................... 2-20 FEEDBACK.................................................................................................................................. 2-20 FILE............................................................................................................................................... 2-21 FILESIZE...................................................................................................................................... 2-21 FROMUSER................................................................................................................................. 2-22 FULL............................................................................................................................................. 2-22 GRANTS...................................................................................................................................... 2-22 HELP............................................................................................................................................ 2-23 IGNORE....................................................................................................................................... 2-23 INDEXES..................................................................................................................................... 2-24 INDEXFILE.................................................................................................................................. 2-24 LOG.............................................................................................................................................. 2-25 vii PARFILE....................................................................................................................................... 2-25 RECORDLENGTH..................................................................................................................... 2-25 RESUMABLE............................................................................................................................... 2-26 RESUMABLE_NAME................................................................................................................ 2-26 RESUMABLE_TIMEOUT.......................................................................................................... 2-26 ROWS........................................................................................................................................... 2-26 SHOW........................................................................................................................................... 2-27 SKIP_UNUSABLE_INDEXES................................................................................................... 2-27 STATISTICS................................................................................................................................. 2-27 TABLES........................................................................................................................................ 2-28 Table Name Restrictions..................................................................................................... 2-29 TABLESPACES........................................................................................................................... 2-31 TOID_NOVALIDATE................................................................................................................ 2-31 TOUSER....................................................................................................................................... 2-32 TRANSPORT_TABLESPACE................................................................................................... 2-32 TTS_OWNERS............................................................................................................................. 2-32 USERID (username/password)................................................................................................ 2-33 VOLSIZE...................................................................................................................................... 2-33 Example Import Sessions................................................................................................................ 2-34 Example Import of Selected Tables for a Specific User......................................................... 2-34 Example Import of Tables Exported by Another User.......................................................... 2-35 Example Import of Tables from One User to Another.......................................................... 2-36 Example Import Session Using Partition-Level Import........................................................ 2-37 Example 1: A Partition-Level Import................................................................................ 2-37 Example 2: A Partition-Level Import of a Composite Partitioned Table.................... 2-38 Example 3: Repartitioning a Table on a Different Column........................................... 2-39 Example Import of Using Pattern Matching to Import Various Tables............................. 2-42 Parameter File Method....................................................................................................... 2-42 Command-Line Method..................................................................................................... 2-42 Import Messages.................................................................................................................. 2-42 Using the Interactive Method......................................................................................................... 2-43 Warning, Error, and Completion Messages................................................................................. 2-45 Log File ........................................................................................................................................ 2-45 Warning Messages...................................................................................................................... 2-45 Nonrecoverable Error Messages............................................................................................... 2-45 viii Completion Messages................................................................................................................ 2-46 Exit Codes for Inspection and Display......................................................................................... 2-46 Error Handling During an Import................................................................................................. 2-46 Row Errors................................................................................................................................... 2-47 Failed Integrity Constraints............................................................................................... 2-47 Invalid Data.......................................................................................................................... 2-47 Errors Importing Database Objects.......................................................................................... 2-47 Object Already Exists.......................................................................................................... 2-48 Sequences.............................................................................................................................. 2-48 Resource Errors.................................................................................................................... 2-48 Domain Index Metadata..................................................................................................... 2-48 Table-Level and Partition-Level Import....................................................................................... 2-49 Guidelines for Using Table-Level Import............................................................................... 2-49 Guidelines for Using Partition-Level Import......................................................................... 2-49 Migrating Data Across Partitions and Tables......................................................................... 2-50 Controlling Index Creation and Maintenance............................................................................ 2-51 Delaying Index Creation............................................................................................................ 2-51 Index Creation and Maintenance Controls............................................................................. 2-52 Example of Postponing Index Maintenance.................................................................... 2-52 Reducing Database Fragmentation............................................................................................... 2-53 Network Considerations................................................................................................................. 2-53 Transporting Export Files Across a Network......................................................................... 2-53 Exporting and Importing with Oracle Net............................................................................. 2-53 Character Set and Globalization Support Considerations....................................................... 2-54 Character Set Conversion.......................................................................................................... 2-54 User Data.............................................................................................................................. 2-54 Data Definition Language (DDL)...................................................................................... 2-54 Import and Single-Byte Character Sets.................................................................................... 2-55 Import and Multibyte Character Sets...................................................................................... 2-55 Considerations When Importing Database Objects.................................................................. 2-55 Importing Object Identifiers...................................................................................................... 2-55 Importing Existing Object Tables and Tables That Contain Object Types........................ 2-57 Importing Nested Tables........................................................................................................... 2-57 Importing REF Data................................................................................................................... 2-58 Importing BFILE Columns and Directory Aliases................................................................. 2-58 ix Importing Foreign Function Libraries..................................................................................... 2-59 Importing Stored Procedures, Functions, and Packages ..................................................... 2-59 Importing Java Objects............................................................................................................... 2-59 Importing External Tables......................................................................................................... 2-60 Importing Advanced Queue (AQ) Tables............................................................................... 2-60 Importing LONG Columns....................................................................................................... 2-60 Importing Views......................................................................................................................... 2-60 Importing Partitioned Tables.................................................................................................... 2-61 Support for Fine-Grained Access Control............................................................................... 2-61 Materialized Views and Snapshots............................................................................................... 2-62 Snapshot Log............................................................................................................................... 2-62 Snapshots..................................................................................................................................... 2-63 Importing a Snapshot.......................................................................................................... 2-63 Importing a Snapshot into a Different Schema............................................................... 2-63 Transportable Tablespaces.............................................................................................................. 2-64 Storage Parameters............................................................................................................................ 2-64 The OPTIMAL Parameter.................................................................................................. 2-65 Storage Parameters for OID Indexes and LOB Columns............................................... 2-65 Overriding Storage Parameters......................................................................................... 2-65 The Export COMPRESS Parameter................................................................................... 2-65 Read-Only Tablespaces.............................................................................................................. 2-66 Dropping a Tablespace..................................................................................................................... 2-66 Reorganizing Tablespaces............................................................................................................... 2-66 Importing Statistics.......................................................................................................................... 2-67 Using Export and Import to Partition a Database Migration................................................... 2-68 Advantages of Partitioning a Migration.................................................................................. 2-68 Disadvantages of Partitioning a Migration............................................................................. 2-68 How to Use Export and Import to Partition a Database Migration.................................... 2-69 Using Export Files from a Previous Oracle Release................................................................... 2-69 Using Oracle Version 7 Export Files........................................................................................ 2-69 Check Constraints on DATE Columns............................................................................. 2-69 Using Oracle Version 6 Export Files........................................................................................ 2-70 User Privileges..................................................................................................................... 2-70 CHAR columns.................................................................................................................... 2-70 Status of Integrity Constraints........................................................................................... 2-70 x

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.