Translate this Page

 

In This Challenge, We have a Linux 32bit Server (RHEL 4) with 8GB Memory. But we can’t configure the database memory (SGA+PGA) more than 4GB.  To solve this problem then we could configure Very Large Memory (VLM) and Big SGA for Oracle RDBMS with ramfs and Hugepages.

Complete the following procedure to configure VLM on the computer:

1. Log in as a root user:

2. Edit the /etc/rc.local file and add the following entries to it to configure the computer to mount ramfs over the /dev/shm directory, whenever you start the computer:

umount /dev/shm
mount -t ramfs ramfs /dev/shm
chown oracle:dba /dev/shm

In the preceding commands:
- oracle is the owner of Oracle software files.
- dba is the group for Oracle owner account.

3. Restart the server.

4. Log in as a root user.

5. Run the following command to check if the /dev/shm directory is mounted with the ramfs type:

# mount | grep shm
ramfs on /dev/shm type ramfs (rw)

6. Run the following command to check the permissions on the /dev/shm directory:

# ls -ld /dev/shm
drwxr-xr-x 3 oracle dba 0 Jan 13 12:12 /dev/shm

7. Edit the /etc/security/limits.conf file and add the following entries to it to increase the max locked memory limit:

soft          memlock       3145728
hard        memlock       3145728

8. Switch to the oracle user.:

# su – oracle
Password:

9. Run the following command to check the max locked memory limit:
# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 1024
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 143360
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

If not change, You can set the max locked Memory :
# ulimit -l 3145728

10. Complete the following procedure to configure instance parameters for VLM:

- Replace the DB_CACHE_SIZE and DB_xK_CACHE_SIZE parameters with DB_BLOCK_BUFFERS parameter.
- Add the USE_INDIRECT_DATA_BUFFERS=TRUE parameter.
- Configure SGA size according to the SGA requirements.
- Remove SGA_TARGET, if set.
- Remove MEMORY_TARGET / MEMORY_MAX_TARGET parameters if set

11. Start the database instance.

12. Run the following commands to check the memory allocation:

# ls -l /dev/shm
# ipcs -m

13. Run the following command to display the value of Hugepagesize variable:

# grep Hugepagesize /proc/meminfo

14. Complete the following procedure to create a script that computes recommended values for hugepages configuration for the current shared memory segments:

- Create a text file named hugepages_settings.sh.

- Add the following content in the file:

#!/bin/bash
#
# hugepages_settings.sh
#
# Linux bash script to compute values for the
# recommended HugePages/HugeTLB configuration
#
# Note: This script does calculation for all shared memory
# segments available when the script is run, no matter it
# is an Oracle RDBMS shared memory segment or not.
#
# This script is provided by Doc ID 401749.1 from My Oracle Support
# http://support.oracle.com

# Welcome text
echo ”
This script is provided by Doc ID 401749.1 from My Oracle Support
(http://support.oracle.com) where it is intended to compute values for
the recommended HugePages/HugeTLB configuration for the current shared
memory segments. Before proceeding with the execution please make sure
that:
* Oracle Database instance(s) are up and running
* Oracle Database 11g Automatic Memory Management (AMM) is not setup
(See Doc ID 749851.1)
* The shared memory segments can be listed by command:
# ipcs -m

Press Enter to proceed…”

read

# Check for the kernel version
KERN=`uname -r | awk -F. ‘{ printf(“%d.%d\n”,$1,$2); }’`

# Find out the HugePage size
HPG_SZ=`grep Hugepagesize /proc/meminfo | awk ‘{print $2}’`

# Initialize the counter
NUM_PG=0

# Cumulative number of pages required to handle the running shared memory segments
for SEG_BYTES in `ipcs -m | awk ‘{print $5}’ | grep “[0-9][0-9]*”`
do
MIN_PG=`echo “$SEG_BYTES/($HPG_SZ*1024)” | bc -q`
if [ $MIN_PG -gt 0 ]; then
NUM_PG=`echo “$NUM_PG+$MIN_PG+1″ | bc -q`
fi
done

RES_BYTES=`echo “$NUM_PG * $HPG_SZ * 1024″ | bc -q`

# An SGA less than 100MB does not make sense
# Bail out if that is the case
if [ $RES_BYTES -lt 100000000 ]; then
echo “***********”
echo “** ERROR **”
echo “***********”
echo “Sorry! There are not enough total of shared memory segments allocated for
HugePages configuration. HugePages can only be used for shared memory segments
that you can list by command:

# ipcs -m

of a size that can match an Oracle Database SGA. Please make sure that:
* Oracle Database instance is up and running
* Oracle Database 11g Automatic Memory Management (AMM) is not configured”
exit 1
fi

# Finish with results
case $KERN in
’2.4′) HUGETLB_POOL=`echo “$NUM_PG*$HPG_SZ/1024″ | bc -q`;
echo “Recommended setting: vm.hugetlb_pool = $HUGETLB_POOL” ;;
’2.6′) echo “Recommended setting: vm.nr_hugepages = $NUM_PG” ;;
*) echo “Unrecognized kernel version $KERN. Exiting.” ;;
esac

# End

- Run the following command to change the permission of the file:

# chmod +x hugepages_settings.sh

15. Run the hugepages_settings.sh script to compute the values for hugepages configuration:

# ./hugepages_settings.sh
This script is provided by Doc ID 401749.1 from My Oracle Support
(http://support.oracle.com) where it is intended to compute values for
the recommended HugePages/HugeTLB configuration for the current shared
memory segments. Before proceeding with the execution please make sure
that:
* Oracle Database instance(s) are up and running
* Oracle Database 11g Automatic Memory Management (AMM) is not setup
(See Doc ID 749851.1)
* The shared memory segments can be listed by command:
# ipcs -m

Press Enter to proceed…

Recommended setting: vm.nr_hugepages = 583

Note:
Before running this script, ensure that all the applications that need to use hugepages are running.

16. Set the following kernel parameter:

# sysctl -w vm.nr_hugepages=value_displayed_in_step_15
ex :
# sysctl -w vm.nr_hugepages=583

17. To make the value of the parameter available for every time you restart the computer, edit the /etc/sysctl.conf file and add the following entry:

vm.nr_hugepages=value_displayed_in_step_15

18. Run the following command to check the available hugepages:

# grep Huge /proc/meminfo

19. Restart the instance.

20. Run the following command to check the available hugepages (1 or 2 pages free):

# grep Huge /proc/meminfo

Note:
If the setting of the nr_hugepages parameter is not effective, you might need to restart the server.

Restrictions Involved in Implementing VLM
Following are the limitations of running a computer in the VLM mode on Linux x86:
- VLM configurations do not support multiple database block sizes.
- The computer on which Oracle Database is installed must have more than 4 GB of memory.
- Initialization parameters SGA_TARGET or MEMORY_TARGET must be unset before you implement VLM.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

   
© 2012 LevICORP's webnote Suffusion theme by Sayontan Sinha