Parallel Server   «Prev  Next»

Lesson 4 Using parallel queries on object tables
ObjectiveCreate a parallel query for an object table.

Using Parallel Queries (On object ables)

A new feature of Oracle8i allows you to execute a parallel query on object tables and object-relational tables that contain object type columns. The types of queries supported are the same as those for relational tables. In addition, parallel queries support special features of object types such as methods, constructors, object views, and access to attributes of object types. A prerequisite of parallel execution of a query on an object table is a MAP MEMBER function[1]. A MAP MEMBER function is defined on the object type and used to sort object records quickly. We will look at how to create this kind of function for an object type in the simulation.
In the following simulation, you will create a MAP MEMBER function in an object type. Next, you will create a parallel query for an object table that is based on the object type and MAP MEMBER function you created.

1) Text 1 2) Text 2 3) Text 3 4) Text 4 5) Text 5 6) Text 6 7) Text 7 8) Text 8 9) Text 9 10) Text 10 11) Text 11 12) Text 12 13) Text 13
  1. Let's dive right in! This is the beginning of the object type definition. The object type is called SINGLE_PRODUCT_TYPE and has four attributes. You are now going to begin defining the MAP MEMBER function required by Oracle for parallel execution of queries. Our example uses the function named GETRANK. Type MAP MEMBER FUNCTION GETRANK and press Enter.
  2. Invalid entry
  4. Type MAP MEMBER FUNCTION GETRANK at the 8 prompt and press Enter.
  5. A MAP MEMBER function must have no parameters and return a simple data type, such as DATE, NUMBER, or VARCHAR2. In this example, the function returns a number. Type RETURN NUMBER, and press Enter.
  7. Type RETURN NUMBER, at the 9 prompt and press Enter.
Using Parallel Queries on Object Tables

The following list shows restrictions involving parallel queries of object types:
  1. Parallel queries on nested tables are not supported.
  2. Parallel DML and parallel DDL are not supported with object types.
If the Optimizer determines that the query requires non-parallel execution, no error messages are issued informing you of this choice.
The next lesson covers using the Oracle Performance Manager to monitor global V$views.

Using Parallel Queries on Object Tables - Exercise

Click the Exercise link below to practice creating a query and DML commands for the object table.
Using Parallel Queries on Object Tables - Exercise

[1]Map MEMBER function: A function defined as part of an object type to sort or compare object rows with one another.