In some instances, you may want to simultaneously insert, update, or delete data in the OPS system. Oracle
i enables you to do these tasks with the Data Manipulation Language (DML) parallel feature. You must study your individual applications and environment to determine whether using this new feature will optimize your system performance. The following is an example where your applications would benefit from using parallel DML. Lets say that your parallel system has partitioned data along geographic lines to match the ten locations you have. When sales occur in each store, the data from the sales are updated in each store's partition. Your monthly sales account processing handles updates to this data on all the partitions. This means that your batch jobs updates could benefit from parallel DML, in which every partitions, and thus each store's, updates are done concurrently.
Before you use parallel DML, Oracle recommends that you modify these initialization parameters on your OPS:
- Set
PARALLEL_AUTOMATIC_TUNING
to TRUE
. This allows the optimizer to choose the degree of parallelism and other factors to speed up processing.
- Increase
ENQUEUE_RESOURCES
to allow for more space needed for parallel DML.
- Increase
DML_LOCKS
to allow for additional locks used during parallel DML.
In the following diagram, you will see syntax and examples of the parallel insert command, parallel update command, and parallel delete command.
Location 1 |
This command tells Oraclei to consider all transactions following the command for parallel execution. Use this command, or use hints (see below) to enable parallel execution of specific commands.
|
Location 2 |
The table that is modified must be a partitioned table to use parallel execution. The syntax is identical to non-parallel DDL. |
Location 3 |
In general, you should execute only one parallel execution command per transaction - issue a commit between transactions. |
Location 4 |
A parallel UPDATE command uses many more locks than a non-parallel (serial) UPDATE command. |
Location 5 |
This hint tells Oraclei to use parallel execution of the command with a degree of parallelism set to five. There are many other hints you can use to customize parallel execution, but this is the main one. |
Here are some important restrictions that you should consider before using parallel DML:
- Replication does not support parallel DML.
- Triggers are not supported for parallel DML.
- Certain constraints are not allowed for parallel DML: self-referential constraints, delete cascade constraints, and deferred integrity.
- You cannot use parallel DML with object tables, tables with LOB data, index-organized tables, or clustered tables.
The next lesson covers parallel queries for object tables.