Orarun package

From MicroFocusInternationalWiki
Jump to: navigation, search

The orarun package is a rpm software package provided as part of SUSE Linux Enterprise Server (SLES). The purpose of the orarun package is to simplify the installation and administration of Oracle software products. Use of the orarun package is not required to install or run Oracle products, but it is recommended as the package automates some of the manual steps involved in installing Oracle software on SLES. This Cool Solutions wiki page will describe in detail the features and contents of the orarun package.

Availability

The orarun package is available in SLES media. Select pattern "Oracle Server Base" in SLES11 & SLES12 to install orarun package.

Features

The orarun package has the following features:

  1. It creates the oracle user and the dba and osinstall groups.
  2. It creates all 255 raw devices (SLES9).
  3. It modifies the security settings for the oracle user.
  4. It provides an profile script that sets Oracle specific environmental variables and ulimits.
  5. It provides an init script that sets kernel tunables to recommended values and starts various Oracle related services.
  6. On the i386 platform it provides the libInternalSymbols library.

Components

The orarun package has the following major components

  1. The /etc/init.d/oracle init script.
  2. The /etc/sysconfig/oracle configuration file
  3. The /etc/profile.d/oracle.[c]sh profile script

The /etc/sysconfig/oracle configuration file

The /etc/sysocnfig/oracle configuration file contains settings used but the /etc/init.d/oracle init script and the /etc/profile.d/oracle.[c]sh script. This provides one easy place to control all of the settings for a typical Oracle deployment. This file can be edited using a standard editor or via the YaST->System->/etc/sysconfig Editor module. The following table lists the variables, default values, and purpose for the /etc/sysconfig/oracle file.

VariableDefault valuePurpose
ORACLE_OWNERoracleThe user who will used to install the Oracle software
ORACLE_BASE/opt/oracleThe base directory for all Oracle software
START_ORACLE_DBnoControls whether the Oracle databases that are listed in /etc/oratab are stated.
START_ORACLE_DB_LISTENERnoControls whether the database listeners are started.
START_ORACLE_DB_AGENTnoControls whether the database intelligent agent is started.
START_ORACLE_DB_APACHEnoControls whether Apache web server packaged with Oracle is started.
START_ORACLE_DB_APACHE_USE_SSLnoControls if the Oracle Apache web server uses SSL.
START_ORACLE_DB_EMANAGERnoControls whether the Enterprise Manager agent is started.
START_ORACLE_DB_ISQLPLUSnoControls whether iSQL PLus is started.
START_ORACLE_DB_OIDnoControls whether Oracle Internet Directory is started.
START_ORACLE_RAC_OCFSnoControls whether OCFS is started (not OCFS2).
START_ORACLE_RAC_OCMnoControls whether the Oracle9i cluster monitor is started.
ORACLE_RAC_OCM_PARAMETERSThe values to be passed to Oracle9i cluster monitor.
START_ORACLE_RAC_GSDnoControls whether the Oracle9i Global Service Daemon is started.
START_ORACLE_AS_CONSOLEnoControls whether the Application Server console is started.
SET_ORACLE_KERNEL_PARAMETERSyesControls whether the /etc/init.d/oracle script sets the kernel parameters.
SHMMAX8589934592Maximum size of an shared memory segment. Oracle recommends this be set to half of the amount of available memory. This value is put into /proc/sys/kernel/shmmax.
SHMMNI4096Maximum number of shared memory segments sytem wide. This value is put into /proc/sys/kernel/shmmni.
SHMALL2097152Maxium number of shared memory pages system wide. This value is put into /proc/sys/kernel/shmall.
SEMMSL1250Maximum number of semaphores per id. Set to 10 plus the largest PROCESSES parameter of any Oracle database on the system (see init.ora). Maximum value possible is 8000. This value is put into /proc/sys/kernel/sem.
SEMMNS32000Maximum number of semaphores system wide. Set to the sum of the PROCESSES parameter for each Oracle database, adding the largest one twice, then add an additional 10 for each database (see init.ora). Max. value possible is INT_MAX (largest INTEGER value on this architecture, on 32-bit systems: 2147483647). This value is put into /proc/sys/kernel/sem.
SEMOPM100Maximum number of operations per semop call. Oracle recommends 100. This value is put into /proc/sys/kernel/sem.
SEMMNI256Maximum number of semaphore identifies. Oracle recommends at least 100. This value is put into /proc/sys/kernel/sem.
IP_PORT_LOCAL_RANGE1024 65000The range of local ports available to UDP and TCP. This value is put into /proc/sys/net/ipv4/ip_local_port_range.
RMEM_MAX262144The maximum memory size for a recieve window. Requirement for RAC environments. This value is put into /proc/sys/net/core/rmem_max
RMEM_DEFAULT262144The default memory size for a recieve window. Requirement for RAC environments. This value is put into /proc/sys/net/core/rmem_default
WMEM_MAX262144The maximum memory size for a send window. Requirement for RAC environments. This value is put into /proc/sys/net/core/wmem_max
WMEM_DEFAULT262144The default memory size for a send window. Requirement for RAC environments. This value is put into /proc/sys/net/core/wmem_default
FILE_MAX_KERNEL131072The global setting for the maximum number of open files allowed by the kernel. This value is put into /proc/sys/fs/file-max.
FILE_MAX_SHELL65536The maximum amount of open file descriptors. This value is used by the /etc/profile.d/oracle.[c]sh script.
PROCESSES_MAX_SHELL16384The maxiumu number of processes a shell can have. This value is used by the /etc/profile.d/oracle.[c]sh script.
MAX_CORE_FILE_SIZE_SHELLunlimitedThis is the maximum allowed size of a core file. This value is used by the /etc/profile.d/oracle.[c]sh script.
VM_MAPPED_RATIO100This will adjust the swappiness of the kernel. A higher value means that the kernel will be less likely to swap pages to disk. Maximum is 10000. This value is put into /proc/sys/vm/mapped_ratio.
AIO_MAX_SIZE226144This is the maximum size of a asynchronous IO. Maximum value is 512K. Values larger than 256K generally do not have any affect as the IO is split up by the device driver. This value is put into /proc/sys/fs/aio-max-size
NR_HUGE_PAGES0For i386 systems that require a SGA larger than 2.7GB, it is necessary to set this parameter and use a hugetlbfs filesystem.
SHM_GROUPdbaThis is the group that will be able to allocate shared memory segments. The gid of the group in this parameter will be put into /proc/sys/vm/hugetlb_shm_group.

Table 2 -- Variables defined in the /etc/sysconfig/oracle file

The /etc/init.d/oracle init script

The /etc/init.d/oracle script is a standard SuSE init script that will be run on system boot. It will read the /etc/sysconfig/oracle file, and set the kernel parameters and start any of the desired services. If the orarun package is installed, the /etc/init.d/oracle script will be configured to run at boot for run levels 3 and 5 by default. The script will respond to the standard set of init commands (start, stop, restart status), and can be managed using the standard set of tools for managing init scripts such as insserv and chkconfig.

To stop the script from being run at boot up, the insserv command can be used:

   # insserv -r /etc/init.d/oracle

The /etc/profile.d/oracle.[c]sh profile script

The orarun package provides two different profile scripts in the /etc/profile.d directory, oracle.sh and oracle.csh. Both scripts are roughly identical in terms of functionality, but are written for the bash shell and the C shell respectively. The purpose of the scripts is to (un)set environmental variables and ulimit values as needed for starting an Oracle instance. Because the script is in the /etc/profile.d directory it is sourced every time a shell is started.

Environment changes made for all users

The scripts sets the following environmental variables for all users:

VariableDefault value
ORACLE_BASE/opt/oracle
ORACLE_HOME$ORACLE_BASE/product/10.2/db_1
ORACLE_SIDorcl

Table 3 -- Environmental variables set for all users

Environment changes made for the oracle user

If the shell belongs to the oracle user the scripts also sets the following environmental variables:

VariableDefault value
AGENT_HOME$ORACLE_BASE/product/10.2/agent
TNS_ADMIN$ORACLE_HOME/network/admin
ORA_NLS33 (9i)$ORACLE_HOME/ocommon/nls/admin/data
ORA_NLS10 (10g)$ORACLE_HOME/nls/data
PATH$PATH:$ORACLE_HOME/bin
LD_LIBRARY_PATH$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib
CLASSPATH$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib

Table 4 -- Environmental variables set for the oracle user

In addition to the environmental variables above, the scripts set the following ulimits:

  1. ulimit -c to MAX_CORE_FILE_SIZE_SHELL or 0 if MAX_CORE_FILE_SIZE_SHELL is unset
  2. ulimit -u to PROCESSES_MAX_SHELL or 16384 if PROCESSES_MAX_SHELL is unset
  3. ulimit -n to FILE_MAX_SHELL or 65536 if FILE_MAX_SHELL is unset

The value of each of the environmental variables is set in the /etc/sysconfig/oracle configuration file.

Due to some conflicts with the Oracle9i GSD cluster components, the scripts unset the JAVA_BINDIR and JAVA_HOME environmental variables which can be set in cases were a SLES JRE or JDK package has been installed.

In order to install Oracle9i, libraries from the 2.95 version of the GCC compiler need to be linked in at compile time. For SLES9, the GCC 2.95 compiler is provided by the gcc_old package. The scripts will also check for the existence of the GCC 2.95 compiler from the gcc_old package, and if it exists it will update the PATH environmental variable to include that compiler first.

Finally, the scripts will check for the existence of the libInternalSymbols library, which should be installed by the orarun package on i386 systems. If it exists it will set the LD_PRELOAD environmental variable to /usr/lib/libInternalSymbols.so.

Installation

At a high level, the installation of the orarun package consists of five steps:

  1. Install the orarun package.
  2. Set the shell and password for the oracle user.
  3. Set the value of the SHMMAX parameter in the /etc/sysconfig/oracle configuration file.
  4. Set the ORACLE_HOME and ORACLE_SID environmental variable parameters in the /etc/profile.d/oracle.[c]sh script.
  5. Run the /etc/init.d/oracle script.

There are several equivalent ways each of these steps could be performed. A more detailed description of each step follows.

Installing the package

The orarun package can be installed using any of the same methods used to install other software distributed with SLES. This includes during the installation process, as part of the software selection of an autoyast installation, and after installation using the YaST Software->Software Management module. Within the Package Manager screen enter orarun into the Search text field and hit Enter. In the package list frame select the orarun package for installation, then click on the Accept button.

Figure 1 -- Using the Package Manager to install the orarun package

In SLES10 (& later versions) you can also select Patterns from the Filter drop down list and select Oracle Server Base.

You may also download the orarun package to a local directory and, while logged in as the root user, use the rpm or yast commands to install the package as follows:

   # rpm -ivh /path/to/orarun/orarun-1.9-21.i586.rpm

or

   # yast -i /path/to/orarun/orarun-1.9-21.i586.rpm

Setting the shell and password for the oracle user

When the orarun package is install, the oracle user is created. For security, by default the oracle user's shell is set to /bin/false and there is no password. In order to login as the oracle user this will need to be changed.

This can be done using the YaST Security and Users->User Management module. From the User and Group Administration screen, select 'System users' from the 'Set Filter' drop down list. Select the oracle user from the list of users and click the 'Edit' button.

Figure 2 -- Selecting the oracle user

Figure 2 -- Selecting the oracle user

Enter the desired password into the Password and Confirm Password fields. Clear the Disable User Login check box.

Figure 3 -- Setting the oracle user's password

Figure 3 -- Setting the oracle user's password

Click on the Details tab. Choose the desired shell for the oracle user from the Login Shell drop down list. Click on the Accept button and then the Finish button to exit the module.

Figure 4 -- Setting the oracle user's shell

Figure 4 -- Setting the oracle user's shell

You can also make the changes using the command line. As the root user, edit the /etc/passwd file to set the shell for the oracle user. For example change the line:

   oracle:x:1001:1000::/opt/oracle:/bin/false

to

   oracle:x:1001:1000::/opt/oracle:/bin/bash

To set the password for the oracle user, run the passwd command as the root user as follow

   # passwd oracle

entering in the desired password when prompted.

By default, the oracle user's home directory is set to /opt/oracle. If an alternative home directory is desired, change the value for the home directory using the YaST Security and Users->User Management module or by editing the /etc/passwd file.

Setting the value of SHHMAX

By default the orarun package sets the value of the shmmax kernel tunable to aproximately 3GB. Depending on the environment, this value probably needs to be changed. Oracle recommends setting this value to be 1/2 the size of physical memory. I.e. for a system with 2GB of physical memory Oracle recommends setting the value of SHMMAX to 1GB. SHMMAX is also commonly set to be bigger than the size of the SGA of any database instance running on the machine. This allows the entire SGA to be allocated in one shared memory segment. Since SHMMAX is the maximum size of a shared memory segment it is generally OK to set it value higher than necessary, as a smaller memory segment can always be allocated.