Skip Headers

Oracle® Database Administrator’s Reference
10g Release 1 (10.1) for UNIX Systems: AIX-Based Systems, hp HP-UX PA-RISC (64-bit), hp Tru64 UNIX, Linux x86, and Solaris Operating System (SPARC)
Part No. B10812-01
  Go To Table Of Contents
Contents
Go To Index
Index

Previous Next  

B Administering Oracle Database on HP-UX

This appendix contains information about administering Oracle Database on HP-UX. It contains the following sections:

HP-UX Shared Memory Segments for an Oracle Instance

When an Oracle Database instance starts, it creates memory segments by dividing the shared memory allocated for creating the Oracle Shared Global Area (SGA) by the value of the HP-UX shmmax kernel parameter. For example, if 64 GB of shared memory is allocated for a single Oracle instance and the value of the shmmax parameter is 1 GB, the Oracle Database creates 64 shared memory segments for that instance.

Performance degradation can occur when an Oracle instance creates multiple shared memory segments. This is because each shared memory segment receives a unique protection key when the Oracle Database creates the instance. There are six protection keys available for shared memory segments on the PA-RISC processor. If your system has more than six shared memory segments, the HP-UX operating system displays protection key faults.Oracle recommends that you set the shmmax parameter value to the amount of available physical memory on the system. Doing this ensures that the entire shared memory for a single Oracle instance is assigned to one shared memory segment and your instance needs only one protection key.To display the list of active shared memory segments on the system, enter the following command:

$ ipcs -m

If Oracle Database creates more than six segments for the instance, increase the value of the shmmax kernel parameter.


See Also:

For more information about the recommended minimum kernel parameter values, see the Oracle Database Installation Guide for UNIX Systems.

HP-UX SCHED_NOAGE Scheduling Policy

On HP-UX, most processes use a time sharing scheduling policy. Time sharing can have detrimental effects on Oracle performance by descheduling an Oracle process during critical operations, for example, when it is holding a latch. HP-UX has a modified scheduling policy, referred to as SCHED_NOAGE, that specifically addresses this issue. Unlike the normal time-sharing policy, a process scheduled using SCHED_NOAGE does not increase or decrease in priority, nor is it preempted.

This feature is suited to online transaction processing (OLTP) environments because OLTP environments can cause competition for critical resources. The use of the SCHED_NOAGE policy with Oracle Database can increase performance by 10 percent or more in OLTP environments.

The SCHED_NOAGE policy provides little or no performance gains in decision support (DSS) environments because there is little resource competition. Because each application and server environment is different, you should test and verify whether your environment benefits from the SCHED_NOAGE policy. When using SCHED_NOAGE, Oracle recommends that you exercise caution in assigning highest priority to Oracle processes. Assigning highest SCHED_NOAGE priority to Oracle processes can exhaust CPU resources on your system, causing other user processes to hang.

Enabling SCHED_NOAGE for Oracle Database

To allow Oracle Database to use the SCHED_NOAGE scheduling policy, the OSDBA group (typically the dba group), must have the RTSCHED and RTPRIO privileges to change the scheduling policy and set the priority level for Oracle processes. To give the dba group these privileges:

  1. Log in as the root user.

  2. Using any text editor, open the /etc/privgroup file, or create it if necessary.

  3. Add or edit the following line, which begins with the name of the OSDBA group, specifying the privileges RTPRIO and RTSCHED that you want to grant to this group every time the system reboots:

    dba RTPRIO RTSCHED
    
    
  4. Save the file and exit from the text editor.

  5. Enter the following command to grant the privileges to the OSDBA group:

    # /usr/sbin/setprivgrp -f /etc/privgroup
    
    
  6. Enter the following command to verify that the privileges are set correctly:

    # /usr/sbin/getprivgrp dba
    
    

Add the HPUX_SCHED_NOAGE parameter to the parameter file for each instance, setting the parameter to an integer value to specify process priority levels. On HP-UX 11i the range is 178 to 255. Lower values represent higher priorities. If the parameter setting is out of range, Oracle Database automatically sets the parameter to a permissible value and continues with the SCHED_NOAGE policy with the new value. It also generates a message in the alert_sid.log file about the new setting. Whenever the highest priority is assigned to Oracle processes, either by the user or by automatic readjustment, Oracle Database generates a message in the alert_sid.log file warning about the possibility of exhaustion of CPU resources on the system. Oracle recommends that you set the parameter to assign the priority level you want for Oracle processes. If the parameter setting is out of range, Oracle10i release 2 (9.2.0.1) sets it to a permissible value. It also generates a message about the new setting in the alert file. You should set the parameter value to achieve the process priority level that you want.


See Also:

For more information about priority policies and priority ranges, see the HP-UX documentation, the rtsched(1) man page, and the rtsched(2) man page.

Lightweight Timer Implementation

Oracle Database on HP-UX systems uses the gethrtime() system call, regardless of the TIMED_STATISTICS initialization parameter setting. The use of this system call enables you to collect run-time statistics at any time while running an Oracle instance. When the TIMED_STATISTICS initialization parameter is set to TRUE, Oracle10i release 1 (9.0.1.0) on HP-UX systems uses the system library call to calculate elapsed time.

This system call can provide a performance improvement of up to 10 percent over an Oracle release not using the gethrtime() system library call when the TIMED_STATISTICS initialization parameter is set to TRUE. In addition, there is no negative impact on the OLTP performance of Oracle Database while using the gethrtime() system call when the TIMED_STATISTICS initialization parameter is set to FALSE.

Asynchronous I/O

The asynchronous I/O pseudo-driver on HP-UX allows Oracle Database to perform I/O to raw disk partitions using an asynchronous method, resulting in less I/O overhead and higher throughput. You can use the asynchronous I/O pseudo-driver on both HP-UX 9000 servers and workstations.

MLOCK Privilege

To allow Oracle Database to execute asynchronous I/O operations, the OSDBA group (dba) must have the MLOCK privilege. To give the dba group the MLOCK privilege:

  1. Log in as the root user.

  2. Using any text editor, open the /etc/privgroup file, or create it if necessary.

  3. Add or edit the following line, which begins with the name of the OSDBA group, specifying the privilege MLOCK:


    Note:

    You must use only one line to specify the privileges for a particular group in this file. If the file already contains a line for the dba group, add the MLOCK privilege on the same line.

    dba RTPRIO RTSCHED MLOCK
    
    
  4. Save the file and exit from the text editor.

  5. Enter the following command to grant the privileges to the OSDBA group:

    # /usr/sbin/setprivgrp -f /etc/privgroup
    
    
  6. Enter the following command to verify that the privileges are set correctly:

    # /usr/sbin/getprivgrp dba
    
    

Implementing Asynchronous I/O

If you want to use asynchronous I/O on HP-UX, you must either use Automatic Storage Management (ASM) or raw partitions for database files. If you choose to use raw partitions, use the System Administrator Management (SAM) utility to configure the asynchronous disk driver into the HP-UX kernel.

To add the asynchronous disk driver and configure the kernel using the SAM utility:

  1. Enter the following command as the root user:

    # sam
    
    
  2. Choose the Kernel Configuration area.

  3. Choose the Drivers area.

  4. Choose the asynchronous disk driver (asyncdsk).

  5. Select Actions>Add Driver to Kernel.

  6. Select List>Configurable Parameters.

  7. Choose the MAX_ASYNC_PORTS parameter.

  8. Select Action>Modify Configurable Parameter.

  9. Specify a new value for the parameter, using the following guidelines, then choose OK.

    The MAX_ASYNC_PORTS parameter is a configurable HP-UX kernel parameter that controls the maximum number of processes that can open the /dev/async file simultaneously.

    The system displays an error when a process tries to open the /dev/async file after the maximum number of processes have opened the file. This error can reduce performance on systems with a large number of shadow processes or many parallel query slaves performing asynchronous I/O. This error is not recorded. To avoid this error, estimate the highest likely number of processes that can access the /dev/async file and set the MAX_ASYNC_PORTS parameter to this value.

  10. Choose Actions>Process a New Kernel.

  11. Select one of the following options, then choose OK:

    • Move Kernel Into Place and Shutdown System/Reboot Now

    • Do Not Move Kernel Into Place: Do Not Shutdown/Reboot Now

    If you choose the second option, the new kernel, vmunix_test, and the system.SAM configuration file used to create it, are both created in the /stand/build directory.

To use the new kernel:

  1. Enter the following command to move the new kernel into place:

    # /usr/sbin/kmupdate
    
    
  2. Enter the following command to reboot the system:

    # /sbin/shutdown -r now
    
    

To enable asynchronous I/O operations using the HP-UX asynchronous device driver:

  1. Log in as the root user.

  2. Enter the following command to create a new device file:

    # /sbin/mknod /dev/async c 101 0x0
    
    
  3. Enter the following command to verify that the /dev/async device file exists and has the major number 101:

    # ls -l /dev/async
    
    

    The output of this command should look similar to the following:

    crw------- 1 oracle   dba     101 0x000000 Oct 28 10:32  /dev/async
    
    
  4. If necessary, give the device file the UNIX owner and permissions consistent with those of the Oracle software owner and OSDBA group.

    If the Oracle software owner is oracle and the OSDBA group is dba, enter the following commands:

    # /usr/bin/chown oracle:dba /dev/async
    # /usr/bin/chmod 660 /dev/async
    
    

Verifying Asynchronous I/O

To verify asynchronous I/O, first verify that the HP-UX asynchronous driver is configured for Oracle Database, then verify that Oracle Database is executing asynchronous I/O through the HP-UX device driver.

Verifying that HP-UX Asynchronous Driver is Configured for Oracle Database

To verify that the HP-UX asynchronous driver is configured properly for Oracle Database:

  1. Start Oracle Database with a few parallel query slave processes.

  2. Start the GlancePlus/UX utility, as follows:

    $ gpm
    
    
  3. In the main window, choose Reports>Process List.

  4. In the Process List window, select one parallel query slave process and choose Reports>Process Open Files.

    The list of files currently opened by the parallel query slave process appears.

  5. In the list of open files, check for the /dev/async file or the 101 0x000000 mode.

    If either is in the list, the /dev/async file has been opened by the parallel query slave process, and the HP-UX asynchronous device driver is configured properly to enable Oracle processes to execute asynchronous I/O. Make a note of the file descriptor number for the /dev/async file.

Verifying that Oracle Database is Using Asynchronous I/O

To verify that Oracle Database is using asynchronous I/O through the HP-UX asynchronous device driver:

  1. Attach the HP-UX tusc utility to the same Oracle parallel query slave that you chose in GlancePlus in the preceding procedure.

  2. Run an I/O bound query in your environment.

  3. Check the pattern of read and write calls in the tusc output.

    For example, enter the following command, where pid is the process ID of a parallel query slave supposed to execute asynchronous I/O:

    $ tusc -p pid > tusc.output
    
    
  4. After running the query, press Ctrl+c to disconnect from the process, then open the tusc.output file.

    The following example shows a sample tusc.output file:

    ( Attached to process 2052: "ora_p000_tpch" [ 64-bit ])
    ................... 
    ........................ 
    [2052] read(9, "80\0\001\013  \b\0\0\0\0\0\0\0\0".., 388) .. = 28 
    [2052] write(9, "\0\0\00e\0\0\0\080\0\001\013 \0".., 48) .. = 48 
    [2052] read(9, "80\0\001\013¢ 18\0\0\0\0\0\0\0\0".., 388) .. = 28 
    [2052] write(9, "\0\0\00e\0\0\0\080\0\001\01bd4\0".., 48) .. = 48 
    

    If the DISK_ASYNCH_IO initialization parameter is not explicitly set to FALSE (set to TRUE by default), the tusc.output file shows a pattern of asynchronous read/write calls of the same file descriptor (9 in the preceding example) back-to-back.

    Map the file descriptor number in the tusc.output file to that used by /dev/async file in GlancePlus. They should match for the particular parallel query slave process. This verifies that I/O through the HP-UX asynchronous driver is asynchronous. With synchronous I/O, or if the DISK_ASYNC_IO initialization parameter is explicitly set to FALSE, you do not see the asynchronous read/write pattern described previously. Instead, you see calls to lseek or pread/pwrite. You also see lots of different file descriptors (the first argument to read/write) instead of just a single file descriptor.

Asynchronous Flag in SGA

Oracle Database on HP-UX uses a non-blocking polling facility provided by the HP-UX asynchronous driver to check the status of I/O operations. This polling is performed by checking a flag that is updated by the asynchronous driver based on the status of the I/O operations submitted. HP-UX requires that this flag be in shared memory.

Oracle Database configures an asynchronous flag in the SGA for each Oracle process. Oracle Database on HP-UX has a true asynchronous I/O mechanism where I/O requests can be issued even though some previously issued I/O operations are not complete. This helps to enhance performance and ensures good scalability of parallel I/O processes.

Before Oracle8i release 8.1.7, Oracle Database was able to execute I/O operations only from shared memory using the HP-UX asynchronous driver. Oracle Database 10g executes I/O operations from both shared memory and process-private regions using the new HP-UX asynchronous driver. However, I/O operations through the asynchronous driver are not asynchronous in nature. This is because Oracle Database must perform a blocking wait to check the status of I/O operations submitted to the asynchronous driver. This causes some Oracle processes, for example the database writer process, to essentially execute synchronous I/O.

Large Memory Allocations and Oracle Database Tuning

Applications running on Oracle Database 10g can use significantly more memory than applications running on earlier Oracle releases. There are two reasons for this:

Persistent Private SQL Areas and Memory

When a user submits a SQL statement, Oracle Database automatically performs the following memory allocation steps:

  1. It checks the shared pool in the Oracle SGA to see if a shared SQL area for an identical statement already exists. If a shared SQL area exists, Oracle uses it to run subsequent new instances of the statement. If a shared SQL area does not exist, Oracle allocates a new shared SQL area in the shared pool for the SQL statement.

  2. Oracle allocates a private SQL area on behalf of the user session.

Private SQL areas contain data such as bind information and runtime memory structures for processed SQL statements. Private SQL areas also contain parsed statements and other statement processing information.

Every user who submits the same SQL statement has a cursor that uses a single shared SQL area. In this way, many private SQL areas can be associated with the same shared SQL area. If a user session is connected through a dedicated server, then private SQL areas are located in the server process PGA. However, if a session is connected through a shared server, part of the private SQL area is kept in the SGA.

The CURSOR_SPACE_FOR_TIME initialization parameter specifies whether a SQL cursor can be deallocated from the library cache to make room for a new SQL statement. When this parameter is set to TRUE, Oracle Database can deallocate a shared SQL area from an Oracle library cache only when all application cursors associated with the SQL statement are closed. Setting the parameter to TRUE also prevents the deallocation of private SQL areas associated with open cursors, making the user’s private SQL area persistent.

Compared to earlier Oracle releases, setting the CURSOR_SPACE_FOR_TIME initialization parameter to TRUE in Oracle Database has the following advantages:

  • It accelerates SQL execution calls, because each active cursor’s SQL area is present in memory and never aged out.

  • It improves application performance, because Oracle Database does not need to verify that a shared SQL area is in the library cache. By retaining private SQL areas between SQL statement executions, it also helps to save cursor allocation and initialization time.

Compared to earlier Oracle releases, setting the CURSOR_SPACE_FOR_TIME initialization parameter to TRUE in Oracle Database has the following disadvantages:

  • It increases the memory requirements of user processes because of an increased memory allocation for the persistent private SQL areas.

  • It significantly increases cursor memory, which leads to larger memory allocations for Oracle Database shadow processes.

If you set the value of CURSOR_SPACE_FOR_TIME parameter to FALSE, you might experience degraded overall SQL execution and performance. Setting the parameter to FALSE can result in rapid deallocation of shared SQL areas from the library cache.

Default Large Virtual Memory Page Size

By default, Oracle Database uses the largest virtual memory page size setting available on HP-UX for allocating process-private memory. It is defined by the value L, largest, and is currently 1 GB on HP-UX 11i. This value is set as one of the LARGE_PAGE_FLAGS options when linking an Oracle executable.

When the virtual memory page size is set to L, HP-UX allocates the available process-private memory to pages of 1 MB, 4 MB, 16 MB and so on, until it reaches the 1 GB limit, or until it reaches the total amount of allocated memory. If you allocate enough memory to the Oracle PGA for the operating system to be able to allocate memory in larger data page size units, then the operating system allocates the maximum page size at once. For example, if you allocate 48 MB for the Oracle PGA, then your system can have either three pages each of 16 MB, or a series of pages in unit sizes with the smaller multiples, for example, four 1 MB pages, three 4 MB pages, and two 16 MB pages. If you allocate 64 MB to the PGA, then the operating system allocates one page of 64 MB, as the data page unit size matches the available memory.

In general, large memory pages yield better application performance by reducing the number of virtual memory translation faults that must be handled by the operating system, freeing more CPU resources for the application. Large pages help to reduce the total number of data pages needed to allocate the process-private memory. This reduction decreases the chances of translation lookaside buffer (TLB) misses at the processor level.

However, if applications are constrained in memory and tend to run a very large number of processes, then this drastic page size increase might lead processes to indicate large memory allocations, followed by an out of memory error. If this happens, you must lower the page size to a value between the D (default) size of 4 KB and the L (largest) size of 1 GB.

With the lowest page size setting (4 KB), CPU utilization can be 20% higher than that with a larger page size setting. With the highest setting of L, the memory utilization can be 50% higher than that with a 4 MB setting. In cases where the system shows memory constraints, Oracle recommends that you set the page size to match the requirements of the particular application, within the constraints of available memory resources.

For example, an application that has problems with the L setting might show reasonable performance with a 4 MB virtual memory page setting.

Tuning Recommendations

To address tuning for the increased memory allocation required for Persistent Private SQL Areas and Large Virtual Memory Page Sizes, Oracle recommends the following:

  • Keep the value of the CURSOR_SPACE_FOR_TIME parameter to TRUE, unless the system indicates library cache misses when running the application. If that happens, the shared pool might be small enough to hold the SQL areas for all concurrent open cursors.

  • Decrease the virtual memory data page size for Oracle Database as necessary. Use the following command to alter the page size setting:

    # /usr/bin/chatr +pd newsize $ORACLE_HOME/bin/oracle
    
    

    In the preceding example, newsize represents the new value of the virtual memory page size.

    Display the new setting using the chatr command, as follows:

    # /usr/bin/chatr $ORACLE_HOME/bin/oracle
    
    

Tuning Oracle Real Application Clusters on HP-UX

The following section provides information about tuning Oracle Real Application Clusters on HP-UX.

Tuning Hyper Messaging Protocol Parameters

Oracle recommends that you review parameters and, for optimal performance, tune them according to HP guidelines. The list of Hyper Messaging Protocol (HMP) parameters that you can tune is available in the skclic.conf file in the /opt/clic/lib/skgxp directory.

To enable Oracle to use HMP and to relink the Oracle binary with HMP, complete the following steps:

  1. Set up the environment on all nodes.

  2. Shut down the database.

  3. Enter the following commands on all nodes:

    $ cd $ORACLE_HOME/rdbms/lib
    $ make -f ins_rdbms.mk ipc_hms ioracle
    
    

CPU_COUNT Initialization Parameter and HP-UX Dynamic Processor Reconfiguration

HP-UX 11i (11.11) supports dynamic runtime reconfiguration of processor sets, Psets, and dynamic reassignment of workload between processor sets by valid users. HP-UX Virtual Partitions (vPars) enable users to configure their systems in multiple logical partitions where each partition is assigned its own set of processors, memory, and I/O resources, and can run a separate instance of the HP-UX operating system. HP-UX Processor Sets integrated with vPars support dynamic processor migration from one virtual partition to another without requiring a reboot of any virtual partition. This helps to provide efficient resource partitioning between applications to minimize interference and guarantees necessary resource allocation to each application running on the HP-UX server.

The Oracle Database CPU_COUNT initialization parameter specifies the number of CPUs available to Oracle Database. Oracle Database 10g on HP-UX 11i (11.11) can dynamically detect changes to the CPU host configuration by periodically querying the operating system. If there are any changes to the number of CPUs in the system, Oracle adjusts the CPU_COUNT parameter to the correct value to reallocate its internal resources. This allows new workloads to take advantage of the newly added processors, and database performance can improve without any changes by the DBA, provided high CPU usage was the cause of the bottleneck.

Some initialization parameter values are calculated based on the CPU_COUNT value at system startup. If changes occur to the number of CPUs after system startup, Oracle does not dynamically update these initialization parameters to account for the new number of CPUs. This might sometimes result in suboptimal database configuration if the new number of CPUs is significantly different from the original. If the number of CPUs on a system increases significantly, the database might not take advantage of on the additional processing power.

If the number of CPUs on the system increases by a small number, for instance from 2 to 4, you do not need to take any action.

If the number of CPUs on the system increases by a large number, for instance from 2 to 32, follow these steps:

  1. Use one of the following methods to set the CPU_COUNT initialization parameter to the new value:

    • If the database uses a server parameter file (spfiledbname.ora), enter the following SQL*Plus command as the SYS user to specify a new value for the parameter:

      SQL> ALTER SYSTEM SET CPU_COUNT=32 SCOPE=SPFILE
      
      
    • If the database uses an initialization parameter file (initsid.ora), edit the file and specify a new value for the parameter.

  2. Restart the database.