1. Trang chủ
  2. » Công Nghệ Thông Tin

Oracle® Database Utilities potx

736 1,6K 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 736
Dung lượng 10,1 MB

Nội dung

Oracle® Database Utilities 11g Release 2 (11.2) E10701-02 August 2009 Oracle Database Utilities, 11g Release 2 (11.2) E10701-02 Copyright © 1996, 2009, Oracle and/or its affiliates. All rights reserved. Primary Author: Kathy Rich Contributors: Lee Barton, Ellen Batbouta, Janet Blowney, Steve DiPirro, Bill Fisher, Steve Fogel, Dean Gagne, John Kalogeropoulos, Jonathan Klein, Cindy Lim, Brian McCarthy, Rod Payne, Rich Phillips, Mike Sakayeda, Francisco Sanchez, Marilyn Saunders, Jim Stenoish, Hui-ling Yu This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this software or related documentation is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065. This software is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications which may create a risk of personal injury. If you use this software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of this software. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software in dangerous applications. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. This software and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services. iii Contents Preface xxxiii Audience xxxiii Documentation Accessibility xxxiii Related Documentation xxxiv Syntax Diagrams xxxv Conventions xxxv What's New in Database Utilities? xxxvii New Features in Oracle Database Utilities 11g Release 2 xxxvii New Features in Oracle Database Utilities 11g Release 1 xxxviii Part I Oracle Data Pump 1 Overview of Oracle Data Pump Data Pump Components 1-1 How Does Data Pump Move Data? 1-2 Using Data File Copying to Move Data 1-2 Using Direct Path to Move Data 1-3 Using External Tables to Move Data 1-4 Using Conventional Path to Move Data 1-5 Using Network Link Import to Move Data 1-5 Required Roles for Data Pump Export and Import Operations 1-6 What Happens During Execution of a Data Pump Job? 1-6 Coordination of a Job 1-6 Tracking Progress Within a Job 1-6 Filtering Data and Metadata During a Job 1-7 Transforming Metadata During a Job 1-7 Maximizing Job Performance 1-8 Loading and Unloading of Data 1-8 Monitoring Job Status 1-8 Monitoring the Progress of Executing Jobs 1-9 File Allocation 1-10 Specifying Files and Adding Additional Dump Files 1-10 Default Locations for Dump, Log, and SQL Files 1-10 Oracle RAC Considerations 1-12 iv Using Directory Objects When Oracle Automatic Storage Management Is Enabled 1-12 Using Substitution Variables 1-13 Moving Data Between Different Database Versions 1-13 SecureFile LOB Considerations 1-14 2 Data Pump Export What Is Data Pump Export? 2-1 Invoking Data Pump Export 2-1 Data Pump Export Interfaces 2-2 Data Pump Export Modes 2-2 Full Export Mode 2-3 Schema Mode 2-3 Table Mode 2-3 Tablespace Mode 2-4 Transportable Tablespace Mode 2-4 Network Considerations 2-4 Filtering During Export Operations 2-5 Data Filters 2-5 Metadata Filters 2-5 Parameters Available in Export's Command-Line Mode 2-6 ATTACH 2-8 CLUSTER 2-9 COMPRESSION 2-10 CONTENT 2-11 DATA_OPTIONS 2-11 DIRECTORY 2-12 DUMPFILE 2-13 ENCRYPTION 2-14 ENCRYPTION_ALGORITHM 2-15 ENCRYPTION_MODE 2-16 ENCRYPTION_PASSWORD 2-17 ESTIMATE 2-18 ESTIMATE_ONLY 2-19 EXCLUDE 2-19 FILESIZE 2-21 FLASHBACK_SCN 2-22 FLASHBACK_TIME 2-22 FULL 2-23 HELP 2-24 INCLUDE 2-24 JOB_NAME 2-26 LOGFILE 2-26 NETWORK_LINK 2-27 NOLOGFILE 2-28 PARALLEL 2-29 PARFILE 2-30 QUERY 2-31 v REMAP_DATA 2-32 REUSE_DUMPFILES 2-33 SAMPLE 2-33 SCHEMAS 2-34 SERVICE_NAME 2-35 SOURCE_EDITION 2-36 STATUS 2-36 TABLES 2-37 TABLESPACES 2-39 TRANSPORT_FULL_CHECK 2-40 TRANSPORT_TABLESPACES 2-40 TRANSPORTABLE 2-42 VERSION 2-43 Commands Available in Export's Interactive-Command Mode 2-44 ADD_FILE 2-45 CONTINUE_CLIENT 2-45 EXIT_CLIENT 2-45 FILESIZE 2-46 HELP 2-46 KILL_JOB 2-46 PARALLEL 2-47 START_JOB 2-47 STATUS 2-48 STOP_JOB 2-48 Examples of Using Data Pump Export 2-49 Performing a Table-Mode Export 2-49 Data-Only Unload of Selected Tables and Rows 2-49 Estimating Disk Space Needed in a Table-Mode Export 2-50 Performing a Schema-Mode Export 2-50 Performing a Parallel Full Database Export 2-50 Using Interactive Mode to Stop and Reattach to a Job 2-50 Syntax Diagrams for Data Pump Export 2-51 3 Data Pump Import What Is Data Pump Import? 3-1 Invoking Data Pump Import 3-1 Data Pump Import Interfaces 3-2 Data Pump Import Modes 3-2 Full Import Mode 3-3 Schema Mode 3-3 Table Mode 3-3 Tablespace Mode 3-4 Transportable Tablespace Mode 3-4 Network Considerations 3-4 Filtering During Import Operations 3-5 Data Filters 3-5 Metadata Filters 3-5 vi Parameters Available in Import's Command-Line Mode 3-6 ATTACH 3-8 CLUSTER 3-9 CONTENT 3-10 DATA_OPTIONS 3-10 DIRECTORY 3-11 DUMPFILE 3-12 ENCRYPTION_PASSWORD 3-13 ESTIMATE 3-14 EXCLUDE 3-14 FLASHBACK_SCN 3-16 FLASHBACK_TIME 3-17 FULL 3-18 HELP 3-19 INCLUDE 3-19 JOB_NAME 3-20 LOGFILE 3-21 NETWORK_LINK 3-22 NOLOGFILE 3-23 PARALLEL 3-23 PARFILE 3-24 PARTITION_OPTIONS 3-25 QUERY 3-26 REMAP_DATA 3-27 REMAP_DATAFILE 3-28 REMAP_SCHEMA 3-29 REMAP_TABLE 3-30 REMAP_TABLESPACE 3-31 REUSE_DATAFILES 3-32 SCHEMAS 3-32 SERVICE_NAME 3-33 SKIP_UNUSABLE_INDEXES 3-34 SOURCE_EDITION 3-35 SQLFILE 3-36 STATUS 3-37 STREAMS_CONFIGURATION 3-37 TABLE_EXISTS_ACTION 3-37 TABLES 3-39 TABLESPACES 3-41 TARGET_EDITION 3-41 TRANSFORM 3-42 TRANSPORT_DATAFILES 3-44 TRANSPORT_FULL_CHECK 3-45 TRANSPORT_TABLESPACES 3-46 TRANSPORTABLE 3-47 VERSION 3-48 Commands Available in Import's Interactive-Command Mode 3-49 vii CONTINUE_CLIENT 3-50 EXIT_CLIENT 3-50 HELP 3-50 KILL_JOB 3-51 PARALLEL 3-51 START_JOB 3-51 STATUS 3-52 STOP_JOB 3-52 Examples of Using Data Pump Import 3-53 Performing a Data-Only Table-Mode Import 3-53 Performing a Schema-Mode Import 3-53 Performing a Network-Mode Import 3-54 Syntax Diagrams for Data Pump Import 3-54 4 Data Pump Legacy Mode Parameter Mappings 4-1 Using Original Export Parameters with Data Pump 4-1 Using Original Import Parameters with Data Pump 4-4 Management of File Locations in Data Pump Legacy Mode 4-7 Adjusting Existing Scripts for Data Pump Log Files and Errors 4-9 Log Files 4-9 Error Cases 4-9 Exit Status 4-10 5 Data Pump Performance Data Performance Improvements for Data Pump Export and Import 5-1 Tuning Performance 5-2 Controlling Resource Consumption 5-2 Effects of Compression and Encryption on Performance 5-2 Initialization Parameters That Affect Data Pump Performance 5-3 Setting the Size Of the Buffer Cache In a Streams Environment 5-3 6 The Data Pump API How Does the Client Interface to the Data Pump API Work? 6-1 Job States 6-1 What Are the Basic Steps in Using the Data Pump API? 6-3 Examples of Using the Data Pump API 6-4 Part II SQL*Loader 7 SQL*Loader Concepts SQL*Loader Features 7-1 SQL*Loader Parameters 7-2 SQL*Loader Control File 7-3 Input Data and Datafiles 7-3 Fixed Record Format 7-4 viii Variable Record Format 7-4 Stream Record Format 7-5 Logical Records 7-6 Data Fields 7-6 LOBFILEs and Secondary Datafiles (SDFs) 7-7 Data Conversion and Datatype Specification 7-7 Discarded and Rejected Records 7-8 The Bad File 7-8 SQL*Loader Rejects 7-8 Oracle Database Rejects 7-8 The Discard File 7-8 Log File and Logging Information 7-9 Conventional Path Loads, Direct Path Loads, and External Table Loads 7-9 Conventional Path Loads 7-9 Direct Path Loads 7-9 Parallel Direct Path 7-10 External Table Loads 7-10 Choosing External Tables Versus SQL*Loader 7-10 Behavior Differences Between SQL*Loader and External Tables 7-11 Multiple Primary Input Datafiles 7-11 Syntax and Datatypes 7-11 Byte-Order Marks 7-11 Default Character Sets, Date Masks, and Decimal Separator 7-11 Use of the Backslash Escape Character 7-11 Loading Objects, Collections, and LOBs 7-12 Supported Object Types 7-12 column objects 7-12 row objects 7-12 Supported Collection Types 7-12 Nested Tables 7-12 VARRAYs 7-12 Supported LOB Types 7-13 Partitioned Object Support 7-13 Application Development: Direct Path Load API 7-13 SQL*Loader Case Studies 7-13 Case Study Files 7-14 Running the Case Studies 7-15 Case Study Log Files 7-15 Checking the Results of a Case Study 7-16 8 SQL*Loader Command-Line Reference Invoking SQL*Loader 8-1 Alternative Ways to Specify Parameters 8-2 Command-Line Parameters 8-2 BAD (bad file) 8-2 BINDSIZE (maximum size) 8-2 COLUMNARRAYROWS 8-3 ix CONTROL (control file) 8-3 DATA (datafile) 8-3 DATE_CACHE 8-3 DIRECT (data path) 8-4 DISCARD (file name) 8-4 DISCARDMAX (integer) 8-4 ERRORS (errors to allow) 8-4 EXTERNAL_TABLE 8-5 Restrictions When Using EXTERNAL_TABLE 8-6 FILE (tablespace file to load into) 8-6 LOAD (number of records to load) 8-7 LOG (log file) 8-7 MULTITHREADING 8-7 NO_INDEX_ERRORS 8-7 PARALLEL (parallel load) 8-7 PARFILE (parameter file) 8-7 READSIZE (read buffer size) 8-8 RESUMABLE 8-8 RESUMABLE_NAME 8-9 RESUMABLE_TIMEOUT 8-9 ROWS (rows per commit) 8-9 SILENT (feedback mode) 8-9 SKIP (records to skip) 8-10 SKIP_INDEX_MAINTENANCE 8-10 SKIP_UNUSABLE_INDEXES 8-11 STREAMSIZE 8-11 USERID (username/password) 8-12 Exit Codes for Inspection and Display 8-12 9 SQL*Loader Control File Reference Control File Contents 9-1 Comments in the Control File 9-3 Specifying Command-Line Parameters in the Control File 9-3 OPTIONS Clause 9-3 Specifying File Names and Object Names 9-4 File Names That Conflict with SQL and SQL*Loader Reserved Words 9-4 Specifying SQL Strings 9-4 Operating System Considerations 9-4 Specifying a Complete Path 9-4 Backslash Escape Character 9-4 Nonportable Strings 9-5 Using the Backslash as an Escape Character 9-5 Escape Character Is Sometimes Disallowed 9-5 Identifying XMLType Tables 9-5 Specifying Datafiles 9-6 Examples of INFILE Syntax 9-7 Specifying Multiple Datafiles 9-8 x Identifying Data in the Control File with BEGINDATA 9-8 Specifying Datafile Format and Buffering 9-9 Specifying the Bad File 9-9 Examples of Specifying a Bad File Name 9-10 How Bad Files Are Handled with LOBFILEs and SDFs 9-10 Criteria for Rejected Records 9-10 Specifying the Discard File 9-11 Specifying the Discard File in the Control File 9-11 Specifying the Discard File from the Command Line 9-12 Examples of Specifying a Discard File Name 9-12 Criteria for Discarded Records 9-12 How Discard Files Are Handled with LOBFILEs and SDFs 9-12 Limiting the Number of Discarded Records 9-12 Handling Different Character Encoding Schemes 9-13 Multibyte (Asian) Character Sets 9-13 Unicode Character Sets 9-13 Database Character Sets 9-14 Datafile Character Sets 9-14 Input Character Conversion 9-14 Considerations When Loading Data into VARRAYs or Primary-Key-Based REFs 9-15 CHARACTERSET Parameter 9-15 Control File Character Set 9-16 Character-Length Semantics 9-17 Shift-sensitive Character Data 9-18 Interrupted Loads 9-18 Discontinued Conventional Path Loads 9-19 Discontinued Direct Path Loads 9-19 Load Discontinued Because of Space Errors 9-19 Load Discontinued Because Maximum Number of Errors Exceeded 9-19 Load Discontinued Because of Fatal Errors 9-20 Load Discontinued Because a Ctrl+C Was Issued 9-20 Status of Tables and Indexes After an Interrupted Load 9-20 Using the Log File to Determine Load Status 9-20 Continuing Single-Table Loads 9-20 Assembling Logical Records from Physical Records 9-21 Using CONCATENATE to Assemble Logical Records 9-21 Using CONTINUEIF to Assemble Logical Records 9-21 Loading Logical Records into Tables 9-24 Specifying Table Names 9-24 INTO TABLE Clause 9-24 Table-Specific Loading Method 9-25 Loading Data into Empty Tables 9-25 Loading Data into Nonempty Tables 9-25 Table-Specific OPTIONS Parameter 9-26 Loading Records Based on a Condition 9-27 Using the WHEN Clause with LOBFILEs and SDFs 9-27 Specifying Default Data Delimiters 9-27 [...]... resources: The Oracle Database documentation set, especially: ■ Oracle Database Concepts ■ Oracle Database SQL Language Reference ■ Oracle Database Administrator's Guide ■ Oracle Database PL/SQL Packages and Types Reference Some of the examples in this book use the sample schemas of the seed database, which is installed by default when you install Oracle Database Refer to Oracle Database Sample Schemas... 23-5 Preface This document describes how to use the Oracle Database utilities for data transfer, data maintenance, and database administration The preface contains these topics: ■ Audience ■ Documentation Accessibility ■ Related Documentation ■ Conventions Audience The utilities described in this book are intended for database administrators (DBAs), application programmers, security administrators,... Oracle database, or move data between Oracle databases using the Export and Import utilities (both the original versions and the Data Pump versions) Load data into Oracle tables from operating system files using SQL*Loader, or from external sources using the external tables feature Perform a physical data structure integrity check on an offline database, using the DBVERIFY utility Maintain the internal database. .. DBNEWID Utility? Ramifications of Changing the DBID and DBNAME Considerations for Global Database Names Changing the DBID and DBNAME of a Database Changing the DBID and Database Name Changing Only the Database ID Changing Only the Database Name Troubleshooting DBNEWID 18-1 18-1 18-2 18-2 18-2 18-5 18-5 18-7 xix DBNEWID... the database name (DBNAME) for an operational database, using the DBNEWID utility Extract and manipulate complete representations of the metadata for database objects, using the Metadata API Query and analyze redo log files (through a SQL interface), using the LogMiner utility To use this manual, you need a working knowledge of SQL and of Oracle fundamentals You can find such information in Oracle Database. .. Control Transportable Tablespaces Exporting From a Read-Only Database Using Export and Import to Partition 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 of Export and Import Restrictions... Assistant (EMCA) Configuring Database Control with EMCA Configuring Software Library With EMCA Using an Input File for EMCA Parameters Using EMCA With Oracle Real Application Clusters Specifying the Ports Used by EMCA EMCA Troubleshooting Tips Using EMCA After Changing the Database Listener Port Upgrading Database or Oracle ASM Instances... Statements Returned to V$LOGMNR_CONTENTS 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... User Scenario 2: Using LogMiner to Calculate Table Access Statistics 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 SecureFile LOB Considerations 20 19-33 19-34 19-35 19-36 19-37... Positioning After Enclosure Delimiters 10-38 Fields Terminated by Whitespace 10-39 Fields Terminated by Optional Enclosure Delimiters 10-39 Database Writes on SQL*Loader Direct Path and Conventional Path 12-2 Sample LogMiner Database Configuration 19-3 Decision Tree for Choosing a LogMiner Dictionary 19-6 List of Tables 2–1 3–1 3–2 4–1 4–2 6–1 7–1 8–1 9–1 9–2 9–3 . xxxv What's New in Database Utilities? xxxvii New Features in Oracle Database Utilities 11g Release 2 xxxvii New Features in Oracle Database Utilities 11g Release. Oracle® Database Utilities 11g Release 2 (11.2) E10701-02 August 2009 Oracle Database Utilities, 11g Release 2 (11.2)

Ngày đăng: 17/03/2014, 00:20