DBMS_HS_PARALLEL

The DBMS_HS_PARALLEL PL/SQL package enables parallel processing for heterogeneous targets access. This package is designed to improve performance when retrieving data from a large foreign table.

This chapter discusses the following topics:

Using the DBMS_HS_PARALLEL Subprogram

DBMS_HS_PARALLEL is compiled with the authorization ID of CURRENT_USER, which uses invoker’s rights. In other words, all procedures in this package are executed with the privileges of the calling user.

Summary of DBMS_HS_PARALLEL Subprograms

This table lists the DBMS_HS_PARALLEL subprograms in alphabetic order and briefly describes them.

Table 1 DBMS_HS_PARALLEL Package Subprograms

Subprogram Description
CREATE_OR_REPLACE_VIEW Creates (or replaces) a read-only view to be referenced for retrieving the data from a remote table in parallel.
CREATE_TABLE_TEMPLATE Writes out a CREATE TABLE template based on information gathered from the remote table. You can use the information to add any optimal Oracle CREATE TABLE clauses.
DROP_VIEW Drops the view and internal objects created by the CREATE_OR_REPLACE_VIEW procedure. If the view has not already been created by the CREATE_OR_REPLACE_VIEW procedure, an error message is returned.
LOAD_TABLE Loads the data from a remote table to a local Oracle table in parallel. If the local Oracle table does not already exist, it is created automatically.

CREATE_OR_REPLACE_VIEW Procedure

This procedure creates (or replaces) a read-only view to be referenced for retrieving the data from a remote table in parallel.

Syntax

<a id="d708101e1381"></a><a id="d708101e1385"></a>CREATE_OR_REPLACE_VIEW (remote_table, database_link, oracle_view, parallel_degree)

Parameters

Table 2 CREATE_OR_REPLACE_VIEW Procedure Parameters

Parameters Description
remote_table The name of the remote database table. It is specified as [remote_schema_name.]remote_table_name.
database_link The remote database link name. The call can only be applied to a heterogeneous services database link.
oracle_view The name of the Oracle view. It is specified as [schema_name.]oracle_view_name. The default schema name is the current user. If the oracle_view parameter is not specified, the remote table name will be used as the view name.
parallel_degree The number of parallel processes for the operation is computed based on the range-partition number if applicable, or the number of CPUs. The range of values is 2 to 16.

Usage Notes

ORA-00955: name is already used by an existing object
ORA-01733: virtual column not allowed here
ORA-00942: table or view does not exist
or
ORA-02019: connection description for remote database not found
ORA-12801: error signaled in parallel query server P003

CREATE_TABLE_TEMPLATE Procedure

This procedure writes out a CREATE TABLE template based on information gathered from the remote table. You can use the information to add any optimal Oracle CREATE TABLE clauses.

Syntax

CREATE_TABLE_TEMPLATE (remote_table, database_link, oracle_table, create_table_template_string)

Parameters

Table 3 CREATE_TABLE_TEMPLATE Procedure Parameters

Parameter Description
remote_table The name of the remote database table. It is specified as [remote_schema_name.]remote_table_name.
database_link The remote database link name. The call can only be applied to a heterogeneous services database link.
oracle_table The name of the local Oracle table the data will be loaded into. It is specified as [schema_name.]oracle_table_name. The default schema name is the current user. If the oracle_table parameter is not specified, the remote table name will be used as the local Oracle name.
create_table_template_string Contains the Oracle CREATE TABLE SQL template when the procedure is returned.

DROP_VIEW Procedure

This procedure drops the view and internal objects created by the CREATE_OR_REPLACE_VIEW procedure. If the view has not already been created by the CREATE_OR_REPLACE_VIEW procedure, an error message is returned.

Syntax

DROP_VIEW (oracle_view)

Parameters

Table 4 DROP_VIEW Procedure Parameter

Parameter Description
oracle_view The name of the Oracle view created by the CREATE_OR_REPLACE_VIEW procedure. If the view has not been created by the CREATE_OR_REPLACE_VIEW procedure, an error is returned.

LOAD_TABLE Procedure

This procedure loads the data from a remote table to a local Oracle table in parallel. If the local Oracle table does not already exist, it is created automatically.

Syntax

LOAD_TABLE (remote_table, database_link, oracle_table, truncate, parallel_degree, row_count)

Parameters

Table 5 LOAD_TABLE Procedure Parameters

Parameter Description
remote_table The name of the remote database table. It is specified as [remote_schema_name.]remote_table_name
database_link The remote database link name. The call can only be applied to a heterogeneous services database link.
oracle_table The name of the local Oracle table the data will be loaded into. It is specified as [schema_name.]oracle_table_name. The default schema name is the current user. If the oracle_table parameter is not specified, the remote table name will be used as the local Oracle name.
truncate Determines whether the Oracle table is truncated before the data is loaded. The value is either TRUE or FALSE. The default value is TRUE which means the Oracle table is truncated first. When set to FALSE, the Oracle table will not be truncated before the data is loaded.
parallel_degree The number of parallel processes for the operation is computed based on the range-partition number if applicable, or the number of CPUs. The range of values is 2 to 16.
row_count Contains the number of rows just added with the load table operation.

Usage Notes

ORA-12801: error signaled in parallel query server P003