Sunday, October 7, 2012

Step By Step: Installing Oracle 11g R2 on Oracle Enterprise Linux without GUI (Graphical User Interface)

Prerequisites Software

In this guide the below versions are used
  • VMware Workstation v7.0.1
  • Oracle Enterprise Linux v5.7 64 bit 
  • Oracle Database 11g R2 64-bit for Linux 
  • Cygwin v1.7.16-1

Table of Context
1. Installation of VMware Workstation
2. Creation of Oracle Enterprise Linux Virtual Machine
3. Installation of Oracle Enterprise Linux
4. Installation of Cygwin
5. Connection between Host and Guest
6. Oracle Linux pre-installation steps for Oracle Database 11g R2
7. Installation of Oracle Database
8. Oracle Linux post-installation steps for Oracle Database 11g R2


Installation of VMware Workstation

Installation of VMware Workstation is not covering here because it is straightforward. Just install it, start it.

Creation of Oracle Enterprise Linux Virtual Machine 

Open VMware Workstation and go to File > New > Virtual Machine (CTRL + N)



Choose custom and press next.



Choose installer disc image file (iso) option and browse to the oracle enterprise linux downloaded file. My file is located at D:\Meine\Programe\Oracle\OracleLinux-R5-U7-Server-x86_64-dvd.iso. If the file is not yet downloaded, choose i will install the operating system later. Press next.



Choose Linux - Oracle Enterprise Linux operating system, in my case 64-bit version. Press next.



Put a name for your virtual machine and the location where you want to install it. In my case Oracle DB. Press next.

Choose the maximum number of processors and maximum number of cores supported. Press next.


















Specify the amount of memory allocated to this virtual machine. The memory size must be a multiple of 4MB. In my case 2048 MB. Press next.


















Use bridge network. Press next.

Select LSI Logic for SCSI adapter. Press next.


















Select create a new virtual disk. Pres next.


















Select SCSI (Recommended). Pres next.


















Choose the maximum size you want this virtual machine to occupy, in my case 40GB. Choose the second option split virtual disk into 2GB files. Press next.



Just review one more time your settings, check power on this virtual machine after creation and press finish.



Installation of Oracle Enterprise Linux

After powering on virtual machine choose install or upgrade an existing system and press enter.




If you want to check the media before installation press ok otherwise skip it. I choose to skip.

Press next.



Choose your preferred language and press next.


















Choose your preferred keypad language and press next.



Remove Linux partitions on selected drivers and create default layout. Press next


















We have to configure network devices now or later on by following How to configure IP address on Oracle Linux link. It is better to configure now to have everything in place. Click edit link and choose manual configuration for IPv4. IP address must be in the same range with host's IP. My host IP is 192.168.1.7 so i choose to put 192.168.1.3 for this virtual machine. Netmask is 255.255.255.0. It must look like 192.168.1.3/24. Disable IPv6 configuration. Manually specify hostname (oracledb.fshn.edu.al). Leave blanks for miscellaneous settings. Final configuration must be looked as below:


















Select your time zone and press next.



Put a password for root account and press next.



Check customize now check button and live blanks for additional task. Press next.



In next screen be sure that only Base System -> Base and Base System -> System Tools is checked (We have to install Oracle Linux with minimal configuration and without GUI). All the others must be unchecked. Under Base click optional packages and then check all of them. Do the same with System Tools (check all except oracle-validated-1.1.* it is used to create user, groups, install packages needed for oracle installation. We disable it because we will create all of them manually) .Press next.





















Wait for the installation to finish.



Congratulations your oracle linux server installation completed. Click the reboot button.



After the reboot the above screen appeared. Log in into it.


















A server has no need to run a GUI. It's a waste of resources to run - not just memory resources, but also CPU wise. The way to install the database is by forwarding X commands to an app that support X-Window. In my case i am using Cygwin. It is a free tool that can be download from Cygwin link.   


Installation of Cygwin

Download the software (setup.exe).

Run setup.exe and hit next until you get to the following page. Click on any of those sites and hit next.



On the next page, scroll down to X11 category and click the default so it changes to install. Your screen should look like this:



Next, we’ll want to make sure that the openssh package is installed. Click the + button next to Net and scroll down to the package called opensshClick the Skip button so it changes to a bunch of numbers/letters. Your screen should look something like this:




Hit next and wait for Cygwin to download and install. It might take a while. When it’s done, you’ll see this page.  You’re not going to need those icons, and they’ll probably just tempt you, so it’s better if you uncheck them.



Cygwin is ready to be use.


Connection between Host and Guest

Before we connect to oracle we have to configure Local Area Connection in host system so that our host can communicate with oracle virtual machine. Virtual machine has an IP of 192.168.1.3/24 (Bridge Connection) so our host must have an IP in the same range 192.168.1.7/24. Our host configuration must look as below. 


In order for host and guest to communicate we must disable firewall and SELinux in oracle virtual machine. Command is: security-config-securitylevel-tui. By using left arrow and space set security level to disabled and SELinux to disabled. Disable host firewall too.


Open a Cygwin terminal and execute ping 192.168.1.3 to see if communication is established.


Oracle Linux pre-installation steps for Oracle Database 11g R2


Kernel Parameters

After a successful Oracle Linux OS v5.7 installation, as part of the prerequisites requirements, ensure that the following Oracle recommended kernel parameters are configured or added in the /etc/sysctl.conf file with the values suggested for a successful installation, you need to be the root user to perform this action.

Open a Cygwin terminal and connect to oracle virtual machine using the following command:
ssh root@192.168.1.3
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.3' (RSA) to the list of known hosts.
root@192.168.1.3's password:
Last login: Sun Sep 30 02:37:28 2012

[root@oracledb ~]# vi /etc/sysctl.conf

Enter the following kernel parameters if any of them do not exist
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.aio-max-nr =1048576
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576

Save the file esc :wq

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


Operating system packages

Apart from the basic packages (RPM) that were installed as part of the typical operating system installation, the following additional Oracle Recommended Packages (RPM) need to be configured on virtual machine. The required packages can be found in the OS source (DVD) or you can also download them from the Internet.

Make sure your CD/DVD is connected to your virtual machine. Mount CDROM to an existing folder and point to directory Server in media.
[root@oracledb ~]# mount /dev/cdrom /home/cd
[root@oracledb ~]# cd /home/cd/Server

By using rpm -ivh command install the following packages. If installation depends on another package install that package first.

binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3 (32 bit)
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
elfutils-libelf-devel-static-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-2.5-24 (32 bit)
glibc-common-2.5
glibc-devel-2.5
glibc-devel-2.5 (32 bit)
glibc-headers-2.5
ksh-20060214
libaio-0.3.106
libaio-0.3.106 (32 bit)
libaio-devel-0.3.106
libaio-devel-0.3.106 (32 bit)
libgcc-4.1.2
libgcc-4.1.2 (32 bit)
libstdc++-4.1.2
libstdc++-4.1.2 (32 bit)
libstdc++-devel 4.1.2
make-3.81
sysstat-7.0.2
unixODBC-2.2.11
unixODBC-2.2.11 (32 bit)
unixODBC-devel-2.2.11
unixODBC-devel-2.2.11 (32 bit)
numactl-devel-0.9.8.i386

Example of a package installation without dependencies
[root@oracledb Server]# rpm -ivh compat-libstdc++-33-3.2.3-61.*
warning: compat-libstdc++-33-3.2.3-61.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:compat-libstdc++-33    ########################################### [ 50%]
   2:compat-libstdc++-33    ########################################### [100%]


Example of a package installation with dependencies
[root@oracledb Server]# rpm -ivh elfutils-libelf-devel-static-0.137-3.el5.* elfutils-libelf-devel-0.137-3.el5.*
warning: elfutils-libelf-devel-static-0.137-3.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:elfutils-libelf-devel  ########################################### [ 25%]
   2:elfutils-libelf-devel-s########################################### [ 50%]
   3:elfutils-libelf-devel-s########################################### [ 75%]
   4:elfutils-libelf-devel  ########################################### [100%]


[root@oracledb Server]# rpm -ivh kernel-headers-2.6.18-274.el5.x86_64.rpm glibc-headers-2.5-65.x86_64.rpm glibc-devel-2.5-65.* gcc-4.1.2-51.el5.x86_64.rpm
warning: kernel-headers-2.6.18-274.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:kernel-headers         ########################################### [ 20%]
   2:glibc-headers          ########################################### [ 40%]
   3:glibc-devel            ########################################### [ 60%]
   4:glibc-devel            ########################################### [ 80%]
   5:gcc                    ########################################### [100%]
[root@oracledb Server]#

gcc package installation depend on glibc-devel | glibc-headers | kernel-headers so all of them must be install in correct order.


OS groups and users

The following mandatory OS groups and Oracle software owners (user) are required.

Groups : oinstall, dba
User : oracle

As the root user, use the following commands to create OS groups and a user:

groupadd –g 500 oinstall
groupadd –g 501 dba
useradd –u 1000 –g oinstall –G dba oracle
passwd oracle

As per Oracle recommendation, the oinstall group should be configured as the primary group and the remaining group should be configured as secondary group for the Oracle software users (typically, the oracle user) on the server.


OS user settings

Once you have managed to create the necessary OS groups and users, the subsequent task is to set the limits for the user in order to improve the shell limits. You will need to add the following user limits in the /etc/security/limits.conf file:

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240

Next, add the following user session limit in the /etc/pam.d/login file:

session required pam_limits.so


Folder settings

Create the directories in which the Oracle software will be installed

mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01


Installation of Oracle Database


Oracle Database 11g R2 must be copied to virtual machine operating system. Then it must be extract with the following commands:
  • unzip linux.x64_11gR2_database_1of2.zip
  • unzip linux.x64_11gR2_database_2of2.zip
Another way is by extracting oracle into an USB flash drive and connect it to virtual machine. Mount it to an folder and it's ready to be used. Here is a post that shows how to mount USB flash drive to a linux machine, How to mount USB Flash drive on Oracle Linux. I have used the second way

Open a Cygwin terminal and start X-Window by typing startXwin command. In the X window terminal enter xhost + 192.168.1.3

Gleni@Gleni-PC ~$ xhost + 192.168.1.3
192.168.1.3 being added to access control list

Next enter to virtual machine and set DISPLAY variable to host IP.

[root@oracledb database]# su oracle
[oracle@oracledb database]$ export DISPLAY=192.168.1.7:0.0

Navigate to the folder where runInstaller is located and run the script:

[oracle@oracledb database]$ ./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 31620 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 3999 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2012-10-04_07-42-52AM. Please wait ...


The following window with appear. Enter email address and uncheck "I wish to receive security updates via My Oracle Support". Click next.




















Check "I want to remain uninformed of critical security issues in my configuration". Click continue.






















Check "Create and configure a database". Click next.






















Check the first option "Desktop Class". Click next.






















Leave the folders path as default. Since oracle have write permission on /u01 folder no permission prblems will appear. Enter password and click next. 
























Our password is weak not conform to the Oracle recommended standards. Just ignore it clicking "Yes".

















Leave the path of oraInventory as it is. Click next.






















Oracle will perform some prerequisite checks. Click Next.























Just click finish for the installation to start.























Wait for the installation to finish.






















After the creation of database finished the following summary appear. Click ok.
 






















The following scripts need to be executed as "root" user.






[root@oracledb database]# /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@oracledb database]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh

Running Oracle 11g root.sh script...



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.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.


The installation of Oracle Database was successful.




















Oracle Linux post-installation steps for Oracle Database 11g R2

Oracle environmental variables need to be set. In order not to set them manually every time we connect as oracle user, we just add the following to oracle user profile located at $HOME/.bash_profile

ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_HOME

PATH=$PATH:$ORACLE_HOME/bin
export PATH

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export LD_LIBRARY_PATH

ORACLE_SID=orcl
export ORACLE_SID

Run the following command to set environmental variables and try to connect as oracle system administrator. Run startup command and you are done.
  
[oracle@oracledb ~]$ . .bash_profile
[oracle@oracledb ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Thu Oct 4 18:18:17 2012

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

Connected to an idle instance.

SQL> startup;
ORACLE instance started.

Total System Global Area  835104768 bytes
Fixed Size                  2217952 bytes
Variable Size             528484384 bytes
Database Buffers          297795584 bytes
Redo Buffers                6606848 bytes
Database mounted.
Database opened.
SQL>

3 comments:

  1. Respekte per punen dhe mundimin qe paske bere.

    ReplyDelete
  2. Resources like the one you mentioned right here are extraordinarily useful to myself! i will be able to publish a link to the present web content on my individual journal. i'm certain my website} site guests can encounter that terribly effective.
    flash drive recovery

    ReplyDelete