Oracle Database 11.2.0.4 install on Oracle Linux 6.5 (x64)

There are installing processes that I really do love (DB2) and on the other side there are install processes which I really hate (Oracle Database). Bright and dark side of database software in linux world. Let´s uncover one of the most tricky installer I know… 🙂

0.Basic prerequisities

Oracle Linux 6.5 x64 with all updates, hostname=ol65.localdomain. Plenty of time and expert knowledges (linux + oracle database) if something goes another way than described.

 

 

1.Pre-install

There are plenty of things you have to do before installing Oracle Database (later just „OD“). Changing a lot of limits are basic ones. You can follow this guide (manual setup paragraph) and change /etc/sysctl.conf and /etc/security/limits.conf values or use metapackage for Oracle Linux (one of benefits for 2x Oracle software 🙂 ):

[root@localhost ~]# yum install oracle-rdbms-server-11gR2-preinstall
Loaded plugins: refresh-packagekit, security
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-9.el6 will be installed
–> Processing Dependency: compat-libcap1 for package: oracle-rdbms-server-11gR2-preinstall-1.0-9.el6.x86_64
–> Processing Dependency: ksh for package: oracle-rdbms-server-11gR2-preinstall-1.0-9.el6.x86_64
–> Processing Dependency: libaio-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-9.el6.x86_64
–> Processing Dependency: compat-libstdc++-33 for package: oracle-rdbms-server-11gR2-preinstall-1.0-9.el6.x86_64
–> Running transaction check
—> Package compat-libcap1.x86_64 0:1.10-1 will be installed
—> Package compat-libstdc++-33.x86_64 0:3.2.3-69.el6 will be installed
—> Package ksh.x86_64 0:20120801-10.el6_5.4 will be installed
—> Package libaio-devel.x86_64 0:0.3.107-10.el6 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================================
 Package                                          Arch               Version                           Repository                     Size
===========================================================================================================================================
Installing:
 oracle-rdbms-server-11gR2-preinstall             x86_64             1.0-9.el6                         public_ol6_latest              17 k
Installing for dependencies:
 compat-libcap1                                   x86_64             1.10-1                            public_ol6_latest              17 k
 compat-libstdc++-33                              x86_64             3.2.3-69.el6                      public_ol6_latest             183 k
 ksh                                              x86_64             20120801-10.el6_5.4               public_ol6_latest             756 k
 libaio-devel                                     x86_64             0.3.107-10.el6                    public_ol6_latest              13 k

Transaction Summary
===========================================================================================================================================
Install       5 Package(s)

Total download size: 985 k
Installed size: 2.5 M
Is this ok [y/N]: y
Downloading Packages:
(1/5): compat-libcap1-1.10-1.x86_64.rpm                                                                             |  17 kB     00:00     
(2/5): compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm                                                                  | 183 kB     00:00     
(3/5): ksh-20120801-10.el6_5.4.x86_64.rpm                                                                           | 756 kB     00:00     
(4/5): libaio-devel-0.3.107-10.el6.x86_64.rpm                                                                       |  13 kB     00:00     
(5/5): oracle-rdbms-server-11gR2-preinstall-1.0-9.el6.x86_64.rpm                                                    |  17 kB     00:00     
——————————————————————————————————————————————-
Total                                                                                                      1.4 MB/s | 985 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : ksh-20120801-10.el6_5.4.x86_64                                                                                          1/5
  Installing : compat-libstdc++-33-3.2.3-69.el6.x86_64                                                                                 2/5
  Installing : libaio-devel-0.3.107-10.el6.x86_64                                                                                      3/5
  Installing : compat-libcap1-1.10-1.x86_64                                                                                            4/5
  Installing : oracle-rdbms-server-11gR2-preinstall-1.0-9.el6.x86_64                                                                   5/5
  Verifying  : compat-libcap1-1.10-1.x86_64                                                                                            1/5
  Verifying  : libaio-devel-0.3.107-10.el6.x86_64                                                                                      2/5
  Verifying  : compat-libstdc++-33-3.2.3-69.el6.x86_64                                                                                 3/5
  Verifying  : ksh-20120801-10.el6_5.4.x86_64                                                                                          4/5
  Verifying  : oracle-rdbms-server-11gR2-preinstall-1.0-9.el6.x86_64                                                                   5/5

Installed:
  oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-9.el6                                                                                  

Dependency Installed:
  compat-libcap1.x86_64 0:1.10-1               compat-libstdc++-33.x86_64 0:3.2.3-69.el6         ksh.x86_64 0:20120801-10.el6_5.4        
  libaio-devel.x86_64 0:0.3.107-10.el6        

Complete!
[root@localhost ~]#

At this point, except mentioned packages, those actions were done:

* Causes the download and installation of various software packages and specific versions needed for database installation, with package dependencies resolved via yum
* Creates the user oracle and the groups oinstall and dba, which are the defaults used during database installation
* Modifies kernel parameters in /etc/sysctl.conf to change settings for shared memory, semaphores, the maximum number of file descriptors, and so on
* Sets hard and soft shell resource limits in /etc/security/limits.conf, such as the number of open files, the number of processes, and stack size to the minimum required based on the Oracle Database 11g Release 2 Server installation requirements
* Sets numa=off in the kernel boot parameters for x86_64 machines

2.Install

Set password for oracle user (passwd oracle).

Now we should prepare directory for oracle installation:

[root@localhost ~]# mkdir -p /u01/app/oracle/product/11.2.0/db_1
[root@localhost ~]# chown -R oracle:oinstall /u01
[root@localhost ~]# chmod -R 775 /u01
[root@localhost ~]#

Change soft limit in file /etc/security/limits.d/90-nproc.conf
old value = * soft nproc 1024

new value = * – nproc 16384

Change SELinux behaviour by editing /etc/selinux/config :

SELINUX=permissive

Now you need to setup maybe the most imortant thing at all (nobody will do it for you 🙂 ). Edit file .bash_profile in home directory (oracle user) and add these lines. Beware and do not just copy+past, read+adjust them!! 🙂

TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=ol65.localdomain; export ORACLE_HOSTNAME
ORACLE_UNQNAME=orcl; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_home1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID

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

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

Bunch of install zip files is placed in one directory:

-rwxrwx—.  1 j j 1395582860 Aug 27  2013 p13390677_112040_Linux-x86-64_1of7.zip
-rwxrwx—.  1 j j 1151304589 Aug 27  2013 p13390677_112040_Linux-x86-64_2of7.zip
-rwxrwx—.  1 j j 1205251894 Aug 27  2013 p13390677_112040_Linux-x86-64_3of7.zip
-rwxrwx—.  1 j j  656026876 Aug 27  2013 p13390677_112040_Linux-x86-64_4of7.zip
-rwxrwx—.  1 j j  599170344 Aug 27  2013 p13390677_112040_Linux-x86-64_5of7.zip
-rwxrwx—.  1 j j  488372844 Aug 27  2013 p13390677_112040_Linux-x86-64_6of7.zip
-rwxrwx—.  1 j j  119521122 Aug 27  2013 p13390677_112040_Linux-x86-64_7of7.zip

Names can be different (11201 is public, the rest depends on Oracle support account). We can unzip all zip files by issuing unzip \*.zip command.

One of unpacked directory is named „database„. From this directory, run ./runInstaller file. Run it as oracle user:

[j@localhost database]$ ./runInstaller
Starting Oracle Universal Installer…

Checking Temp space: must be greater than 120 MB.   Actual 1937708 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 10149 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2014-05-16_11-17-11AM. Please wait …[j@localhost database]$

Graphical installer is started… (in better case 😀 ), few screens are not important (skipping). Interesting is basic path settings:

006

Setting up inventory:

007

Next step is my favourite one:

008

Here you have a list of required/recommended setting that you are not fitting. By clicking on Fix&Check button you obtain instructions what to do next. In my first case:

[root@localhost ~]# /tmp/CVU_11.2.0.4.0_j/runfixup.sh
Response file being used is :/tmp/CVU_11.2.0.4.0_j/fixup.response
Enable file being used is :/tmp/CVU_11.2.0.4.0_j/fixup.enable
Log file location: /tmp/CVU_11.2.0.4.0_j/orarun.log
uid=500(j) gid=500(j) groups=500(j),492(vboxsf)

You can have some fights between installer thoughts and reality in conf files. Jut double-check values in your system, don´t try to trust Oracle installer 🙂 In my case for soft limits – /etc/security/limits.conf

009

Last review and we can finally install this software:

010

Last step in installation is setting accounts:

011

Many settings needs to be done now, first part is the last window of installer:

012

Output in my case:

[root@localhost ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@localhost ~]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/11.2.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin …
   Copying oraenv to /usr/local/bin …
   Copying coraenv to /usr/local/bin …

Creating /etc/oratab file…
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
[root@localhost ~]#

Last window in installer is linking into Enterprise Manager:

013

All seems ok, so just reboot your environment.

 

 

3. Post-install steps

After reboot, first of all check if paths are well setup. The main, „mother of all paths“ is $ORACLE_HOME. Just type in terminal sql and try to fill possible commands with TAB key. If output looks like

[oracle@ol65 ~]$ sql
sqlite3  sqlldr   sqlldrO  sqlplus

It´s fine. If you can find only sqlite3(and similar, without sqlplus), doublecheck your .bas_profile file,especially $ORACLE_HOME. Database is ready to start:

[oracle@ol65 ~]$ sqlplus „/as sysdba“

SQL*Plus: Release 11.2.0.4.0 Production on Mon May 19 09:04:47 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1653518336 bytes
Fixed Size            2253784 bytes
Variable Size         1006636072 bytes
Database Buffers      637534208 bytes
Redo Buffers            7094272 bytes
Database mounted.
Database opened.
SQL> select banner from v$version;

BANNER
——————————————————————————–
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production
PL/SQL Release 11.2.0.4.0 – Production
CORE    11.2.0.4.0    Production
TNS for Linux: Version 11.2.0.4.0 – Production
NLSRTL Version 11.2.0.4.0 – Production

SQL>

We are not finished yet, Listener setup is still waiting, as you can see from this command:

[oracle@ol65 ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 – Production on 19-MAY-2014 09:14:43

Copyright (c) 1991, 2013, 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)(PORT=1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused
[oracle@ol65 ~]$

Let´s try it via netca, graphical utility from Oracle – choose reconfigure, commit your changes and after few clicks (Next, Next, Finish) you can try to start Listener:

[oracle@ol65 ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.4.0 – Production on 19-MAY-2014 09:18:35

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

Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait…

TNSLSNR for Linux: Version 11.2.0.4.0 – Production
System parameter file is /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/ol65/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ol65.localdomain)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ol65.localdomain)(PORT=1521)))
STATUS of the LISTENER
————————
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 – Production
Start Date                19-MAY-2014 09:18:36
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/ol65/listener/alert/log.xml
Listening Endpoints Summary…
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ol65.localdomain)(PORT=1521)))
The listener supports no services
The command completed successfully

 

If you are just testing and playing with Oracle in this machine, you can turn firewall off (or adjust its settings according your needs):

[root@ol65 ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: nat mangle filte[  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
[root@ol65 ~]# chkconfig iptables off
[root@ol65 ~]#

Now you can finaly from client connect into database server (from AquaData Studio in my case):

014

 

4.Post-import hints

It can happen that you will export+import image with Oracle Database in other machine, etc. From my experiences with Virtualbox, network part is not as smooth as should be.

* Make sure you know your hostname (fqdn), check hostname command + /etc/sysconfig/network in RedHat(Oracle) environment

* Make sure listener is properly setup, run netca to be sure and verify lsnrctl status (services especially)

* Double check $ORACLE_HOME, $ORACLE_SID

* Double check all network-related + verify that firewall is running

-a-

 

 

This entry was posted in Databases, Oracle. Bookmark the permalink.

Napsat komentář