Table of Contents
- List of Figures
- List of Tables
- Title and Copyright Information
- Preface
- Changes in This Release for Oracle Database Data Cartridge Developer's Guide
-
Part I Introduction
- 1 Introduction to Data Cartridges
-
2
Roadmap to Building a Data Cartridge
- 2.1 Data Cartridge Development Process
- 2.2 Installing and Using Data Cartridges
- 2.3 Requirements and Guidelines for Data Cartridge Components
-
2.4
Data Cartridge Deployment
- 2.4.1 Data Cartridge Naming Conventions
- 2.4.2 Cartridge Registration
- 2.4.3 Cartridge Directory Structure and Standards
- 2.4.4 Cartridge Upgrades
- 2.4.5 Import and Export of Cartridge Objects
- 2.4.6 Cartridge Versioning
- 2.4.7 Cartridge Internationalization
- 2.4.8 Cartridge Administration
- 2.4.9 Data Cartridge Development Approach
-
Part II Building Data Cartridges
- 3 Defining Object Types for Data Cartridges
- 4 Implementing Data Cartridges in PL/SQL
-
5
Implementing Data Cartridges in C, C++, and Java
- 5.1 Shared Libraries
- 5.2 External Procedures
- 5.3 How PL/SQL Calls an External Procedure
- 5.4 Configuring Files for External Procedures
- 5.5 Using Callbacks
- 5.6 Common Potential Errors
- 5.7 Debugging External Procedures
- 5.8 Guidelines for Using External Procedures with Data Cartridges
- 5.9 Java Methods
-
6
Working with Unstructured Data Types
- 6.1 Overview of Cartridges and Unstructured Data Types
- 6.2 Using DDL for LOBs
- 6.3 LOB Locators
- 6.4 Emptying LOBs
- 6.5 Using the OCI to Manipulate LOBs
- 6.6 Using DBMS_LOB Package to Manipulate LOBs
- 6.7 LOBs in External Procedures
- 6.8 LOBs and Triggers
- 6.9 Using Open/Close as Bracketing Operations for Efficient Performance
- 7 Using Extensible Indexing
-
8
Building Domain Indexes
- 8.1 Overview of Indextypes and Domain Indexes
-
8.2
ODCIIndex Interface
- 8.2.1 Index Definition Methods
- 8.2.2 Index Maintenance Methods
- 8.2.3 Index Scan Methods
- 8.2.4 Index Metadata Method
- 8.2.5 Transaction Semantics During Index Method Execution
- 8.2.6 Transaction Semantics for Index Definition Routines
- 8.2.7 Consistency Semantics during Index Method Execution
- 8.2.8 Privileges During Index Method Execution
- 8.3 Creating, Dropping, and Commenting Indextypes
- 8.4 Domain Indexes
- 8.5 Object Dependencies, Drop Semantics, and Validation
- 8.6 Indextype, Domain Index, and Operator Privileges
-
8.7
Partitioned Domain Indexes
- 8.7.1 Using Local Domain Index Methods
- 8.7.2 About Partitioned Indexes
- 8.7.3 Creating a Local Domain Index
- 8.7.4 Dropping a Local Domain Index
- 8.7.5 Altering a Local Domain Index
- 8.7.6 Summary of Index States
- 8.7.7 DML Operations with Local Domain Indexes
- 8.7.8 Table Operations that Affect Indexes
- 8.7.9 ODCIIndex Interfaces for Partitioning Domain Indexes
- 8.7.10 Using SQL*Loader for Domain Indexes
- 8.8 Using System Partitioning
- 8.9 Using System-Managed Domain Indexes
- 8.10 Designing System-Managed Domain Indexes
- 8.11 Creating Local Domain Indexes
- 8.12 Maintaining Local Domain Indexes with INSERT, DELETE, and UPDATE
- 8.13 Querying Local Domain Indexes
- 8.14 System Managed Domain Index - Supported Schemes
- 8.15 Restrictions of System-Managed Domain Indexing
- 8.16 Migrating Non-Partitioned Indexes
- 8.17 Migrating Local Partitioned Indexes
-
9
Defining Operators
- 9.1 User-Defined Operators
-
9.2
Operators and Indextypes
-
9.2.1
Operators in the WHERE Clause
- 9.2.1.1 Using Operator Predicates
- 9.2.1.2 Resolving Query Results with the Contains() Operator
- 9.2.1.3 Setting Up an Index Scan
- 9.2.1.4 Execution Model for Index Scan Methods
- 9.2.1.5 Filtering Multiple Table Queries with Contains() Operator
- 9.2.1.6 Invoking Indextrype Routines for the Contains() Operator
- 9.2.2 Using Operators Outside the WHERE Clause
- 9.2.3 Operators that Return Ancillary Data
-
9.2.1
Operators in the WHERE Clause
-
10
Using Extensible Optimizer
- 10.1 Overview of Query Optimization
- 10.2 Defining Statistics, Selectivity, and Cost Functions
- 10.3 Using User-Defined Statistics, Selectivity, and Cost
- 10.4 Predicate Ordering
- 10.5 Dependency Model
-
10.6
Restrictions and Suggestions
- 10.6.1 Distributed Execution
- 10.6.2 System-Managed Storage Tables and ASSOCIATE STATISTICS
- 10.6.3 Aggregate Object-Level Statistics
- 10.6.4 System-Managed Domain Indexing
-
10.6.5
Collecting and Deleting User-Defined Statistics for System-Managed Indexes
- 10.6.5.1 Collecting statistics for a system-managed domain index
- 10.6.5.2 Deleting statistics for a system-managed domain index
- 10.6.5.3 Collecting statistics for all partitions of a local system-managed domain index
- 10.6.5.4 Deleting statistics for all partitions of a local system-managed domain index
- 10.6.5.5 Collecting statistics for partition P2 of a local system-managed domain index
- 10.6.5.6 Deleting statistics for partition P2 of a local system-managed domain index
- 10.6.5.7 Collecting statistics for all subpartitions of a composite partition of a local system-managed domain index
- 10.6.5.8 Deleting statistics for all subpartitions of a composite partition of a local system-managed domain index
- 10.6.5.9 Collecting statistics for a subpartition of a local system-managed domain index
- 10.6.5.10 Deleting statistics for a subpartition of a local system-managed domain index
- 10.6.6 Performance
- 11 Using Cartridge Services
-
12
Using User-Defined Aggregate Functions
- 12.1 Overview of User-Defined Aggregate Functions
- 12.2 Creating a User-Defined Aggregate
- 12.3 Using a User-Defined Aggregate
- 12.4 Evaluating User-Defined Aggregates in Parallel
- 12.5 Handling Large Aggregation Contexts
- 12.6 Using Materialized Views with User-Defined Aggregates
- 12.7 Creating and Using a User-Defined Aggregate Function
-
13
Using Pipelined and Parallel Table Functions
- 13.1 Overview of Table Functions
- 13.2 Table Function Concepts
-
13.3
Pipelined Table Functions
- 13.3.1 Implementation Choices for Pipelined Table Functions
- 13.3.2 Declaring Pipelined Table Functions
- 13.3.3 Implementing the Native PL/SQL Approach
- 13.3.4 Pipelining Between PL/SQL Table Functions
- 13.3.5 Combining PIPE ROW with AUTONOMOUS_TRANSACTION
- 13.3.6 Implementing the Interface Approach
- 13.3.7 Querying Table Functions
- 13.3.8 Performing DML Operations Inside Table Functions
- 13.3.9 Performing DML Operations on Table Functions
- 13.3.10 Handling Exceptions in Table Functions
- 13.4 Parallel Table Functions
- 13.5 Input Data Streaming for Table Functions
- 13.6 Creating Domain Indexes in Parallel
- 13.7 Transient and Generic Types
-
14
Designing Data Cartridges
- 14.1 Choosing the Programming Language
- 14.2 Invoker's Rights
- 14.3 Callouts and LOBs
- 14.4 Saving and Passing State
- 14.5 Designing Indexes
- 14.6 Designing Operators
- 14.7 Designing for the Extensible Optimizer
- 14.8 Designing for Maintenance
- 14.9 Enabling Cartridge Installation
- 14.10 Designing for Portability
-
Part III Scenarios and Examples
-
15
Power Demand Cartridge Example
- 15.1 Feature Requirements
- 15.2 Modeling the Application
- 15.3 Queries and Extensible Indexing
-
15.4
Creating the Domain Index
- 15.4.1 Creating the Schema to Own the Index
- 15.4.2 Creating the Object Types
- 15.4.3 Defining the Object Type Methods
- 15.4.4 Understanding Functions and Operators
- 15.4.5 Creating the Indextype Implementation Methods
-
15.4.6
Defining theType
- 15.4.6.1 ODCIGetInterfaces()
- 15.4.6.2 ODCIIndexCreate()
- 15.4.6.3 ODCIIndexDrop()
- 15.4.6.4 ODCIIndexStart(); Specific Queries
- 15.4.6.5 ODCIIndexStart(); Any Queries
- 15.4.6.6 ODCIIndexFetch()
- 15.4.6.7 ODCIIndexClose()
- 15.4.6.8 ODCIIndexInsert()
- 15.4.6.9 ODCIIndexDelete()
- 15.4.6.10 ODCIIndexUpdate()
- 15.4.6.11 ODCIIndexGetMetadata()
- 15.4.7 Creating the Indextype
-
15.5
Defining Types and Methods for Extensible Optimizing
- 15.5.1 Creating the Statistics Table, PowerCartUserStats
-
15.5.2
Creating the Extensible Optimizer Methods
- 15.5.2.1 Creating the Type Definition
- 15.5.2.2 ODCIGetInterfaces()
- 15.5.2.3 ODCIStatsCollect() Method for PowerDemand_Typ Columns
- 15.5.2.4 ODCIStatsDelete() Method for PowerDemand_Typ Columns
- 15.5.2.5 ODCIStatsCollect() Method for power_idxtype Domain Indexes
- 15.5.2.6 ODCIStatsDelete() Method for power_idxtype Domain Indexes
- 15.5.2.7 ODCIStatsSelectivity() Method for Specific Queries
- 15.5.2.8 ODCIStatsIndexCost() Method for Specific Queries
- 15.5.2.9 ODCIStatsIndexCost() Method for Any Queries
- 15.5.2.10 ODCIStatsFunctionCost() Method
- 15.5.3 Associating the Extensible Optimizer Methods with Database Objects
- 15.5.4 Analyzing the Database Objects
- 15.6 Testing the Domain Index
-
16
PSBTREE: Extensible Indexing Example
- 16.1 About the PSBTREE Example
- 16.2 Design of the Indextype
- 16.3 Implementing Operators
-
16.4
Implementing the ODCIIndex Interfaces
- 16.4.1 Defining an Implementation Type for PSBTREE
- 16.4.2 Creating the Implementation Type Body
-
16.4.3
Defining PL/SQL Routines in the Implementation Body
- 16.4.3.1 Implementing ODCIGetInterfaces() for PBSTREE in PL/SQL
- 16.4.3.2 Implementing ODCIIndexCreate() for PBSTREE in PL/SQL
- 16.4.3.3 Implementing ODCIIndexDrop() for PBSTREE in PL/SQL
- 16.4.3.4 Implementing ODCIIndexAlter() for PSBTREE in PL/SQL
- 16.4.3.5 Implementing ODCIIndexUpdPartMetadata() for PSBTREE in PL/SQL
- 16.4.3.6 Implementing ODCIIndexExchangePartition() for PSBTREE in PL/SQL
-
16.4.4
Registering the C Implementation of the ODCIIndexXXX() Methods
- 16.4.4.1 Registering the Implementation of ODCIIndexInsert()
- 16.4.4.2 Registering the Implementation of ODCIIndexDelete()
- 16.4.4.3 Registering the Implementation of ODCIIndexUpdate()
- 16.4.4.4 Registering the Implementation of ODCIIndexStart()
- 16.4.4.5 Registering the Implementation of ODCIIndexFetch()
- 16.4.4.6 Registering the Implementation of ODCIIndexClose()
- 16.4.5 Defining Additional Structures in C Implementation
-
16.4.6
Defining C Methods in the Implementation Body
- 16.4.6.1 Implementing a Common Error Processing Routine in C
- 16.4.6.2 Implementing ODCIIndexInsert() for PSBTREE in C
- 16.4.6.3 Implementing ODCIIndexDelete() for PSBTREE in C
- 16.4.6.4 Implementing ODCIIndexUpdate() for PSBTree in C
- 16.4.6.5 Implementing ODCIIndexStart() for PSBTREE in C
- 16.4.6.6 Implementing ODCIIndexFetch() for PSBTREE in C
- 16.4.6.7 Implementing ODCIIndexClose() for PSBTREE in C
- 16.4.7 Implementing the Indextype for PSBTREE
- 16.5 Using PSBTREE
- 17 Pipelined Table Functions: Interface Approach Example
-
15
Power Demand Cartridge Example
-
Part IV Reference
- 18 Cartridge Services Using C, C++ and Java
-
19
Extensibility Constants, Types, and Mappings
-
19.1
System Defined Constants
- 19.1.1 ODCIArgDesc.ArgType System Defined Constants
- 19.1.2 ODCIEnv.CallProperty System Defined Constants
- 19.1.3 ODCIIndexAlter System Defined Constants
- 19.1.4 ODCIIndexInfo.Flags System Defined Constants
- 19.1.5 ODCIIPartInfo.PartOp System Defined Constants
- 19.1.6 ODCIIPredInfo.Flags System Defined Constants
- 19.1.7 ODCIFuncInfo.Flags System Defined Constants
- 19.1.8 ODCIQueryInfo.Flags System Defined Constants
- 19.1.9 ODCIStatsOptions.Flags System Defined Constants
- 19.1.10 ODCIStatsOptions.Options System Defined Constants
- 19.1.11 Return Status System Defined Constants
- 19.1.12 ScnFlg System Defined Constants
-
19.2
System-Defined Types
- 19.2.1 ODCIArgDesc
- 19.2.2 ODCIArgDescList
- 19.2.3 ODCIRidList
- 19.2.4 ODCIColInfo
- 19.2.5 ODCIColInfoList
- 19.2.6 ODCICost
- 19.2.7 ODCIEnv
- 19.2.8 ODCIFuncInfo
- 19.2.9 ODCIIndexInfo
- 19.2.10 ODCIIndexCtx
- 19.2.11 ODCIObject
- 19.2.12 ODCIObjectList
- 19.2.13 ODCIPartInfo
- 19.2.14 ODCIPartInfoList
- 19.2.15 ODCIPredInfo
- 19.2.16 ODCIQueryInfo
- 19.2.17 ODCIStatsOptions
- 19.2.18 ODCITabFuncStats
- 19.2.19 ODCITabStats
- 19.2.20 ODCIBFileList
- 19.2.21 ODCITabFuncInfo
- 19.2.22 ODCIDateList
- 19.2.23 ODCINumberList
- 19.2.24 ODCIRawList
- 19.2.25 ODCIVarchar2List
- 19.2.26 ODCIFuncCallInfo
- 19.3 Mappings of Constants and Types
-
19.1
System Defined Constants
-
20
Extensible Indexing Interface
-
20.1
Extensible Indexing - System-Defined Interface Routines
- 20.1.1 ODCIGetInterfaces()
- 20.1.2 ODCIIndexAlter()
- 20.1.3 ODCIIndexClose()
- 20.1.4 ODCIIndexCreate()
- 20.1.5 ODCIIndexDelete()
- 20.1.6 ODCIIndexDrop()
- 20.1.7 ODCIIndexExchangePartition()
- 20.1.8 ODCIIndexFetch()
- 20.1.9 ODCIIndexGetMetadata()
- 20.1.10 ODCIIndexInsert()
- 20.1.11 ODCIIndexStart()
- 20.1.12 ODCIIndexUpdate()
- 20.1.13 ODCIIndexUpdPartMetadata()
- 20.1.14 ODCIIndexUtilCleanup()
- 20.1.15 ODCIIndexUtilGetTableNames()
-
20.1
Extensible Indexing - System-Defined Interface Routines
- 21 Extensible Optimizer Interface
- 22 User-Defined Aggregate Functions Interface
- 23 Pipelined and Parallel Table Functions
- A User-Managed Local Domain Indexes
- Index