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

9i rel 2 db utilites

600 890 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

Cấu trúc

  • Contents

  • List of Examples

  • List of Figures

  • List of Tables

  • Send Us Your Comments

  • Preface

    • Audience

    • Documentation Accessibility

    • Organization

    • Related Documentation

    • Conventions

  • What’s New in Database Utilities?

    • Oracle9i Utilities New Features for Release 9.2

    • Oracle9i Utilities New Features for Release 9.0.1

    • Oracle8i Utilities New Features

  • Part I Export and Import

  • 1 Export

    • What Is the Export Utility?

    • Before Using Export

      • Running catexp.sql or catalog.sql

      • Ensuring Sufficient Disk Space

      • Verifying Access Privileges

    • Invoking Export

      • Command-Line Entries

      • Interactive Export Prompts

      • Parameter Files

      • Invoking Export As SYSDBA

    • Export Modes

      • Table-Level and Partition-Level Export

        • Table-Level Export

        • Partition-Level Export

      • Processing Restrictions

    • Getting Online Help

    • Export Parameters

      • BUFFER

        • Example: Calculating Buffer Size

      • COMPRESS

      • CONSISTENT

      • CONSTRAINTS

      • DIRECT

      • FEEDBACK

      • FILE

      • FILESIZE

      • FLASHBACK_SCN

      • FLASHBACK_TIME

      • FULL

      • GRANTS

      • HELP

      • INDEXES

      • LOG

      • OBJECT_CONSISTENT

      • OWNER

      • PARFILE

      • QUERY

        • Restrictions

      • RECORDLENGTH

      • RESUMABLE

      • RESUMABLE_NAME

      • RESUMABLE_TIMEOUT

      • ROWS

      • STATISTICS

      • TABLES

        • Table Name Restrictions

      • TABLESPACES

      • TRANSPORT_TABLESPACE

      • TRIGGERS

      • TTS_FULL_CHECK

      • USERID (username/password)

      • VOLSIZE

      • Parameter Interactions

    • Example Export Sessions

      • Example Export Session in Full Database Mode

      • Example Export Session in User Mode

      • Example Export Sessions in Table Mode

        • Example 1: DBA Exporting Tables for Two Users

        • Example 2: User Exports Tables That He Owns

        • Example 3: Using Pattern Matching to Export Various Tables

      • Example Export Session Using Partition-Level Export

        • Example 1: Exporting a Table Without Specifying a Partition

        • Example 2: Exporting a Table with a Specified Partition

        • Example 3: Exporting a Composite Partition

    • Using the Interactive Method

      • Restrictions

    • Warning, Error, and Completion Messages

      • Log File

      • Warning Messages

      • Nonrecoverable Error Messages

      • Completion Messages

    • Exit Codes for Inspection and Display

    • Conventional Path Export Versus Direct Path Export

    • Invoking a Direct Path Export

      • Security Considerations for Direct Path Exports

      • Performance Issues for Direct Path Exports

    • Network Considerations

      • Transporting Export Files Across a Network

      • Exporting and Importing with Oracle Net

    • Character Set and Globalization Support Considerations

      • Character Set Conversion

      • Effect of Character Set Sorting Order on Conversions

      • Multibyte Character Sets and Export and Import

    • Instance Affinity and Export

    • Considerations When Exporting Database Objects

      • Exporting Sequences

      • Exporting LONG and LOB Datatypes

      • Exporting Foreign Function Libraries

      • Exporting Offline Bitmapped Tablespaces

      • Exporting Directory Aliases

      • Exporting BFILE Columns and Attributes

      • External Tables

      • Exporting Object Type Definitions

      • Exporting Nested Tables

      • Exporting Advanced Queue (AQ) Tables

      • Exporting Synonyms

        • Possible Export Errors Related to Java Synonyms

      • Support for Fine-Grained Access 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 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 Release 8.0 Export Files from an Oracle9i Database

      • Possible Errors When Using Different Releases and Versions

        • EXP-24

        • EXP-23

        • EXP-37

  • 2 Import

    • What Is the Import Utility?

      • Table Objects: Order of Import

    • Before Using Import

      • Running catexp.sql or catalog.sql

      • Verifying Access Privileges

        • Importing Objects into Your Own Schema

        • Importing Grants

        • Importing Objects into Other Schemas

        • Importing System Objects

    • Importing into Existing Tables

      • Manually Creating Tables Before Importing Data

      • Disabling Referential Constraints

      • Manually Ordering the Import

    • Effect of Schema and Database Triggers on Import Operations

    • Invoking Import

      • Command-Line Entries

      • Interactive Import Prompts

      • Parameter Files

      • Invoking Import As SYSDBA

    • Import Modes

    • Getting Online Help

    • Import Parameters

      • BUFFER

      • CHARSET

      • COMMIT

      • COMPILE

      • CONSTRAINTS

      • DATAFILES

      • DESTROY

      • FEEDBACK

      • FILE

      • FILESIZE

      • FROMUSER

      • FULL

      • GRANTS

      • HELP

      • IGNORE

      • INDEXES

      • INDEXFILE

      • LOG

      • PARFILE

      • RECORDLENGTH

      • RESUMABLE

      • RESUMABLE_NAME

      • RESUMABLE_TIMEOUT

      • ROWS

      • SHOW

      • SKIP_UNUSABLE_INDEXES

      • STATISTICS

      • STREAMS_CONFIGURATION

      • STREAMS_INSTANTIATION

      • TABLES

        • Table Name Restrictions

      • TABLESPACES

      • TOID_NOVALIDATE

      • TOUSER

      • TRANSPORT_TABLESPACE

      • TTS_OWNERS

      • USERID (username/password)

      • VOLSIZE

    • Example Import Sessions

      • Example Import of Selected Tables for a Specific User

      • Example Import of Tables Exported by Another User

      • Example Import of Tables from One User to Another

      • Example Import Session Using Partition-Level Import

        • Example 1: A Partition-Level Import

        • Example 2: A Partition-Level Import of a Composite Partitioned Table

        • Example 3: Repartitioning a Table on a Different Column

      • Example Import of Using Pattern Matching to Import Various Tables

    • Using the Interactive Method

    • Warning, Error, and Completion Messages

      • Log File

      • Warning Messages

      • Nonrecoverable Error Messages

      • Completion Messages

    • Exit Codes for Inspection and Display

    • Error Handling During an Import

      • Row Errors

        • Failed Integrity Constraints

        • Invalid Data

      • Errors Importing Database Objects

        • Object Already Exists

        • Sequences

        • Resource Errors

        • Domain Index Metadata

    • Table-Level and Partition-Level Import

      • Guidelines for Using Table-Level Import

      • Guidelines for Using Partition-Level Import

      • Migrating Data Across Partitions and Tables

    • Controlling Index Creation and Maintenance

      • Delaying Index Creation

      • Index Creation and Maintenance Controls

        • Example of Postponing Index Maintenance

    • Reducing Database Fragmentation

    • Network Considerations

      • Transporting Export Files Across a Network

      • Exporting and Importing with Oracle Net

    • Character Set and Globalization Support Considerations

      • Character Set Conversion

        • User Data

        • Data Definition Language (DDL)

      • Import and Single-Byte Character Sets

      • Import and Multibyte Character Sets

    • Considerations When Importing Database Objects

      • Importing Object Identifiers

      • Importing Existing Object Tables and Tables That Contain Object Types

      • Importing Nested Tables

      • Importing REF Data

      • Importing BFILE Columns and Directory Aliases

      • Importing Foreign Function Libraries

      • Importing Stored Procedures, Functions, and Packages

      • Importing Java Objects

      • Importing External Tables

      • Importing Advanced Queue (AQ) Tables

      • Importing LONG Columns

      • Importing Views

      • Importing Partitioned Tables

      • Support for Fine-Grained Access Control

    • Materialized Views and Snapshots

      • Snapshot Log

      • Snapshots

        • Importing a Snapshot

        • Importing a Snapshot into a Different Schema

    • Transportable Tablespaces

    • Storage Parameters

      • The OPTIMAL Parameter

      • Storage Parameters for OID Indexes and LOB Columns

      • Overriding Storage Parameters

      • The Export COMPRESS Parameter

      • Read-Only Tablespaces

    • Dropping a Tablespace

    • Reorganizing Tablespaces

    • Importing Statistics

    • 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 Export Files from a Previous Oracle Release

      • Using Oracle Version 7 Export Files

        • Check Constraints on DATE Columns

      • Using Oracle Version 6 Export Files

        • User Privileges

        • CHAR Columns

        • Status of Integrity Constraints

        • Length of Default Column Values

      • Using Oracle Version 5 Export Files

      • Restrictions When Using Different Releases and Versions of Export and Import

      • The CHARSET Parameter

  • Part II SQL*Loader

  • 3 SQL*Loader Concepts

    • SQL*Loader Features

    • SQL*Loader Control File

    • Input Data and Datafiles

      • Fixed Record Format

      • Variable Record Format

      • Stream Record Format

      • Logical Records

      • Data Fields

    • LOBFILEs and Secondary Datafiles (SDFs)

    • Data Conversion and Datatype Specification

    • Discarded and Rejected Records

      • The Bad File

        • SQL*Loader Rejects

        • Oracle Rejects

      • The Discard File

    • Log File and Logging Information

    • Conventional Path Loads, Direct Path Loads, and External Table Loads

      • Conventional Path Loads

      • Direct Path Loads

        • Parallel Direct Path

      • External Table Loads

    • Loading Objects, Collections, and LOBs

      • Supported Object Types

        • column-objects

        • row objects

      • Supported Collection Types

        • Nested Tables

        • VARRAYs

      • Supported LOB Types

    • Partitioned Object Support

    • Application Development: Direct Path Load API

  • 4 SQL*Loader Command-Line Reference

    • Invoking SQL*Loader

      • Specifying Parameters in the Control File

    • Command-Line Parameters

      • BAD (bad file)

      • BINDSIZE (maximum size)

      • COLUMNARRAYROWS

      • CONTROL (control file)

      • DATA (datafile)

      • DATE_CACHE

      • DIRECT (data path)

      • DISCARD (filename)

      • DISCARDMAX (integer)

      • ERRORS (errors to allow)

      • EXTERNAL_TABLE

        • Restrictions When Using EXTERNAL_TABLE

      • FILE (file to load into)

      • LOAD (records to load)

      • LOG (log file)

      • MULTITHREADING

      • PARALLEL (parallel load)

      • PARFILE (parameter file)

      • READSIZE (read buffer size)

      • RESUMABLE

      • RESUMABLE_NAME

      • RESUMABLE_TIMEOUT

      • ROWS (rows per commit)

      • SILENT (feedback mode)

      • SKIP (records to skip)

      • SKIP_INDEX_MAINTENANCE

      • SKIP_UNUSABLE_INDEXES

      • STREAMSIZE

      • USERID (username/password)

    • Exit Codes for Inspection and Display

  • 5 SQL*Loader Control File Reference

    • Control File Contents

      • Comments in the Control File

    • Specifying Command-Line Parameters in the Control File

      • OPTIONS Clause

    • Specifying Filenames and Object Names

      • Filenames That Conflict with SQL and SQL*Loader Reserved Words

      • Specifying SQL Strings

      • Operating System Considerations

        • Specifying a Complete Path

        • Backslash Escape Character

        • Nonportable Strings

        • Escaping the Backslash

        • Escape Character Is Sometimes Disallowed

    • Specifying Datafiles

      • Examples of INFILE Syntax

      • Specifying Multiple Datafiles

    • Identifying Data in the Control File with BEGINDATA

    • Specifying Datafile Format and Buffering

    • Specifying the Bad File

      • Examples of Specifying a Bad File Name

      • How Bad Files Are Handled with LOBFILEs and SDFs

      • Criteria for Rejected Records

    • Specifying the Discard File

      • Specifying the Discard File in the Control File

      • Specifying the Discard File from the Command Line

      • Examples of Specifying a Discard File Name

      • Criteria for Discarded Records

      • How Discard Files Are Handled with LOBFILEs and SDFs

      • Limiting the Number of Discarded Records

    • Handling Different Character Encoding Schemes

      • Multibyte (Asian) Character Sets

      • Unicode Character Sets

      • Database Character Sets

      • Datafile Character Sets

      • Input Character Conversion

        • CHARACTERSET Parameter

        • Control File Character Set

        • Character-Length Semantics

    • Interrupted Loads

      • Discontinued Conventional Path Loads

      • Discontinued Direct Path Loads

        • Load Discontinued Because of Space Errors

        • Load Discontinued Because Maximum Number of Errors Exceeded

        • Load Discontinued Because of Fatal Errors

        • Load Discontinued Because a Control+C Was Issued

      • Status of Tables and Indexes After an Interrupted Load

      • Using the Log File to Determine Load Status

      • Continuing Single-Table Loads

    • Assembling Logical Records from Physical Records

      • Using CONCATENATE to Assemble Logical Records

      • Using CONTINUEIF to Assemble Logical Records

    • Loading Logical Records into Tables

      • Specifying Table Names

        • INTO TABLE Clause

      • Table-Specific Loading Method

        • Loading Data into Empty Tables

        • Loading Data into Nonempty Tables

      • Table-Specific OPTIONS Parameter

      • Loading Records Based on a Condition

        • Using the WHEN Clause with LOBFILEs and SDFs

      • Specifying Default Data Delimiters

        • fields_spec

        • termination_spec

        • enclosure_spec

      • Handling Short Records with Missing Data

        • TRAILING NULLCOLS Clause

    • Index Options

      • SORTED INDEXES Clause

      • SINGLEROW Option

    • Benefits of Using Multiple INTO TABLE Clauses

      • Extracting Multiple Logical Records

        • Relative Positioning Based on Delimiters

      • Distinguishing Different Input Record Formats

        • Relative Positioning Based on the POSITION Parameter

      • Distinguishing Different Input Row Object Subtypes

      • Loading Data into Multiple Tables

      • Summary

    • Bind Arrays and Conventional Path Loads

      • Size Requirements for Bind Arrays

      • Performance Implications of Bind Arrays

      • Specifying Number of Rows Versus Size of Bind Array

      • Calculations to Determine Bind Array Size

        • Determining the Size of the Length Indicator

        • Calculating the Size of Field Buffers

      • Minimizing Memory Requirements for Bind Arrays

      • Calculating Bind Array Size for Multiple INTO TABLE Clauses

  • 6 Field List Reference

    • Field List Contents

    • Specifying the Position of a Data Field

      • Using POSITION with Data Containing Tabs

      • Using POSITION with Multiple Table Loads

      • Examples of Using POSITION

    • Specifying Columns and Fields

      • Specifying Filler Fields

      • Specifying the Datatype of a Data Field

    • SQL*Loader Datatypes

      • Nonportable Datatypes

        • INTEGER(n)

        • SMALLINT

        • FLOAT

        • DOUBLE

        • BYTEINT

        • ZONED

        • DECIMAL

        • VARGRAPHIC

        • VARCHAR

        • VARRAW

        • LONG VARRAW

      • Portable Datatypes

        • CHAR

        • Datetime and Interval Datatypes

        • GRAPHIC

        • GRAPHIC EXTERNAL

        • Numeric EXTERNAL

        • RAW

        • VARCHARC

        • VARRAWC

        • Conflicting Native Datatype Field Lengths

        • Field Lengths for Length-Value Datatypes

      • Datatype Conversions

      • Datatype Conversions for Datetime and Interval Datatypes

      • Specifying Delimiters

        • TERMINATED Fields

        • ENCLOSED Fields

        • Delimiter Marks in the Data

        • Maximum Length of Delimited Data

        • Loading Trailing Blanks with Delimiters

      • Conflicting Field Lengths for Character Datatypes

        • Predetermined Size Fields

        • Delimited Fields

        • Date Field Masks

    • Specifying Field Conditions

      • Comparing Fields to BLANKS

      • Comparing Fields to Literals

    • Using the WHEN, NULLIF, and DEFAULTIF Clauses

    • Loading Data Across Different Platforms

    • Byte Ordering

      • Specifying Byte Order

      • Using Byte Order Marks (BOMs)

        • Suppressing Checks for BOMs

    • Loading All-Blank Fields

    • Trimming Whitespace

      • Datatypes for Which Whitespace Can Be Trimmed

      • Field Length Specifications for Datatypes for Which Whitespace Can Be Trimmed

        • Predetermined Size Fields

        • Delimited Fields

      • Relative Positioning of Fields

        • No Start Position Specified for a Field

        • Previous Field Terminated by a Delimiter

        • Previous Field Has Both Enclosure and Termination Delimiters

      • Leading Whitespace

        • Previous Field Terminated by Whitespace

        • Optional Enclosure Delimiters

      • Trailing Whitespace

      • Enclosed Fields

    • Preserving Whitespace

      • PRESERVE BLANKS Option

        • Terminated by Whitespace

    • Applying SQL Operators to Fields

      • Referencing Fields

      • Common Uses of SQL Operators in Field Specifications

      • Combinations of SQL Operators

      • Using SQL Strings with a Date Mask

      • Interpreting Formatted Fields

    • Using SQL*Loader to Generate Data for Input

      • Loading Data Without Files

      • Setting a Column to a Constant Value

        • CONSTANT Parameter

      • Setting a Column to an Expression Value

        • EXPRESSION Parameter

      • Setting a Column to the Datafile Record Number

        • RECNUM Parameter

      • Setting a Column to the Current Date

        • SYSDATE Parameter

      • Setting a Column to a Unique Sequence Number

        • SEQUENCE Parameter

      • Generating Sequence Numbers for Multiple Tables

        • Example: Generating Different Sequence Numbers for Each Insert

  • 7 Loading Objects, LOBs, and Collections

    • Loading Column Objects

      • Loading Column Objects in Stream Record Format

      • Loading Column Objects in Variable Record Format

      • Loading Nested Column Objects

      • Loading Column Objects with a Derived Subtype

      • Specifying Null Values for Objects

        • Specifying Attribute Nulls

        • Specifying Atomic Nulls

      • Loading Column Objects with User-Defined Constructors

    • Loading Object Tables

      • Loading Object Tables with a Subtype

    • Loading REF Columns

      • Real REF Columns

      • Primary Key REF Columns

      • Unscoped REF Columns That Allow Primary Keys

    • Loading LOBs

      • Loading LOB Data from a Primary Datafile

        • LOB Data in Predetermined Size Fields

        • LOB Data in Delimited Fields

        • LOB Data in Length-Value Pair Fields

      • Loading LOB Data from an External LOBFILE (BFILE)

      • Loading LOB Data from LOBFILEs

        • Dynamic Versus Static LOBFILE Specifications

        • Examples of Loading LOB Data from LOBFILEs

        • Considerations When Loading LOBs from LOBFILEs

    • Loading Collections (Nested Tables and VARRAYs)

      • Restrictions in Nested Tables and VARRAYs

      • Secondary Datafiles (SDFs)

    • Dynamic Versus Static SDF Specifications

    • Loading a Parent Table Separately from Its Child Table

      • Memory Issues When Loading VARRAY Columns

  • 8 SQL*Loader Log File Reference

    • Header Information

    • Global Information

    • Table Information

      • Column Information

        • Position

        • Length

        • Delimiter

        • Datatype

    • Datafile Information

    • Table Load Information

    • Summary Statistics

      • Oracle Statistics That Are Logged

        • Information About Single-Partition Loads

        • Statistics for Loading a Table

    • Additional Summary Statistics for Direct Path Loads and Multithreading

    • Log File Created When EXTERNAL_TABLE=GENERATE_ONLY

  • 9 Conventional and Direct Path Loads

    • Data Loading Methods

    • Conventional Path Load

      • Conventional Path Load of a Single Partition

      • When to Use a Conventional Path Load

    • Direct Path Load

      • Data Conversion During Direct Path Loads

      • Direct Path Load of a Partitioned or Subpartitioned Table

      • Direct Path Load of a Single Partition or Subpartition

      • Advantages of a Direct Path Load

      • Restrictions on Using Direct Path Loads

      • Restrictions on a Direct Path Load of a Single Partition

      • When to Use a Direct Path Load

      • Integrity Constraints

      • Field Defaults on the Direct Path

      • Loading into Synonyms

    • Using Direct Path Load

      • Setting Up for Direct Path Loads

      • Specifying a Direct Path Load

      • Building Indexes

        • Improving Performance

        • Temporary Segment Storage Requirements

      • Indexes Left in an Unusable State

      • Using Data Saves to Protect Against Data Loss

        • Using the ROWS Parameter

        • Data Save Versus Commit

      • Data Recovery During Direct Path Loads

        • Media Recovery and Direct Path Loads

        • Instance Recovery and Direct Path Loads

      • Loading LONG Data Fields

        • Loading Data As PIECED

    • Optimizing Performance of Direct Path Loads

      • Preallocating Storage for Faster Loading

      • Presorting Data for Faster Indexing

        • SORTED INDEXES Clause

        • Unsorted Data

        • Multiple-Column Indexes

        • Choosing the Best Sort Order

      • Infrequent Data Saves

      • Minimizing Use of the Redo Log

        • Disabling Archiving

        • Specifying the UNRECOVERABLE Parameter

        • Setting the NOLOG Attribute

      • Specifying the Number of Column Array Rows and Size of Stream Buffers

      • Specifying a Value for the Date Cache

    • Optimizing Direct Path Loads on Multiple-CPU Systems

    • Avoiding Index Maintenance

    • Direct Loads, Integrity Constraints, and Triggers

      • Integrity Constraints

        • Enabled Constraints

        • Disabled Constraints

        • Reenable Constraints

      • Database Insert Triggers

        • Replacing Insert Triggers with Integrity Constraints

        • When Automatic Constraints Cannot Be Used

        • Preparation

        • Using an Update Trigger

        • Duplicating the Effects of Exception Conditions

        • Using a Stored Procedure

      • Permanently Disabled Triggers and Constraints

      • Increasing Performance with Concurrent Conventional Path Loads

    • Parallel Data Loading Models

      • Concurrent Conventional Path Loads

      • Intersegment Concurrency with Direct Path

      • Intrasegment Concurrency with Direct Path

      • Restrictions on Parallel Direct Path Loads

      • Initiating Multiple SQL*Loader Sessions

      • Parameters for Parallel Direct Path Loads

        • Specifying Temporary Segments

      • Enabling Constraints After a Parallel Direct Path Load

      • PRIMARY KEY and UNIQUE KEY Constraints

    • General Performance Improvement Hints

  • 10 SQL*Loader Case Studies

    • The Case Studies

    • Case Study Files

    • Tables Used in the Case Studies

      • Contents of Table emp

      • Contents of Table dept

    • Checking the Results of a Load

    • References and Notes

    • Case Study 1: Loading Variable-Length Data

      • Control File for Case Study 1

      • Running Case Study 1

      • Log File for Case Study 1

    • Case Study 2: Loading Fixed-Format Fields

      • Control File for Case Study 2

      • Datafile for Case Study 2

      • Running Case Study 2

      • Log File for Case Study 2

    • Case Study 3: Loading a Delimited, Free-Format File

      • Control File for Case Study 3

      • Running Case Study 3

      • Log File for Case Study 3

    • Case Study 4: Loading Combined Physical Records

      • Control File for Case Study 4

      • Datafile for Case Study 4

        • Rejected Records

      • Running Case Study 4

      • Log File for Case Study 4

      • Bad File for Case Study 4

    • Case Study 5: Loading Data into Multiple Tables

      • Control File for Case Study 5

      • Datafile for Case Study 5

      • Running Case Study 5

      • Log File for Case Study 5

      • Loaded Tables for Case Study 5

    • Case Study 6: Loading Data Using the Direct Path Load Method

      • Control File for Case Study 6

      • Datafile for Case Study 6

      • Running Case Study 6

      • Log File for Case Study 6

    • Case Study 7: Extracting Data from a Formatted Report

      • Creating a BEFORE INSERT Trigger

      • Control File for Case Study 7

      • Datafile for Case Study 7

      • Running Case Study 7

      • Log File for Case Study 7

    • Case Study 8: Loading Partitioned Tables

      • Control File for Case Study 8

      • Table Creation

      • Datafile for Case Study 8

      • Running Case Study 8

      • Log File for Case Study 8

    • Case Study 9: Loading LOBFILEs (CLOBs)

      • Control File for Case Study 9

      • Datafiles for Case Study 9

      • Running Case Study 9

      • Log File for Case Study 9

    • Case Study 10: Loading REF Fields and VARRAYs

      • Control File for Case Study 10

      • Running Case Study 10

      • Log File for Case Study 10

    • Case Study 11: Loading Data in the Unicode Character Set

      • Control File for Case Study 11

      • Datafile for Case Study 11

      • Running Case Study 11

      • Log File for Case Study 11

      • Loaded Tables for Case Study 11

  • Part III External Tables

  • 11 External Tables Concepts

    • The Access Driver

    • External Table Restrictions

    • Location of Datafiles and Output Files

    • Using External Tables to Load Data

    • Parallel Access to External Tables

    • Performance Hints When Using External Tables

    • Behavior Differences Between SQL*Loader and External Tables

      • Multiple Primary Input Datafiles

      • Syntax and Datatypes

      • Rejected Rows

      • Byte-Order Marks

      • Default Character Sets and Date Masks

  • 12 External Tables Access Parameters

    • access_parameters Clause

    • record_format_info Clause

      • FIXED length

      • VARIABLE size

      • DELIMITED BY

      • CHARACTERSET

      • DATA IS...ENDIAN

      • BYTE ORDER MARK (CHECK | NOCHECK)

      • STRING SIZES ARE IN

      • LOAD WHEN

      • BADFILE | NOBADFILE

      • DISCARDFILE | NODISCARDFILE

      • LOG FILE | NOLOGFILE

      • SKIP

      • READSIZE

      • DATE_CACHE

      • string

      • condition_spec

      • [directory object name:] filename

      • condition

        • range start : range end

    • field_definitions Clause

      • delim_spec

        • Example: External Table with Terminating Delimiters

        • Example: External Table with Enclosure and Terminator Delimiters

        • Example: External Table with Optional Enclosure Delimiters

      • trim_spec

      • MISSING FIELD VALUES ARE NULL

      • field_list

      • pos_spec Clause

        • start

        • *

        • increment

        • end

        • length

      • datatype_spec Clause

        • [UNSIGNED] INTEGER [EXTERNAL] [(len)]

        • DECIMAL [EXTERNAL] and ZONED [EXTERNAL]

        • ORACLE_DATE

        • ORACLE_NUMBER

        • DOUBLE [EXTERNAL]

        • FLOAT [EXTERNAL]

        • RAW

        • CHAR

        • date_format_spec

        • VARCHAR and VARRAW

        • VARCHARC and VARRAWC

      • init_spec Clause

  • Part IV Other Utilities

  • 13 DBVERIFY: Offline Database Verification Utility

    • Using DBVERIFY to Validate Disk Blocks of a Single Datafile

      • Syntax

      • Parameters

      • Command-Line Interface

      • Sample DBVERIFY Output

    • Using DBVERIFY to Validate a Segment

      • Syntax

      • Parameters

      • Command-Line Interface

  • 14 DBNEWID Utility

    • What Is the DBNEWID Utility?

    • Ramifications of Changing the DBID and DBNAME

    • Changing the DBID and DBNAME of a Database

      • Changing the DBID and Database Name

      • Changing Only the Database Name

      • Troubleshooting a DBID Change Operation

      • Troubleshooting a Database Name Change Operation

    • DBNEWID Syntax

      • Parameters

      • Restrictions and Usage Notes

      • Examples of Using DBNEWID

        • Changing Only the DBID

        • Changing the DBID and Database Name

        • Changing Only the Database Name

  • 15 Using the Metadata API

    • Introduction to the Metadata API

      • Previous Methods Used to Extract Metadata

      • Metadata API Components

      • Metadata API Features

      • Internet Computing

    • How Is the Metadata API Implemented?

      • DBMS_METADATA and Security

    • DBMS_METADATA Programmatic Interface

      • Using the DBMS_METADATA.FETCH_XML Procedure

      • Using the DBMS_METADATA.FETCH_DDL Procedure

      • Performance Tips for the Programmatic Interface of the Metadata API

    • DBMS_METADATA Browsing Interface

      • Example: Using the DBMS_METADATA Browsing Interface

    • Metadata API Example

      • mddemo.sql

      • PAYROLL_DEMO Output

  • Part V Appendixes

  • A SQL*Loader Syntax Diagrams

  • B DB2/DXT User Notes

    • Using the DB2 RESUME Option

    • Inclusions for Compatibility

      • LOG Statement

      • WORKDDN Statement

      • SORTDEVT and SORTNUM Statements

      • DISCARD Specification

    • Restrictions

      • FORMAT Statement

      • PART Statement

      • SQL/DS Option

      • DBCS Graphic Strings

    • SQL*Loader Syntax with DB2-Compatible Statements

  • C Backus-Naur Form Syntax

  • Index

Nội dung

Oracle9 i Database Utilities Release 2 (9.2) March 2002 Part No. A96652-01 Oracle9i Database Utilities, Release 2 (9.2) Part No. A96652-01 Copyright © 1996, 2002, Oracle Corporation. All rights reserved. Primary Author: Kathy Rich Contributors: Lee Barton, Ellen Batbouta, Janet Blowney, George Claborn, Jay Davison, William Fisher, Dean Gagne, John Galanes, John Kalogeropoulos, Jonathan Klein, Cindy Lim, Eric Magrath, Brian McCarthy, Ray Pfau, Rich Phillips, Paul Reilly, Mike Sakayeda, Francisco Sanchez, Jim Stenoish 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 Oracle8, 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. iii Contents List of Examples List of Figures List of Tables Send Us Your Comments xxxiii Preface xxxv Audience xxxv Documentation Accessibility xxxvi Organization xxxvi Related Documentation xxxix Conventions xl What’s New in Database Utilities? xliii Oracle9i Utilities New Features for Release 9.2 xliii Oracle9i Utilities New Features for Release 9.0.1 xlv Oracle8i Utilities New Features xlviii 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 iv Command-Line Entries 1-5 Interactive Export Prompts 1-6 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 Processing Restrictions 1-13 Getting Online Help 1-13 Export Parameters 1-13 BUFFER 1-16 Example: Calculating Buffer Size 1-17 COMPRESS 1-17 CONSISTENT 1-18 CONSTRAINTS 1-20 DIRECT 1-20 FEEDBACK 1-20 FILE 1-20 FILESIZE 1-21 FLASHBACK_SCN 1-22 FLASHBACK_TIME 1-22 FULL 1-23 GRANTS 1-23 HELP 1-23 INDEXES 1-23 LOG 1-23 OBJECT_CONSISTENT 1-24 OWNER 1-24 PARFILE 1-24 QUERY 1-24 Restrictions 1-25 RECORDLENGTH 1-26 RESUMABLE 1-26 RESUMABLE_NAME 1-26 v RESUMABLE_TIMEOUT 1-27 ROWS 1-27 STATISTICS 1-27 TABLES 1-28 Table Name Restrictions 1-29 TABLESPACES 1-30 TRANSPORT_TABLESPACE 1-31 TRIGGERS 1-31 TTS_FULL_CHECK 1-31 USERID (username/password) 1-31 VOLSIZE 1-32 Parameter Interactions 1-32 Example Export Sessions 1-32 Example Export Session in Full Database Mode 1-33 Example Export Session in User Mode 1-36 Example Export Sessions in Table Mode 1-38 Example 1: DBA Exporting Tables for Two Users 1-38 Example 2: User Exports Tables That He Owns 1-39 Example 3: Using Pattern Matching to Export Various Tables 1-40 Example Export Session Using Partition-Level Export 1-41 Example 1: Exporting a Table Without Specifying a Partition 1-41 Example 2: Exporting a Table with a Specified Partition 1-41 Example 3: Exporting a Composite Partition 1-42 Using the Interactive Method 1-43 Restrictions 1-48 Warning, Error, and Completion Messages 1-48 Log File 1-48 Warning Messages 1-48 Nonrecoverable Error Messages 1-49 Completion Messages 1-49 Exit Codes for Inspection and Display 1-49 Conventional Path Export Versus Direct Path Export 1-50 Invoking a Direct Path Export 1-52 Security Considerations for Direct Path Exports 1-52 Performance Issues for Direct Path Exports 1-53 vi Network Considerations 1-53 Transporting Export Files Across a Network 1-53 Exporting and Importing with Oracle Net 1-53 Character Set and Globalization Support Considerations 1-54 Character Set Conversion 1-54 Effect of Character Set Sorting Order on Conversions 1-54 Multibyte Character Sets and Export and Import 1-55 Instance Affinity and Export 1-55 Considerations When Exporting Database Objects 1-56 Exporting Sequences 1-56 Exporting LONG and LOB Datatypes 1-56 Exporting Foreign Function Libraries 1-56 Exporting Offline Bitmapped Tablespaces 1-56 Exporting Directory Aliases 1-57 Exporting BFILE Columns and Attributes 1-57 External Tables 1-57 Exporting Object Type Definitions 1-57 Exporting Nested Tables 1-58 Exporting Advanced Queue (AQ) Tables 1-58 Exporting Synonyms 1-58 Possible Export Errors Related to Java Synonyms 1-59 Support for Fine-Grained Access Control 1-59 Transportable Tablespaces 1-59 Exporting from a Read-Only Database 1-60 Using Export and Import to Partition a Database Migration 1-60 Advantages of Partitioning a Migration 1-61 Disadvantages of Partitioning a Migration 1-61 How to Use Export and Import to Partition a Database Migration 1-61 Using Different Releases and Versions of Export 1-61 Restrictions When Using Different Releases and Versions of Export and Import 1-62 Examples of Using Different Releases of Export and Import 1-63 Creating Oracle Release 8.0 Export Files from an Oracle9i Database 1-64 Possible Errors When Using Different Releases and Versions 1-65 EXP-24 1-65 EXP-23 1-65 vii EXP-37 1-65 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 Importing Objects into Your Own Schema 2-6 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-8 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-10 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 viii FROMUSER 2-22 FULL 2-22 GRANTS 2-22 HELP 2-23 IGNORE 2-23 INDEXES 2-24 INDEXFILE 2-24 LOG 2-25 PARFILE 2-25 RECORDLENGTH 2-25 RESUMABLE 2-26 RESUMABLE_NAME 2-26 RESUMABLE_TIMEOUT 2-26 ROWS 2-27 SHOW 2-27 SKIP_UNUSABLE_INDEXES 2-27 STATISTICS 2-27 STREAMS_CONFIGURATION 2-28 STREAMS_INSTANTIATION 2-28 TABLES 2-29 Table Name Restrictions 2-30 TABLESPACES 2-31 TOID_NOVALIDATE 2-31 TOUSER 2-32 TRANSPORT_TABLESPACE 2-33 TTS_OWNERS 2-33 USERID (username/password) 2-33 VOLSIZE 2-34 Example Import Sessions 2-34 Example Import of Selected Tables for a Specific User 2-35 Example Import of Tables Exported by Another User 2-36 Example Import of Tables from One User to Another 2-37 Example Import Session Using Partition-Level Import 2-38 Example 1: A Partition-Level Import 2-38 Example 2: A Partition-Level Import of a Composite Partitioned Table 2-39 ix Example 3: Repartitioning a Table on a Different Column 2-40 Example Import of Using Pattern Matching to Import Various Tables 2-43 Using the Interactive Method 2-44 Warning, Error, and Completion Messages 2-45 Log File 2-46 Warning Messages 2-46 Nonrecoverable Error Messages 2-46 Completion Messages 2-46 Exit Codes for Inspection and Display 2-47 Error Handling During an Import 2-47 Row Errors 2-47 Failed Integrity Constraints 2-48 Invalid Data 2-48 Errors Importing Database Objects 2-48 Object Already Exists 2-48 Sequences 2-49 Resource Errors 2-49 Domain Index Metadata 2-49 Table-Level and Partition-Level Import 2-49 Guidelines for Using Table-Level Import 2-50 Guidelines for Using Partition-Level Import 2-50 Migrating Data Across Partitions and Tables 2-51 Controlling Index Creation and Maintenance 2-52 Delaying Index Creation 2-52 Index Creation and Maintenance Controls 2-52 Example of Postponing Index Maintenance 2-53 Reducing Database Fragmentation 2-53 Network Considerations 2-54 Transporting Export Files Across a Network 2-54 Exporting and Importing with Oracle Net 2-54 Character Set and Globalization Support Considerations 2-54 Character Set Conversion 2-55 User Data 2-55 Data Definition Language (DDL) 2-55 Import and Single-Byte Character Sets 2-55 x Import and Multibyte Character Sets 2-56 Considerations When Importing Database Objects 2-56 Importing Object Identifiers 2-56 Importing Existing Object Tables and Tables That Contain Object Types 2-58 Importing Nested Tables 2-58 Importing REF Data 2-59 Importing BFILE Columns and Directory Aliases 2-59 Importing Foreign Function Libraries 2-60 Importing Stored Procedures, Functions, and Packages 2-60 Importing Java Objects 2-60 Importing External Tables 2-60 Importing Advanced Queue (AQ) Tables 2-61 Importing LONG Columns 2-61 Importing Views 2-61 Importing Partitioned Tables 2-62 Support for Fine-Grained Access Control 2-62 Materialized Views and Snapshots 2-63 Snapshot Log 2-63 Snapshots 2-64 Importing a Snapshot 2-64 Importing a Snapshot into a Different Schema 2-64 Transportable Tablespaces 2-64 Storage Parameters 2-65 The OPTIMAL Parameter 2-66 Storage Parameters for OID Indexes and LOB Columns 2-66 Overriding Storage Parameters 2-66 The Export COMPRESS Parameter 2-66 Read-Only Tablespaces 2-66 Dropping a Tablespace 2-67 Reorganizing Tablespaces 2-67 Importing Statistics 2-68 Using Export and Import to Partition a Database Migration 2-69 Advantages of Partitioning a Migration 2-69 Disadvantages of Partitioning a Migration 2-69 How to Use Export and Import to Partition a Database Migration 2-69 [...]... VARCHARC and VARRAWC init_spec Clause Part IV 12- 12 12- 12 12- 13 12- 14 12- 15 12- 16 12- 18 12- 18 12- 19 12- 19 12- 20 12- 21 12- 22 12- 23 12- 23 12- 23 12- 23 12- 23 12- 24 12- 26 12- 26 12- 26 12- 26 12- 27 12- 27 12- 27 12- 27 12- 28 12- 29 12- 30 12- 31 Other Utilities xxv 13 DBVERIFY: Offline Database Verification Utility Using DBVERIFY to Validate Disk Blocks of a Single Datafile Syntax ... Direct Path Load 9-18 9-19 9-19 9 -20 9 -20 9 -20 9 -20 9 -21 9 -21 9 -22 9 -23 9 -24 9 -25 9 -25 9 -25 9 -25 9 -26 9 -27 9 -27 9 -27 9 -28 9 -28 9 -28 9 -29 9-30 9-30 9-30 9-31 9-31 9-31 9- 32 9- 32 9-33 9-33 9-34 xxi PRIMARY KEY and UNIQUE KEY Constraints 9-35 General Performance Improvement Hints 9-35 10 SQL*Loader Case Studies The Case Studies 10 -2 Case Study Files ... Loading Data into Empty Tables Loading Data into Nonempty Tables xiv 5-14 5-14 5-15 5-15 5-15 5-16 5-16 5-16 5-17 5-17 5-18 5-18 5-19 5-19 5 -21 5 -22 5 -24 5 -24 5 -24 5 -24 5 -25 5 -25 5 -25 5 -26 5 -26 5 -26 5 -27 5 -27 5 -27 5-31 5- 32 5- 32 5- 32 5-33 5-33 Table-Specific OPTIONS Parameter Loading Records Based on a Condition Using the WHEN Clause with LOBFILEs and SDFs Specifying... LOB Data Using Delimited LOBs Loading LOB Data Using Length-Value Pair Specified LOBs 3-5 3-6 3-7 5 -2 5-30 5-30 5-30 5-31 6 -2 6-34 6-34 6-35 6-36 7 -2 7-3 7-4 7-5 7-6 7-7 7-8 7-10 7-11 7- 12 7-13 7-14 7-15 7-16 7-19 7 -20 7 -21 7 -22 7 -23 7 -25 7 -26 7 -26 7 -27 7 24 7 25 7 26 9–1 9 2 Loading a VARRAY and a Nested Table Loading a Parent Table with User-Provided SIDs Loading a Child... DBCS Graphic Strings SQL*Loader Syntax with DB2 -Compatible Statements C B-1 B -2 B -2 B -2 B -2 B-3 B-3 B-3 B-3 B-4 B-4 B-4 Backus-Naur Form Syntax Index xxvii List of Examples 3–1 3 2 3–3 5–1 5 2 5–3 5–4 5–5 6–1 6 2 6–3 6–4 6–5 7–1 7 2 7–3 7–4 7–5 7–6 7–7 7–8 7–9 7–10 7–11 7– 12 7–13 7–14 7–15 7–16 7–17 7–18 7–19 7 20 7 21 7 22 7 23 xxviii Loading Data in Fixed Record Format ... Delimiter Marks in the Data Maximum Length of Delimited Data xvi 6-4 6-5 6-6 6-7 6-7 6-8 6-8 6-9 6-9 6-10 6-10 6-10 6-11 6- 12 6-13 6-14 6-14 6-14 6-15 6-16 6-18 6-19 6-19 6 -20 6 -20 6 -21 6 -21 6 -22 6 -22 6 -23 6 -24 6 -25 6 -25 6 -26 6 -27 Loading Trailing Blanks with Delimiters Conflicting Field Lengths for Character Datatypes Predetermined Size Fields Delimited... 11 Log File for Case Study 11 Loaded Tables for Case Study 11 10 -21 10 -23 10 -24 10 -25 10 -25 10 -26 10 -26 10 -28 10 -28 10 -29 10-31 10-31 10- 32 10-34 10-34 10-35 10-35 10-36 10-37 10-38 10-39 10-40 10-41 10- 42 10-43 10-43 10-45 10-45 10-47 10-48 10-49 10-49 10-50 10- 52 xxiii Part III 11 External Tables External Tables Concepts The Access Driver External... Using Oracle Version 5 Export Files Restrictions When Using Different Releases and Versions of Export and Import The CHARSET Parameter Part II 3 2- 70 2- 70 2- 70 2- 71 2- 71 2- 71 2- 71 2- 71 2- 72 2- 72 2-73 SQL*Loader SQL*Loader Concepts SQL*Loader Features SQL*Loader Control File Input Data and Datafiles Fixed Record Format ... Database Writes on SQL*Loader Direct Path and Conventional Path Using DBMS_METADATA.FETCH_XML() Using DBMS_METADATA.FETCH_DDL() 1 -2 1-51 2- 3 3-3 6-43 6-46 6-47 6-47 6-48 6-48 9-3 15-7 15-9 List of Tables 1–1 1 2 1–3 1–4 1–5 1–6 2 1 2 2 2–3 2 4 4–1 5–1 5 2 5–3 5–4 5–5 5–6 6–1 6 2 6–3 6–4 6–5 6–6 10–1 14–1 15–1 15 2 B–1 C–1 Objects Exported and Imported in Each Mode 1-9 Sequence... xxvi 13 -2 13 -2 13 -2 13-3 13-3 13-4 13-5 13-5 13-6 15 -2 15 -2 15 -2 15-3 15-3 15-4 DBMS_METADATA and Security DBMS_METADATA Programmatic Interface Using the DBMS_METADATA.FETCH_XML Procedure Using the DBMS_METADATA.FETCH_DDL Procedure Performance Tips for the Programmatic Interface of the Metadata API DBMS_METADATA Browsing Interface Example: Using the DBMS_METADATA . 2- 20 DESTROY 2- 20 FEEDBACK 2- 20 FILE 2- 21 FILESIZE 2- 21 viii FROMUSER 2- 22 FULL 2- 22 GRANTS 2- 22 HELP 2- 23 IGNORE 2- 23 INDEXES 2- 24 INDEXFILE 2- 24 LOG 2- 25 PARFILE 2- 25 RECORDLENGTH 2- 25 RESUMABLE 2- 26 RESUMABLE_NAME. 2- 26 RESUMABLE_NAME 2- 26 RESUMABLE_TIMEOUT 2- 26 ROWS 2- 27 SHOW 2- 27 SKIP_UNUSABLE_INDEXES 2- 27 STATISTICS 2- 27 STREAMS_CONFIGURATION 2- 28 STREAMS_INSTANTIATION 2- 28 TABLES 2- 29 Table Name Restrictions 2- 30 TABLESPACES. 1 -20 DIRECT 1 -20 FEEDBACK 1 -20 FILE 1 -20 FILESIZE 1 -21 FLASHBACK_SCN 1 -22 FLASHBACK_TIME 1 -22 FULL 1 -23 GRANTS 1 -23 HELP 1 -23 INDEXES 1 -23 LOG 1 -23 OBJECT_CONSISTENT 1 -24 OWNER 1 -24 PARFILE 1 -24 QUERY

Ngày đăng: 18/04/2014, 10:23

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w