Oracle/Database/Oracle 11gR1 RHEL6 Install

Oracle 11gR1 RHEL 6.0 Install
These instructions use Oracle Database 11g Release 1 on RHEL 6.0

Oracle
Oracle Download - http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html

Requirements

 * 1 GB of RAM
 * Swap space equal to ram (min size 2GB - max size 16GB)
 * 2-5GB of free disk space (depending on version)
 * Statically assigned IP address

Modifications
yum install tigervnc-server

Checking operating system requirements ... Expected result: One of enterprise-4,enterprise-5,redhat-4,redhat-5,SuSE-10,asianux-2,asianux-3 Actual Result: redhat-6.0 Check complete. The overall result of this check is: Failed <<<< Problem: Oracle Database 11g is not certified on the current operating system. Recommendation: Make sure you are installing the software on the correct platform.

kickstart
See

Yum
$releasever = 6Server $basearch = i386, x86_64

/etc/yum.repos.d/oeey.repo: cat > /etc/yum.repos.d/oeey.repo << "EOF"

[oeey] name=oeey Repo for $releasever $basearch baseurl=http://yum.lindonlabs.com/rhel/6.0/x86/Server/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
 * 1) baseurl=/opt/yum/

EOF

You will need to rebuild repodata to get this to work: createrepo.

Disable RHN: sed -i 's/enabled = 1/enabled=0/' /etc/yum/pluginconf.d/rhnplugin.conf
 * 1) vi /etc/yum/pluginconf.d/rhnplugin.conf
 * 2) enabled = 0

Install dependencies: yum install make binutils gcc libaio libaio-devel libstdc++ elfutils-libelf-devel sysstat \ compat-libstdc++-33 libgcc libstdc++-devel unixODBC unixODBC-devel

Missing from kickstart: yum install tigervnc-server xterm twm xorg-x11-utils yum install libaio-devel sysstat unixODBC unixODBC-devel
 * 1) i386

yum install tigervnc-server xterm twm xorg-x11-utils yum install libaio-devel.x86_64 sysstat.x86_64 unixODBC.x86_64 unixODBC-devel.x86_64
 * 1) x86_64

Hosts
NOTE: May not be needed, as Network manager appears to already do this... (oh... only if using Network Manager and dhcp)

cp /etc/hosts /etc/hosts.original echo -e "127.0.0.1\t\tlocalhost.localdomain localhost" > /etc/hosts echo -e "`ifconfig | grep "inet addr" | head -n 1 | cut -f 2 -d ":" | cut -f 1 -d " "`\t\t`hostname` `hostname | cut -f 1 -d '.'`" >> /etc/hosts

Example: The /etc/hosts file must contain a fully qualified name for the server: 127.0.0.1		localhost.localdomain localhost
 * 1			localhost6.localdomain6 localhost6

216.119.194.130		ws-194-130.oeey.com ws-194-130

WARNING: If during the precheck you get a "not executed" instead of a "success" or "warning" your hosts file is wrong!

Kernel Parameters
Add the following lines to the /etc/sysctl.conf file - cat >> /etc/sysctl.conf <<EOF

kernel.shmmax = 536870912 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 65536 net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default = 4194304 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 262144
 * 1) Oracle Settings
 * 2) Only change default kernel.shmall and kernel.shmmax if pre-existing values
 * 3)   are lower then listed below:
 * 4) kernel.shmall = 2097152
 * 1) kernel.shmall = 2097152
 * 1) semaphores: semmsl, semmns, semopm, semmni
 * 1) memory settings

EOF

Run the following command to change the current kernel parameters: /sbin/sysctl -p

limits
Add the following lines to the /etc/security/limits.conf file: cat >> /etc/security/limits.conf <> /etc/pam.d/login <<EOF

session   required     pam_limits.so
 * 1) Oracle Settings

EOF

Users and Groups
Create the new groups and users and set password: groupadd oinstall groupadd dba groupadd oper useradd -g oinstall -G dba oracle echo "test12" | passwd --stdin oracle
 * 1) give password to oracle user 'test12'
 * 2) passwd oracle

Create the directories in which the Oracle software and database files will be stored: mkdir -p /opt/oracle chown -R oracle.oinstall /opt/oracle mkdir /opt/oraInventory chown -R oracle.oinstall /opt/oraInventory

Add the following lines at the end of the Oracle user's .bash_profile file: cat >> /home/oracle/.bash_profile <<"EOF"

export TMP=/tmp export TMPDIR=$TMP
 * 1) Oracle Settings

export ORACLE_BASE=/opt/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.1/db_1 export ORACLE_SID=orcl export ORACLE_TERM=xterm export PATH=/usr/sbin:$PATH export PATH=$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=$ORACLE_HOME/jdk/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi

EOF

VNC
Add to the /etc/sysconfig/vncservers file cat >> /etc/sysconfig/vncservers <<EOF

VNCSERVERS="2:oracle" VNCSERVERARGS[2]="-geometry 800x600"

EOF

Log into the oracle user and create VNC Password mkdir -p /home/oracle/.vnc echo "de2e2c59eda77881" | xxd -p -r - /home/oracle/.vnc/passwd chmod 600 /home/oracle/.vnc/passwd chown -R oracle:oinstall /home/oracle/.vnc
 * 1) su - oracle
 * 2) give vnc login a password 'test12'
 * 3) vncpasswd ; exit
 * 4) generated from "vncpasswd ; cat /home/oracle/.vnc/passwd | xxd -p -"
 * 1) generated from "vncpasswd ; cat /home/oracle/.vnc/passwd | xxd -p -"

Enable VNC persistent desktops at boot and start service chkconfig vncserver on service vncserver start

Remove # from /home/oracle/.vnc/xstartup to enable full desktop sed -i 's%# unset SESSION_MANAGER%unset SESSION_MANAGER%g' /home/oracle/.vnc/xstartup sed -i 's%# exec /etc/X11/xinit/xinitrc%exec /etc/X11/xinit/xinitrc%g' /home/oracle/.vnc/xstartup service vncserver restart
 * 1) restart vncserver to take effect:

Note: This will result in: /home/oracle/.vnc/xstartup: unset SESSION_MANAGER exec /etc/X11/xinit/xinitrc
 * 1)  Uncomment the following two lines for normal desktop:

VNC to system: vncviewer [SYSTEM]:2

Hack OS Version
This is an important step. If you miss this Oracle will complain about OS Version comparability. This can be undone, once Oracle has been installed. cp /etc/redhat-release /etc/redhat-release.bak echo "Red Hat Enterprise Linux Server release 5.5 (Tikanga)" > /etc/redhat-release

Install Oracle
unzip linux_11gR1_database_1013.zip unzip linux.x64_11gR1_database_1013.zip cd database ./runInstaller
 * 1) copy oracle install local
 * 1) 32bit:
 * 1) 64bit:

Basic Installation: (defaults + password) Oracle Base Location: /opt/oracle Oracle Home Location: /opt/oracle/product/11.1/db_1 Installation Type: Enterprise Edition (3.3GB) UNIX DBA Group: dba [x] Create Starter Database (additional 1482MB) Global Database Name: orcl Database Password: test12 * Used for SYS, SYSTEM, SYSMAN, and DBSNMP accounts

Specify Inventory directory and credentials: (defaults) Full path of the inventory directory: /opt/oraInventory Operating system group name: oinstall

Configure Security Updates * Email (Oracle Support email): leave blank * deselect I wish to receive security updates Create and configure a database: * Desktop Class or Server Class Server Class Grid Options: Single instance database installation Install Type: Typical Install

Oracle Configuration Manager Registration: [ ] Enable Oracle Configuration Manager * Skip this step

Typical Installation: Oracle base: /opt/oracle Software location: /opt/oracle/product/11.1/db_1 Storage Type: File System Database file location: /opt/oracle/oradata Database edition: Enterprise Edition (3.95GB) OSDBA group: dba Global database name: orcl.lab * administrative password: test12

Create Inventory: Inventory Directory: /opt/oraInventory oraInventory Group Name: oinstall

If the network has "not run" check your hosts file. If anything else is error or warned, you have problems.

root
Near the end of the install it will ask you to run the following root: /opt/oraInventory/orainstRoot.sh /opt/oracle/product/11.1/db_1/root.sh

Unhack OS Version
mv /etc/redhat-release.bak /etc/redhat-release

Enterprise Manager
Enterprise Manager Database Control URL - (orcl):
 * https://[HOSTNAME]:1158/em

System Checks
The following were the results on an RHEL 6.0 installation with the following changes:
 * Hacked "version" to appear as RHEL 5
 * Installed libaio-devel unixODBC-devel

Checking operating system requirements ... Expected result: One of enterprise-4,enterprise-5,redhat-4,redhat-5,SuSE-10,asianux-2,asianux-3 Actual Result: redhat-5 Check complete. The overall result of this check is: Passed

=
===========================================

Checking operating system package requirements ... Checking for make-3.81; found make-1:3.81-19.el6-i686. Passed Checking for binutils-2.17.50.0.6; found binutils-2.20.51.0.2-5.11.el6-i686. Passed Checking for gcc-4.1.1; found gcc-4.4.4-13.el6-i686. Passed Checking for libaio-0.3.106; found libaio-0.3.107-10.el6-i686. Passed Checking for libaio-devel-0.3.106; found libaio-devel-0.3.107-10.el6-i686. Passed Checking for libstdc++-4.1.1; found libstdc++-4.4.4-13.el6-i686. Passed Checking for elfutils-libelf-devel-0.125; found elfutils-libelf-devel-0.148-1.el6-i686. Passed Checking for sysstat-7.0.0; found sysstat-9.0.4-11.el6-i686. Passed Checking for compat-libstdc++-33-3.2.3; found compat-libstdc++-33-3.2.3-69.el6-i686. Passed Checking for libgcc-4.1.1; found libgcc-4.4.4-13.el6-i686. Passed Checking for libstdc++-devel-4.1.1; found libstdc++-devel-4.4.4-13.el6-i686. Passed Checking for unixODBC-2.2.11; found unixODBC-2.2.14-11.el6-i686. Passed Checking for unixODBC-devel-2.2.11; found unixODBC-devel-2.2.14-11.el6-i686. Passed Check complete. The overall result of this check is: Passed

=
===========================================

Checking kernel parameters Checking for semmsl=250; found semmsl=250. Passed Checking for semmns=32000; found semmns=32000. Passed Checking for semopm=100; found semopm=100. Passed Checking for semmni=128; found semmni=128. Passed Checking for shmmax=536870912; found shmmax=536870912. Passed Checking for shmmni=4096; found shmmni=4096. Passed Checking for shmall=2097152; found shmall=2097152. Passed Checking for file-max=65536; found file-max=65536. Passed Checking for VERSION=2.6.18; found VERSION=2.6.32-71.el6.i686. Passed Checking for ip_local_port_range=1024 - 65000; found ip_local_port_range=1024 - 65000. Passed Checking for rmem_default=4194304; found rmem_default=4194304. Passed Checking for rmem_max=4194304; found rmem_max=4194304. Passed Checking for wmem_default=262144; found wmem_default=262144. Passed Checking for wmem_max=262144; found wmem_max=262144. Passed Check complete. The overall result of this check is: Passed

=
===========================================

Checking Recommended glibc version Expected result: ATLEAST=2.5-12 Actual Result: 2.12-1.7.el6 Check complete. The overall result of this check is: Passed

=
===========================================

Checking physical memory requirements ... Expected result: 922MB Actual Result: 2020MB Check complete. The overall result of this check is: Passed

=
===========================================

Checking available swap space requirements ... Expected result: 3030MB Actual Result: 4063MB Check complete. The overall result of this check is: Passed

=
===========================================

Checking Network Configuration requirements ... Check complete. The overall result of this check is: Passed

=
===========================================

Checking PATH environment variable... Check complete. The overall result of this check is: Passed

=
===========================================

Checking for sufficient diskspace in TEMP location... Check complete. The overall result of this check is: Passed

=
===========================================

Checking LD_LIBRARY_PATH environment variable... Check complete. The overall result of this check is: Passed

=
===========================================

Validating ORACLE_BASE location (if set) ... Check complete. The overall result of this check is: Passed

=
===========================================

Checking Oracle Home path for spaces... Check complete. The overall result of this check is: Passed

=
===========================================

Checking for proper system clean-up.... Check complete. The overall result of this check is: Passed

=
===========================================

Checking for Oracle Home incompatibilities .... Actual Result: NEW_HOME Check complete. The overall result of this check is: Passed

=
===========================================

oracle init.d script
NOTE: Make sure to set the auto start flag for the database (/etc/oratab), or this will not work!


 * 1) !/bin/sh
 * 2) chkconfig: 345 99 10
 * 3) description: Oracle auto start-stop script.
 * 4) Set ORA_HOME to be equivalent to the $ORACLE_HOME
 * 5) from which you wish to execute dbstart and dbshut;
 * 6) Set ORA_OWNER to the user id of the owner of the
 * 7) Oracle database in ORA_HOME.
 * 8) Note: make sure to modify /etc/oratab start
 * 9) parameter from 'N' to 'Y'
 * 1) Note: make sure to modify /etc/oratab start
 * 2) parameter from 'N' to 'Y'
 * 1) parameter from 'N' to 'Y'

ORA_HOME=/opt/oracle/product/11.1/db_1 ORA_OWNER=oracle

if [ ! -f $ORA_HOME/bin/dbstart ] then echo "Oracle startup: cannot start" exit fi

case "$1" in   'start')        # Start the Oracle databases:        # The following command assumes that the oracle login        # will not prompt the user for any values        su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"        su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME"        ;;    'stop') # Stop the Oracle databases: # The following command assumes that the oracle login # will not prompt the user for any values su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME" su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop" ;; esac

cat > /etc/init.d/oracle <  Set hostname (using 'hostname')   hostname NEWNAME   Set hostname on reboot in /etc/sysconfig/network:   HOSTNAME=NEWNAME   Set hostname lookup in /etc/hosts:   10.10.10.100 NEWNAME </li></ul>  Change Oracle listner.ora: </li>  $ vi $ORACLE_HOME/network/admin/listener.ora

/admin/listener.ora
 * 1) listener.ora Network Configuration File: /opt/oracle/product/11.1/db_1/network
 * 1) Generated by Oracle configuration tools.

LISTENER = (DESCRIPTION_LIST =   (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = NEWNAME)(PORT = 1521)) ) ) </li></ul>  Change Oracle tnsnames.ora: </li>  $ vi $ORACLE_HOME/network/admin/tnsnames.ora

/admin/tnsnames.ora
 * 1) tnsnames.ora Network Configuration File: /opt/oracle/product/11.1/db_1/network
 * 1) Generated by Oracle configuration tools.

ORCL = (DESCRIPTION =   (ADDRESS = (PROTOCOL = TCP)(HOST = NEWNAME)(PORT = 1521))    (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) ) </li></ul>  Restart oracle </li>  service oracle stop ; service oracle start </li></ul> </ol>

Oracle Power Script
See Oracle Power Install Script (Oracle 11g - RHEL 5)

error while loading shared libraries
If you try to run the oracle startup script and see the following: /opt/oracle/product/11.1/db_1/bin/lsnrctl: error while loading shared libraries: /opt/oracle/product/11.1/db_1/lib/libnnz11.so: cannot restore segment prot after reloc: Permission denied /opt/oracle/product/11.1/db_1/bin/lsnrctl: error while loading shared libraries: /opt/oracle/product/11.1/db_1/lib/libnnz11.so: cannot restore segment prot after reloc: Permission denied Processing Database instance "orcl": log file /opt/oracle/product/11.1/db_1/startup.log heck to see if see selinux has been disabled

TNS:no listener
If you try and start or stop the oracle server and see the following: Processing Database instance "orcl": log file /opt/oracle/product/11.1/db_1/shutdown.log

LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 22-JUL-2010 12:53:38

Copyright (c) 1991, 2007, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error TNS-00511: No listener Linux Error: 111: Connection refused Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521))) TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error TNS-00511: No listener Linux Error: 111: Connection refused

Check that the '(HOST=localhost.localdomain)' matches '$ hostname' and '/etc/hosts'.

Error in invoking target
The installation (Linking Oracle Database stage) will fail with the following error:

Error:
 * Error in invoking target 'agent nmb nmo nmhs tclexec' of makefile '/opt/oracle/product/11.1/db_1/sysman/lib/ins_emagent.mk'. See '/opt/oraInventory/logs/installActions2011-01-12_03-52-33PM.log' for details.

The log file reports: INFO: /usr/lib/gcc/i686-redhat-linux/4.4.4/libgcc_s.so: undefined reference to `__stack_chk_fail@GLIBC_2.4' collect2: ld returned 1 exit status

Cause:
 * This is caused by an incorrect version of GLIBC being used.

Solution:
 * There is no solution. Switch versions of Oracle, or distributions.

Hack Solution:
 * See here for a work around solution (not supported and will break other things)

kickstart files
Full system:

anaconda-ks.cfg:
 * 1) Kickstart file automatically generated by anaconda.

install url --url=http://216.119.202.5/dvd/rhel/6.0/x86/ lang en_US.UTF-8 keyboard us network --device eth0 --bootproto dhcp rootpw --iscrypted $6$D.cfKhh9D2yQmRYI$WGb5LU172IuAfnDONblTORFNiSBqxKxqj4QbGbJ6eqjY7eLPCTLSClwWcwZlDvM9nxf8eVXPHivb3lJgjuCKq1 firewall --service=ssh authconfig --enableshadow --passalgo=sha512 --enablefingerprint selinux --enforcing timezone --utc America/New_York bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
 * 1) version=RHEL6
 * 1) The following is the partition information you requested
 * 2) Note that any partitions you deleted are not expressed
 * 3) here so unless you clear all partitions first, this is
 * 4) not guaranteed to work
 * 5) clearpart --linux --drives=sda


 * 1) part /boot --fstype=ext4 --size=500
 * 2) part pv.0eC2O2-zBd7-3gib-35ff-Mv56-yl76-1YmxEH --grow --size=1

repo --name="Red Hat Enterprise Linux" --baseurl=http://216.119.202.5/dvd/rhel/6.0/x86/ --cost=100
 * 1) volgroup vg_ws194122 --pesize=4096 pv.0eC2O2-zBd7-3gib-35ff-Mv56-yl76-1YmxEH
 * 2) logvol / --fstype=ext4 --name=lv_root --vgname=vg_ws194122 --grow --size=1024 --maxsize=51200
 * 3) logvol swap --name=lv_swap --vgname=vg_ws194122 --grow --size=2032 --maxsize=4064

%packages @additional-devel @backup-client @backup-server @base @cifs-file-server @compat-libraries @console-internet @core @debugging @basic-desktop @desktop-debugging @desktop-platform @desktop-platform-devel @development @dial-up @directory-client @directory-server @mail-server @eclipse @emacs @storage-client-fcoe @ftp-server @fonts @general-desktop @graphical-admin-tools @graphics @hardware-monitoring @input-methods @internet-browser @java-platform @kde-desktop @large-systems @legacy-unix @legacy-x @mainframe-access @system-management-messaging-client @mysql-client @mysql @nfs-file-server @network-server @storage-server @network-file-system-client @network-tools @php @performance @perl-runtime @postgresql-client @postgresql @print-server @print-client @remote-desktop-clients @scientific @security-tools @server-platform @server-platform-devel @server-policy @smart-card @storage-client-multipath @system-management @system-admin-tools @tex @technical-writing @web-server @web-servlet @system-management-wbem @x11 @storage-client-iscsi libXinerama-devel xorg-x11-proto-devel startup-notification-devel libgnomeui-devel libbonobo-devel junit libXau-devel libgcrypt-devel popt-devel libdrm-devel libXrandr-devel libxslt-devel libglade2-devel gnutls-devel mtools pax python-dmidecode oddjob sgpio genisoimage wodim abrt-gui qt-mysql desktop-file-utils ant rpmdevtools jpackage-utils rpmlint certmonger pam_krb5 krb5-workstation nscd pam_ldap nss-pam-ldapd samba netpbm-progs ImageMagick tcp_wrappers xterm xorg-x11-xdm libXmu perl-DBD-MySQL dnsmasq perl-DBD-SQLite rdesktop tigervnc atlas numpy hmaccalc crypto-utils certmonger tog-pegasus %end

Default system:
 * 1) Kickstart file automatically generated by anaconda.

install url --url=http://216.119.202.5/dvd/rhel/6.0/x86 lang en_US.UTF-8 keyboard us network --device eth0 --bootproto dhcp rootpw --iscrypted $6$wsjkZEKVUht.DOqu$figLkkbukpBOIe9GZ90O8HsIy/jM2mtY2RSCbfEG6Ar5zgGEAhN7Q6AZbQfcaR04SLpSNZwjc53vY5zjjJ5PT/ firewall --service=ssh authconfig --enableshadow --passalgo=sha512 --enablefingerprint selinux --enforcing timezone --utc America/New_York bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
 * 1) version=RHEL6
 * 1) The following is the partition information you requested
 * 2) Note that any partitions you deleted are not expressed
 * 3) here so unless you clear all partitions first, this is
 * 4) not guaranteed to work
 * 5) clearpart --linux --drives=sda


 * 1) part /boot --fstype=ext4 --size=500
 * 2) part pv.BxsFXn-JAUP-HTFR-FKxL-sZsZ-R4m9-P9C91u --grow --size=1

repo --name="Red Hat Enterprise Linux" --baseurl=http://216.119.202.5/dvd/rhel/6.0/x86/ --cost=100
 * 1) volgroup vg_ws194121 --pesize=4096 pv.BxsFXn-JAUP-HTFR-FKxL-sZsZ-R4m9-P9C91u
 * 2) logvol / --fstype=ext4 --name=lv_root --vgname=vg_ws194121 --grow --size=1024 --maxsize=51200
 * 3) logvol swap --name=lv_swap --vgname=vg_ws194121 --grow --size=2032 --maxsize=4064

%packages @base @console-internet @core @debugging @directory-client @hardware-monitoring @java-platform @large-systems @network-file-system-client @performance @perl-runtime @server-platform @server-policy pax python-dmidecode oddjob sgpio certmonger pam_krb5 krb5-workstation nscd pam_ldap nss-pam-ldapd perl-DBD-SQLite %end

keywords
oracle