Skip to content

Asynchronous IO on HP Unix servers – new oracle dba career





Asynchronous I/O

The asynchronous I/O pseudo-driver on HP-UX enables 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 servers and workstations.

MLOCK Privilege

To permit Oracle Database to process 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:

dba RTPRIO RTSCHED MLOCK

See Also: The HP-UX documentation, the rtsched(1) man page, and

the rtsched(2) man page for more information about priority policies

and priority ranges

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, then add the MLOCK privilege on the same line.

Asynchronous I/O

B-4 Oracle Database Administrator’s Reference

4. Save the file, and quit 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, then you must use one of the

following storage options for database files:

■ Raw devices (partitions or logical volumes)

■ An Automatic Storage Management disk group that uses raw partitions

Before you can implement asynchronous I/O with either storage option, you must 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 by using the SAM

utility:

1. Run the following command as the root user:

# sam

2. Select the Kernel Configuration area.

3. Select the Drivers area.

4. Select the asynchronous disk driver (asyncdsk).

5. Select Actions, and then select Add Driver to Kernel.

6. Select List, and then select Configurable Parameters.

7. Select the MAX_ASYNC_PORTS parameter.

8. Select Action, and then select Modify Configurable Parameter.

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

click 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 message 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. Select Actions, and then select Process a New Kernel.

See Also: Oracle Database Installation Guide for more information

about configuring Automatic Storage Management and raw logical

volumes on HP-UX systems

Asynchronous I/O

Administering Oracle Database on HP-UX B-5

11. Select one of the following options, and then click 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, then 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 restart 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 required, give the device file the operating system 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, then run 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, click Reports and then click Process List.

Asynchronous I/O

B-6 Oracle Database Administrator’s Reference

4. In the Process List window, select one parallel query slave process, select Reports,

and then select Process Open Files.

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

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

If either is in the list, then 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 run 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

selected 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.

You can do this, for example, by entering the following command, where pid is

the process ID of a parallel query slave supposed to process asynchronous I/O:

$ tusc -p pid > tusc.output

4. After running the query, press Ctrl+c to disconnect from the process, and 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), then 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 a number of different file descriptors (the first

argument to read/write) instead of just a single file descriptor.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Post a Comment

You must be logged in to post a comment.