Oracle8 Parallel Server Concepts & Administration Release 8.0 A58238-01 |
|
To reduce contention for shared resources and gain maximum performance from the parallel server, you must ensure that the Integrated Distributed Lock Manager (Integrated DLM, or IDLM) is adequately configured for all the locks and resources your system requires. This chapter covers the following topics:
See Also: Chapter 10, "Non-PCM Instance Locks", for a conceptual overview.
Planning PCM locks alone is not sufficient to manage locks on your system. Besides explicitly allocating parallel cache management locks, you must actively ensure that the Integrated DLM is adequately configured, on each node, for all the required PCM and non-PCM locks and resources. Bear in mind that larger databases and higher degree of parallelism require increased demand for many resources.
Many different types of non-PCM lock exist, and each is handled differently. Although you cannot directly adjust their number, you can estimate the overall number of non-PCM resources and locks required, and adjust the LM_* or GC_* initialization parameters (or both) to guarantee adequate space. You also have the option of minimizing table locks to optimize performance.
Carefully plan and configure an appropriate number of resources and locks to be managed by the Integrated DLM. You allocate these locks and resources using the initialization parameters LM_LOCKS and LM_RESS. Although additional locks and resources can be allocated dynamically, this should be avoided.
If the number of locks or resources required becomes greater than the amount you have statically allocated, then the additional locks or resources will be allocated from the SGA shared pool. This feature prevents the instance from stopping.
When dynamic allocation occurs, a message is written to the alert file indicating that you should recompute and adjust the initialization parameters for the next time the database is started. Since performance and memory usage may be adversely affected by dynamic allocation, it is highly recommended that you correctly compute your lock and resource needs.
Use the following approach to carefully plan IDLM capacity, on a per node basis, for the total number of PCM and non-PCM resources and locks needed.
In case of failover, you need to have enough resources configured on the remaining instances so that the system can continue to operate. Thus if resources are divided over 10 instances and 5 instances were to fail, you would still want the system to be able to run on the remaining 5 instances. This means that you should allow some leeway in the system by accounting for overhead and setting large enough values for the Oracle initialization parameters determining IDLM locks and resources for each instance.
The V$RESOURCE_LIMIT view provides information about global resource utilization for some of the system resources. Using this view you can monitor the current and the maximum resource utilization, and be forewarned if the values approach the limit. With this information you can make better decisions when choosing values for resource limit-controlling parameters.
Use the following worksheet to analyze your system resources.
PQ Overhead = 7 + (MAXINSTANCES * PARALLEL_MAX_SERVERS) + PARALLEL_MAX_SERVERS + MAXINSTANCES
Note: The worksheet incorporates a standard overhead value of 200 for each instance.
Table 16-2 shows sample values for a system with four instances, and with PARALLEL_MAX_SERVERS set to 8 for instances 1 and 3, and set to 4 for instances 2 and 4. The buffer cache size is assumed to be 10K.
Use the following worksheet to analyze your system's lock needs.
Note: The worksheet incorporates a standard overhead value of 200 for each instance.
Table 16-4 shows sample values for a system with four instances, again assuming that PARALLEL_MAX_SERVERS is set to 8 for instances 1 and 3, and set to 4 for instances 2 and 4. The buffer cache size is assumed to be 10K.
Another way to ensure that your system has enough space for the required non-PCM locks and resources is to adjust the values of the following Oracle initialization parameters:
Begin by experimenting with these values in the worksheets supplied in this chapter. You could artificially inflate parameter values in the worksheets, in order to see the IDLM ramifications of providing extra room for failover.
Do not, however, specify actual parameter values considerably greater than needed for each instance. Setting these parameters unnecessarily high entails overhead in a parallel server environment.
This section describes two strategies for improving performance by minimizing table locks:
Obtaining table locks (DML locks) for inserts, deletes, and updates can hurt performance in a parallel server environment. Locking a table in a parallel server is very undesirable because all instances holding locks on the table must release those locks. Consider disabling these locks entirely.
Note: If you use either of these strategies you cannot perform DDL commands against either the instance or the table.
Table locks are set with the initialization parameter DML_LOCKS. If the DROP TABLE, CREATE INDEX, and LOCK TABLE commands are not needed, set DML_LOCKS to zero in order to minimize lock conversions and gain maximum performance.
Note: If DML_LOCKS is set to zero on one instance, it must be set to zero on all instances. With other values, this parameter need not be identical on all instances.
To prevent any user from acquiring a table lock, you can use the following command:
ALTER TABLE table_name DISABLE TABLE LOCK
Any user attempting to lock a table when its table lock is disabled will receive an error.
To re-enable table locking, the following command is used:
ALTER TABLE table_name ENABLE TABLE LOCK
The above command waits until all currently executing transactions commit before enabling the table lock. Note that the command does not need to wait for new transactions which start after the enable command was issued.
To determine whether a table has its table lock enabled or disabled, you can query the column TABLE_LOCK in the data dictionary table USER_TABLES. If you have select privilege on DBA_TABLES or ALL_TABLES, you can query the table lock state of other users tables.