Friday, August 2, 2013

Oracle Database Preinstallation – Part 10

Dear Readers,

My name is Franz Devantier, creator of this blog.  I am an Oracle Certified Professional (OCP DBA 11g) Security DBA.  I will be sharing with you the basic duties of an Oracle DBA, and also some of the undocumented, and not so well known tasks. 

I will make a deal with you:  If you refer me to a company that needs database support, from a few hours per week to full time, and I am able to sign a contract with them.
Then I will give you 10% of the monthly contract or deal price every month.  When the contract ends, and we re-sign the contract, I will again give you 10% of the monthly contract price.  This will go on until the company no longer employs or contracts me or my agents to look after their databases.
I can do this, because that 10% is my marketing budget.  When we re-sign the contract, in the future, it may depend on you giving the thumbs up again, and that is worth 10% of the monthly contract price, to be given to you as commission.

Oracle Database Preinstallation – Part 10
Configuring Kernel Parameters for Linux
When you run Oracle Universal Installer (OUI), any kernel parameters that are not set to the minimal requirements, will be noted.  Although it is possible to run the “fixup script” to set the kernel parameters, and then continue with the installation, it is better practice to verify your kernel parameters, before you start the installation with OUI.  The “fixup script”, will be setting the kernel parameters to minimal values, where they were below the minimal values.  Oracle recommends that you should tune and optimize these kernel parameters, to get the most out of your oracle Installation.

Kernel parameters, minimal values
Parameter
Value
File
Semmsl
250
/proc/sys/kernel/sem
Semmns
32000
Semopm
100
Semmni
128
Shmall
2097152
/proc/sys/kernel/shmall
Shmmax
Minimum: 536870912
=> 32-bit Linux Systems
Maximum: A value that is 1 byte less than 4 GB, or 4294967295
Recommended: More than half the physical memory
=> 64-bit Linux Systems
Maximum: A value that is 1 byte less than the physical memory
Recommended: More than half the physical memory
/proc/sys/kernel/shmmax
Shmmni
4096
/proc/sys/kernel/shmmni
file-max
6815744
/proc/sys/fs/file-max
aio-max-nr
1048576
Note: This value limits concurrent outstanding requests and should be set to avoid I/O subsystem failures.
/proc/sys/fs/aio-max-nr
ip_local_port_range
Minimum: 9000
Maximum: 65500
Verifying UDP and TCP Kernel Parameters
/proc/sys/net/ipv4/ip_local_port_range
rmem_default
262144
/proc/sys/net/core/rmem_default
rmem_max
4194304
/proc/sys/net/core/rmem_max
wmem_default
262144
/proc/sys/net/core/wmem_default
wmem_max
1048576
/proc/sys/net/core/wmem_max

When you verify the parameters, keep in mind that the “fixup script”, does not change the value of any of the kernel parameters that are greater than the minimal values.

Displaying and Changing Kernel Parameter Values
The below command will display the semaphore kernel parameter and its values.
$ /sbin/sysctl –a |grep sem
kernel.semmsl = 250
kernel.semmns = 32000
kernel.semopm = 100
kernel.semni = 128

The below command will display the details of the shared memory segments.
$ /sbin/sysctl –a |grep shm
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
kernel.shmmni = 4096

The below command will display the maximum number of file handles
$ /sbin/sysctl –a |file-max
fs.file-max = 98480

The Below command will display a range of port numbers
$  /sbin/sysctl -a | grep ip_local_port_range
net.ipv4.ip_local_port_range = 32768     61000

$ /sbin/sysctl -a | grep rmem_default
net.core.rmem_default = 229376

$ /sbin/sysctl -a | grep rmem_max
net.core.rmem_max = 131071

$ /sbin/sysctl -a | grep wmem_default
net.core.wmem_default = 229376

$ /sbin/sysctl -a | grep wmem_max
net.core.wmem_max = 131071

$ /sbin/sysctl -a | grep aio-max-nr
fs.aio-max-nr = 1048576

Now that you have gathered the information, you can compare it against the table of default values.  If any of the kernel parameters is different from the minimal value, then you can do the following.

Edit the /etc/sysctl.conf file, and you can either add lines that are missing or edit the values of the entries that are there.  For the semaphore parameters, you must specify all four values.  If any of the current values are larger than the minimum value, then you can leave it at the minimum.

Added these entries, in this case:
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576

Because we have added the values to the /etc/sysctl.conf file, they will persist when we restart the operating system.  To change the current value of the kernel parameters:
$ /sbin/sysctl –p
Review the output to make sure that all the values are correct.  If not, then edit /etc/sysctl.conf again, then enter the /sbin/sysctl –p again, until you are happy with the output.

Then to further confirm, you can enter:
$ /sbin/sysctl -a |less

When you are satisfied with the results, and remember we have focussed on Oracle Linux on intel hardware here, then you can either restart the computer, or run the command sysctl –p to make the changes in the /etc/sysctl.conf file available in the active kernel memory.

Franz Devantier,
Need a database health check?
devantierf@gmail.com

Classifieds

No comments:

Post a Comment