Orarun package
From CoolSolutionsWiki
The orarun package is a rpm software package provided as part of SUSE Linux Enterprise Server (SLES) for the i386 and x86_64 platforms. 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.
Contents |
Availability
The orarun package is available for the i386 and x86_64 platforms, starting in SLES9 and will continue to be available in SLES10. The following table lists the different versions of the orarun package available in the different releases of SLES.
| SLES version | i386 | x86_64 |
|---|---|---|
| SLES 9 | orarun-1.8-109.5.i586.rpm | orarun-1.8-109.5.x86_64.rpm |
| SLES9 SP2/SP3 | orarun-1.8-109.15.i586.rpm | orarun-1.8-109.15.x86_64.rpm |
| SLES9 SP4 (planned) | orarun-1.8-109.16.i586.rpm | orarun-1.8-109.16.x86_64.rpm |
| SLES10 | orarun-1.9-21.2.i586.rpm | orarun-1.9-21.2.x86_64.rpm |
Table 1 -- Most recent orarun packages available by SLES release
The latest versions are available through ftp download for SLES9 and SLES10.
Features
The orarun package has the following features:
- It creates the oracle user and the dba and osinstall groups.
- It creates all 255 raw devices (SLES9).
- It modifies the security settings for the oracle user.
- It provides an profile script that sets Oracle specific environmental variables and ulimits.
- It provides an init script that sets kernel tunables to recommended values and starts various Oracle related services.
- On the i386 platform it provides the libInternalSymbols library.
Components
The orarun package has the following major components
- The /etc/init.d/oracle init script.
- The /etc/sysconfig/oracle configuration file
- 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.
| Variable | Default value | Purpose |
|---|---|---|
| ORACLE_OWNER | oracle | The user who will used to install the Oracle software |
| ORACLE_BASE | /opt/oracle | The base directory for all Oracle software |
| START_ORACLE_DB | no | Controls whether the Oracle databases that are listed in /etc/oratab are stated. |
| START_ORACLE_DB_LISTENER | no | Controls whether the database listeners are started. |
| START_ORACLE_DB_AGENT | no | Controls whether the database intelligent agent is started. |
| START_ORACLE_DB_APACHE | no | Controls whether Apache web server packaged with Oracle is started. |
| START_ORACLE_DB_APACHE_USE_SSL | no | Controls if the Oracle Apache web server uses SSL. |
| START_ORACLE_DB_EMANAGER | no | Controls whether the Enterprise Manager agent is started. |
| START_ORACLE_DB_ISQLPLUS | no | Controls whether iSQL PLus is started. |
| START_ORACLE_DB_OID | no | Controls whether Oracle Internet Directory is started. |
| START_ORACLE_RAC_OCFS | no | Controls whether OCFS is started (not OCFS2). |
| START_ORACLE_RAC_OCM | no | Controls whether the Oracle9i cluster monitor is started. |
| ORACLE_RAC_OCM_PARAMETERS | The values to be passed to Oracle9i cluster monitor. | |
| START_ORACLE_RAC_GSD | no | Controls whether the Oracle9i Global Service Daemon is started. |
| START_ORACLE_AS_CONSOLE | no | Controls whether the Application Server console is started. |
| SET_ORACLE_KERNEL_PARAMETERS | yes | Controls whether the /etc/init.d/oracle script sets the kernel parameters. |
| SHMMAX | 8589934592 | Maximum 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. |
| SHMMNI | 4096 | Maximum number of shared memory segments sytem wide. This value is put into /proc/sys/kernel/shmmni. |
| SHMALL | 2097152 | Maxium number of shared memory pages system wide. This value is put into /proc/sys/kernel/shmall. |
| SEMMSL | 1250 | Maximum 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. |
| SEMMNS | 32000 | Maximum 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. |
| SEMOPM | 100 | Maximum number of operations per semop call. Oracle recommends 100. This value is put into /proc/sys/kernel/sem. |
| SEMMNI | 256 | Maximum number of semaphore identifies. Oracle recommends at least 100. This value is put into /proc/sys/kernel/sem. |
| IP_PORT_LOCAL_RANGE | 1024 65000 | The range of local ports available to UDP and TCP. This value is put into /proc/sys/net/ipv4/ip_local_port_range. |
| RMEM_MAX | 262144 | The maximum memory size for a recieve window. Requirement for RAC environments. This value is put into /proc/sys/net/core/rmem_max |
| RMEM_DEFAULT | 262144 | The default memory size for a recieve window. Requirement for RAC environments. This value is put into /proc/sys/net/core/rmem_default |
| WMEM_MAX | 262144 | The maximum memory size for a send window. Requirement for RAC environments. This value is put into /proc/sys/net/core/wmem_max |
| WMEM_DEFAULT | 262144 | The default memory size for a send window. Requirement for RAC environments. This value is put into /proc/sys/net/core/wmem_default |
| FILE_MAX_KERNEL | 131072 | The 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_SHELL | 65536 | The maximum amount of open file descriptors. This value is used by the /etc/profile.d/oracle.[c]sh script. |
| PROCESSES_MAX_SHELL | 16384 | The 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_SHELL | unlimited | This is the maximum allowed size of a core file. This value is used by the /etc/profile.d/oracle.[c]sh script. |
| VM_MAPPED_RATIO | 100 | This 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_SIZE | 226144 | This 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_PAGES | 0 | For i386 systems that require a SGA larger than 2.7GB, it is necessary to set this parameter and use a hugetlbfs filesystem. |
| SHM_GROUP | dba | This 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:
| Variable | Default value |
|---|---|
| ORACLE_BASE | /opt/oracle |
| ORACLE_HOME | $ORACLE_BASE/product/10.2/db_1 |
| ORACLE_SID | orcl |
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:
| Variable | Default 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:
- ulimit -c to MAX_CORE_FILE_SIZE_SHELL or 0 if MAX_CORE_FILE_SIZE_SHELL is unset
- ulimit -u to PROCESSES_MAX_SHELL or 16384 if PROCESSES_MAX_SHELL is unset
- 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:
- Install the orarun package.
- Set the shell and password for the oracle user.
- Set the value of the SHMMAX parameter in the /etc/sysconfig/oracle configuration file.
- Set the ORACLE_HOME and ORACLE_SID environmental variable parameters in the /etc/profile.d/oracle.[c]sh script.
- 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.
In SLES10 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
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
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
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.
