Monday, September 29, 2014

Oracle 11G R2 install on CentOS version 57 linux

Oracle install in silent mode

Create Required Group and User

Add the below given groups and user if they do not exists on the system.
#groupadd oinstall
#groupadd dba
#groupadd oper
#useradd –g oinstall –G dba,oper oracle
#passwd oracle

Create software install folders

#mkdir –p /u01/app/oracle/product/11.2.0/db_1
#chown –R oracle:oinstall /u01
#chmod –R 755 /u01

Configure User environment

Add the below given lines in /etc/profile

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1; export ORACLE_HOME

ORACLE_SID=apal3; export ORACLE_SID

ORACLE_UNQNAME=apal3; export ORACLE_UNQNAME

PATH=$ORACLE_HOME/bin:$PATH; export PATH

Add the below given lines in oracle user .bash_profile

umask 022

Configuration of Kernel Parameters

Using any text editor, edit the /etc/sysctl.conf

net.ipv4.ip_forward = 0

net.ipv4.conf.default.rp_filter = 1

net.ipv4.conf.default.accept_source_route = 0

kernel.sysrq = 0

kernel.core_uses_pid = 1

net.ipv4.tcp_syncookies = 1

kernel.msgmnb = 65536

kernel.msgmax = 65536

kernel.shmmax = 2147483648

kernel.shmall = 2097152

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 6815744

fs.aio-max-nr = 1048576

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default = 1048576

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048576

After adding the above lines to the /etc/sysctl.conf file, they persist each time the system reboots. If you would like to make these kernel parameter value changes to the current system without having to reboot, enter the following command:

#sysctl –p

Using any text editor, edit the /etc/security/limits.conf

oracle              soft    nproc   2047

oracle              hard    nproc   16384

oracle              soft    nofile  1024

oracle              hard    nofile  65536

Edit the /etc/pam.d/login file and add following line:

# added for Oracle 11.2.0.3

session    required     pam_limits.so

Check current status of SELinux:

#/usr/sbin/getenforce

Enforcing

If output is Enforcing then change mode to Permissive as follows:

#/usr/sbin/setenforce 0

To make the change permanent, modify the /etc/sysconfig/selinux change value of SELINUX variable to disabled:

Add Required RPMs

For this I would recommend to check the oracle web site because different OS versions require different rpm’s. The below given package’s where required for red hat linux5.7 .

compat-libstdc++-33-3.2.3-69.el6.*.rpm

elfutils-devel-0.148-1.el6.x86_64.rpm

elfutils-libelf-devel-0.148-1.el6.x86_64.rpm

gcc-c++-4.4.4-13.el6.x86_64.rpm

glibc-2.12-1.7.el6.i686.rpm

glibc-devel-2.12-1.7.el6.i686.rpm

libaio-devel-0.3.107-10.el6.x86_64.rpm

libaio-0.3.107-10.el6.i686.rpm

libgcc-4.4.4-13.el6.i686.rpm

libstdc++-devel-4.4.4-13.el6.x86_64.rpm

libtool-ltdl-2.2.6-15.5.el6.i686.rpm

nss-softokn-freebl-3.12.7-1.1.el6.i686.rpm

readline-6.0-3.el6.i686.rpm

ncurses-libs-5.7-3.20090208.el6.i686.rpm

libcap-2.16-5.2.el6.i686.rpm

libattr-2.4.44-4.el6.i686.rpm

compat-libcap1-1.10-1.*.rpm

Use below given command to check if the rpm is installed

#rpm –qa | grep package name

Use the below given command to install the required package

#yum –install package name

Creating the oraInst.loc File

Create the /etc/oraInst.loc as below and chage the permission  and ownership.

inventory_loc=/u01/app/oraInventory

inst_group=oinstall

#chown oracle:oinstall oraInst.loc

#chmod 664 oraInst.loc

Prepare the responds file

The sample response file can be found under  “database/response ”.  Here is the example of db_install.rsp.

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0

oracle.install.option=INSTALL_DB_AND_CONFIG

ORACLE_HOSTNAME=linux57

UNIX_GROUP_NAME=oinstall

INVENTORY_LOCATION=/u01/app/oraInventor

SELECTED_LANGUAGES=en

ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1

ORACLE_BASE=/u01/app/oracle

oracle.install.db.InstallEdition=EE

oracle.install.db.isCustomInstall=false

oracle.install.db.customComponents=oracle.server:11.2.0.1.0,oracle.sysman.ccr:10.2.7.0.0,oracle.xdk:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,orac
le.network:11.2.0.1.0,oracle.network.listener:11.2.0.1.0,oracle.rdbms:11.2.0.1.0,oracle.options:11.2.0.1.0,oracle.rdbms.partitioning:11.2.0.1.0
,oracle.oraolap:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,orcle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.rat:11.2.0.1.0

oracle.install.db.DBA_GROUP=dba

oracle.install.db.OPER_GROUP=oper

oracle.install.db.CLUSTER_NODES=

oracle.install.db.config.starterdb.type=GENERAL_PURPOSE

oracle.install.db.config.starterdb.globalDBName=apal3

oracle.install.db.config.starterdb.SID=apal3

oracle.install.db.config.starterdb.characterSet=AL32UTF8

oracle.install.db.config.starterdb.memoryOption=true

oracle.install.db.config.starterdb.memoryLimit=400

oracle.install.db.config.starterdb.installExampleSchemas=false

oracle.install.db.config.starterdb.enableSecuritySettings=true

oracle.install.db.config.starterdb.password.ALL=1Qa2ws3ed4rf

oracle.install.db.config.starterdb.password.SYS=1Qa2ws3ed4rf

oracle.install.db.config.starterdb.password.SYSTEM=oracle

oracle.install.db.config.starterdb.password.SYSMAN=

oracle.install.db.config.starterdb.password.DBSNMP=

oracle.install.db.config.starterdb.control=DB_CONTROL

oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=

oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false

oracle.install.db.config.starterdb.dbcontrol.emailAddress=

oracle.install.db.config.starterdb.dbcontrol.SMTPServer=

oracle.install.db.config.starterdb.automatedBackup.enable=false

oracle.install.db.config.starterdb.automatedBackup.osuid=

oracle.install.db.config.starterdb.automatedBackup.ospwd=

oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE

oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/u01/app/oracle/oradata

oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=/u01/app/oracle/flash_recovery_area

oracle.install.db.config.asm.diskGroup=

oracle.install.db.config.asm.ASMSNMPPassword=

MYORACLESUPPORT_USERNAME=

MYORACLESUPPORT_PASSWORD=

SECURITY_UPDATES_VIA_MYORACLESUPPORT=false

DECLINE_SECURITY_UPDATES=true

PROXY_HOST=

PROXY_PORT=

PROXY_USER=

PROXY_PWD=

Command to install oracle is given below:-

First login as oracle and go to where the install script is extracted.

$ cd /tmp/database/

$ ./runInstaller -silent -responseFile /tmp/database/response/db_install.rsp

 Wait for the installation step to prompt for executing the scripts. Open terminal and execute the scripts as "root" user.

Auto restart Oracle and related service via dbstart

Create /etc/init.d/oracle

#!/bin/sh

#

# /etc/rc.d/init.d/oracle

# Description: Starts and stops the Oracle database, listeners and Enterprise Manager

# See how we were called.

case "$1" in

start)

echo "Starting Oracle"

echo "—————————————————" >> /var/log/oracle

date +"! %T %a %D : Starting Oracle Databases as part of system up." >> /var/log/oracle

echo "—————————————————" >> /var/log/oracle

echo -n "Starting Oracle Databases: "

su - oracle -c dbstart >> /var/log/oracle

echo "Done."

echo -n "Starting Oracle Listeners: "

su - oracle -c "lsnrctl start" >> /var/log/oracle

echo "Done."

echo -n "Starting Oracle Enterprise Manager: "

su - oracle -c "emctl start dbconsole" >> /var/log/oracle

echo "Done."

echo ""

echo "—————————————————" >> /var/log/oracle

date +"! %T %a %D : Finished." >> /var/log/oracle

echo "—————————————————" >> /var/log/oracle

touch /var/lock/subsys/oracle

;;

stop)

echo "Shutting Down Oracle"

echo "—————————————————" >> /var/log/oracle

date +"! %T %a %D : Shutting Down Oracle Databases as part of system down." >> /var/log/oracle

echo "—————————————————" >> /var/log/oracle

echo -n "Shutting Down Oracle Enterprise Manager: "

su - oracle -c "emctl stop dbconsole" >> /var/log/oracle

echo "Done."

echo -n "Shutting Down Oracle Listeners: "

su - oracle -c "lsnrctl stop" >> /var/log/oracle

echo "Done."

rm -f /var/lock/subsys/oracle

echo -n "Shutting Down Oracle Databases: "

su - oracle -c dbshut >> /var/log/oracle

echo "Done."

echo ""

echo "—————————————————" >> /var/log/oracle

date +"! %T %a %D : Finished." >> /var/log/oracle

echo "—————————————————" >> /var/log/oracle

;;

restart)

echo "Restarting Oracle"

echo "—————————————————" >> /var/log/oracle

date +"! %T %a %D : Restarting Oracle Databases as part of system up." >> /var/log/oracle

echo "—————————————————" >> /var/log/oracle

echo -n "Restarting Oracle Databases: "

su - oracle -c dbshut >> /var/log/oracle

su - oracle -c dbstart >> /var/log/oracle

echo "Done."

echo -n "Restarting Oracle Listeners: "

su - oracle -c "lsnrctl stop" >> /var/log/oracle

su - oracle -c "lsnrctl start" >> /var/log/oracle

echo "Done."

echo -n "Restarting Oracle Enterprise Manager: "

su - oracle -c "emctl stop dbconsole" >> /var/log/oracle

su - oracle -c "emctl start dbconsole" >> /var/log/oracle

echo "Done."

echo ""

echo "—————————————————" >> /var/log/oracle

date +"! %T %a %D : Finished." >> /var/log/oracle

echo "—————————————————" >> /var/log/oracle

touch /var/lock/subsys/oracle

;;

*)

echo "Usage: oracle {start|stop|restart}"

exit 1

esac


Creating shortcuts for different level to start up and shut down oracle

# chmod +x oracle

# ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc2.d/S99oracl

# ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc3.d/S99oracle

# ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc4.d/S99oracle

# ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc5.d/S99oracle

# ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc0.d/K01oracle

# ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc6.d/K01oracle

No comments:

Post a Comment