Oracle® Database Administrator's Reference
10g Release 1 (10.1) for hp OpenVMS Alpha
Part No. B13738-01
This chapter describes how to configure an Oracle Database 10g installation to optimize its performance. This chapter contains the following sections:
Oracle Database 10g is a highly optimizable software product. Frequent tuning optimizes system performance and prevents bottlenecks. Although this chapter is written from the perspective of single-instance installations, most of the performance tuning tips provided here are also valid when using Oracle Real Application Clusters (RAC).
See Also:Oracle Real Application Clusters Concepts and Administration and Oracle Database Performance Tuning Guide and Reference
Memory contention occurs when processes require more memory than is available. When this occurs, the system pages and swaps processes between memory and disk.
Disk I/O contention is caused by poor memory management, poor distribution of tablespaces and files across disks, or a combination of both factors.
Although the OpenVMS kernel usually allocates CPU resources effectively, many processes compete for CPU cycles, and this can cause contention. If you installed Oracle Database 10g in a multiprocessor environment, then there may be a different level of contention on each CPU.
Contention is also common for Oracle resources such as locks and latches.
A variety of tools are provided for tuning SQL. These tools include the
V$ performance views, the
EXPLAIN PLAN command, the
SQL TRACE facility, the
TKPROF facility, the Autotrace report, and the
See Also:Oracle Database 10g Database Performance Tuning Guide and Reference
Start the memory tuning process by measuring paging and swapping space to determine how much memory is available. After you have determined the memory usage of the system, tune the Oracle buffer cache.
The Oracle buffer manager ensures that the more frequently accessed data is cached longer. If you monitor the buffer manager and tune the buffer cache, then you can have a significant influence on Oracle Database 10g performance. The optimal Oracle Database 10g buffer size for the system depends on the overall system load and the relative priority of Oracle over other applications.
This section contains the following topics:
Try to minimize swapping because it causes significant OpenVMS overhead. To check for swapping, enter the following command:
$ show memory/files
If the system is swapping and you must conserve memory, then:
Avoid running unnecessary system daemon processes or application processes.
Decrease the number of database buffers to free some memory.
Paging may not present as serious a problem as swapping, because an entire program does not have to be stored in memory to run. A small number of page-outs may not noticeably affect the performance of the system.
To detect excessive paging, run measurements during periods of fast response or idle time to compare against measurements from periods of slow response.
Install more memory.
Move some of the work to another system.
Decrease the number of database buffers to free some memory.
The OpenVMS system reads entire operating system blocks from the disk. If the database block size is smaller than the OpenVMS file system buffer size, then I/O bandwidth is inefficient. If you adjust the Oracle Database block size to be a multiple of the operating system block size, then you can increase performance by up to five percent.
The DB_BLOCK_SIZE initialization parameter sets the database block size databasewide. To see the current value of the DB_BLOCK_SIZE parameter, or to create new tablespaces with a different size, enter the
SHOW PARAMETER command in SQL*Plus.
Balance I/O evenly across all available disks to reduce disk access time. For smaller databases and databases that do not use RAID, ensure that different data files and tablespaces are distributed across the available disks.
To monitor disk performance, use the
$Monitor Disk command.
The average value from
$monitor disk/item=queue should not exceed 1.0. If it does or if the MAX value is high, then the system may experience an I/O bottleneck.
Oracle Database is designed to operate with all users and background processes operating at the same priority level. Changing priority levels causes unexpected effects on contention and response times. Oracle Database does not support changing the priority of user and background processes.
For example, if the log writer process (LGWR) gets a low priority, then it is not run frequently enough and LGWR becomes a bottleneck. In contrast, if LGWR has a high priority, then the response time for user processes may be poor.
The System Global Area (SGA) is the Oracle structure that is located in shared memory. It contains static data structures, locks, and data buffers. Sufficient shared memory must be available to each Oracle process to address the entire SGA.
Alternatively, set the
SGA_TARGET initialization parameter to enable Oracle to automatically tune the SGA size.
Exercise caution when setting values for these parameters. When values are set too high, too much of the physical memory is devoted to shared memory, resulting in poor performance.
Oracle Database installations configured with Shared Server require a higher setting for the
SHARED_POOL_SIZE initialization parameter, or a custom configuration that uses the
LARGE_POOL_SIZE initialization parameter. If you installed the database with Oracle Universal Installer, then the value of the
SHARED_POOL_SIZE parameter is set automatically by Oracle Database Configuration Assistant. However, if you created a database manually, then increase the value of the
SHARED_POOL_SIZE parameter in the parameter file by 1 KB for each concurrent user.
You can determine the SGA size in one of the following ways:
Enter the following SQL*Plus command to display the size of the SGA for a running database:
SQL> SHOW SGA
The result is shown in bytes.
Determine the size of the SGA when you start the database instance. The SGA size is displayed next to the heading Total System Global Area.