Saturday, 3 March 2012

Oracle Database 11g R2 installation on Redhat Enterprise Linux 6

Oracle Database 11g R2 installation on Redhat Enterprise Linux 6 (64-bit)::

In this article we will learn how to install oracle database 11g Release 2 on Redhat Enterprise Linux 6 (64-bit).



Overview:
This article is a comprehensive guide for the installation of Oracle Database 11g Release 2 (11.2.0.3.0) on Redhat Enterprise Linux 6 (RHEL-6) 64-bit Operating System Environment.
Please do keep in mind that this article should not be considered a substitution of the official installation guide and release note from Oracle (http://www.oracle.com). The below mentioned link can be used to download the official installation guide for Oracle Database 11g Release 2 (11.2.0.3.0) on Linux 64-bit Operating Environment.







Objective of the Article:
By the time we finish this article, we should be able to understand the following:
(1)Installation of oracle database (11.2.0.3.0) x64 on Redhat Enterprise Linux 6 (RHEL6) x64.
(3)Creation & configuration of general-purpose Oracle 11g (11.2.0.3.0) database that makes use of the local file system for physical database file storage (control files, data files, flash recovery area, online redo log files).








Installation of RHEL6 x64:
Install Redhat Enterprise Linux 6 (RHEL6) x64 on your machine.
For More information about RHEL6 installation, visit the below site::








Network Configuration:
Edit /etc/hosts File :
Ensure that the hostname (redhat6) is not in the loopback address in the /etc/hosts file. If it is mentioned then remove the entry.

Disable Firewall :
[root@redhat6 ~]# system-config-firewall


Disable SeLinux :
[root@redhat6 ~]# system-config-selinux


Note : Reboot the node for reflecting the changes.











Download Oracle Database Software:
First we have to download the required Oracle Database software packages from the Oracle Technology Network (OTN) or Oracle Edelivery Site and then extract the Oracle Database Software packages.
Download the Oracle Database 11g Release 2 (11.2.0.3.0) Software for Linux x64 Operating System Environment.
Link for downloading oracle Database Software Package:: http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html










  Hardware Requirements Check:
Note:Login to the system as a root user for performing the below activities.
Memory Requirements:
Minimum:1 GB of RAM
Recommended:2 GB of RAM
To determine the RAM size, enter the following command:
[root@redhat6 ~]# cat /proc/meminfo | grep MemTotal
Note:If the size of the RAM is less than the required size, then you must install more memory before continuing.
Available RAM SWAP Space Requirement
Between 1 GB and 2 GB 1.5 times the size of the RAM
Between 2 GB and 16 GB Equal to the size of the RAM
More than 16 GB 16 GB
To determine the size of the configured swap space, enter the following command:
[root@redhat6 ~]# cat /proc/meminfo | grep SwapTotal
Note:If there is a need of increasing swap space, see O/S documentation for increasing the swap space.


Disk Space Requirements:
At least 1 GB of free disk space should be available in the /tmp directory.
To determine the amount of disk space available in the /tmp directory, enter the following command:
[root@redhat6 ~]# df -h /tmp
If there is less than 1 GB of free disk space available in the /tmp directory, then do one of the below mentioned steps:
Ξ Delete unnecessary files from the tmp directory.
Ξ Extend the file system that contains the /tmp directory. If necessary, contact the system administrator for information about extending file systems.
Disk space requirements for software files, and data files for each installation type on Linux x86-64:
Installation Type Minimum Requirement for Software Files (GB)
Enterprise Edition 4.35
Standard Edition 4.22
Installation Type Minimum Requirement for Data Files (GB)
Enterprise Edition 1.7
Standard Edition 1.5
To determine the amount of free disk space on the system, enter the following command:
[root@redhat6 ~]# df -kh
If your diskspace is not enough, please contact administrator for increasing the disk space.
Automatic Memory Management:
Starting with Oracle Database 11g, the Automatic Memory Management feature requires more shared memory (/dev/shm)and file descriptors. The shared memory should be sized to be at least the greater of MEMORY_MAX_TARGET and MEMORY_TARGET for each Oracle instance on that computer.To determine the amount of shared memory available, enter the following command:
[root@redhat6 ~]# df -h /dev/shm


System Architecture:
This command displays the processor type. Verify that the processor architecture matches the Oracle software release to install. If you do not see the expected output, then you cannot install the software on this system. To determine whether the system architecture can run the software, enter the following command:
[root@redhat6 ~]# uname -a




 For all the screenshots, please visit the link:::  LINK FOR STEPS-SCREENSHOT




Package Requirements Check:
After the installation of RHEL6_x64, the next task is to install all packages required by Oracle Database 11g R2 x64. During the installation process the Oracle Universal Installer (OUI) performs prerequisites checks before the actual installation of database. For ensuring that these prerequisite checks complete successfully, ensure that all the packages listed below are installed properly.The following are the list of packages required for Oracle Database 11g Release 2 (11.2) x64 on RHEL6 x64:
  • binutils-2.20.51.0.2
  • compat-libstdc++-33-3.2.3
  • compat-libstdc++-33-3.2.3 (32 bit)
  • elfutils-libelf-0.148
  • elfutils-libelf-devel-0.148
  • gcc-4.4.4
  • gcc-c++-4.4.4
  • glibc-2.12-1
  • glibc-2.12-1 (32 bit)
  • glibc-common-2.12
  • glibc-devel-2.12
  • glibc-devel-2.12 (32 bit)
  • glibc-headers-2.12
  • ksh-20100621
  • libaio-0.3.107
  • libaio-0.3.107 (32 bit)
  • libaio-devel-0.3.107
  • libaio-devel-0.3.107 (32 bit)
  • libgcc-4.4.4
  • libgcc-4.4.4 (32 bit)
  • libstdc++-4.4.4
  • libstdc++-4.4.4 (32 bit)
  • libstdc++-devel-4.4.4
  • libstdc++-devel-4.4.4 (32 bit)
  • make-3.81
  • sysstat-9.0.4
The package(s) listed above can be found on the installer disc/image of Redhat Enterprise Linux 6 x64 or can be downloaded from the vendor's website.
To determine whether the required packages are installed, enter commands similar to the following:
[root@redhat6 ~]# rpm -q package_name
if the package is not installed then install the package as mentioned below:
[root@redhat6 ~]# rpm -ivh package_name
N.B: To use ODBC, you must also install the following additional ODBC RPMs which are listed below:
  • unixODBC-2.2.14 (32-bit)
  • unixODBC-devel-2.2.14
  • unixODBC-2.2.14
The odbc packages can be downloaded from http://www.unixodbc.org and can be installed as mentioned above.







Creation of Required O/S Users and Groups:
The following local operating system user and groups are required for oracle database installation:
  • Oracle Inventory Group -- oinstall
  • OSBDA Group -- dba
  • Oracle Software Owner User -- Oracle
Check whether the groups/user exists , if doesn't exist please create them. Follow the below mentioned steps...
  1. To determine whether "oinstall" group exists, type the following command:
    [root@redhat6 ~]# more /etc/oraInst.loc
    If the output shows oinstall group then the group exists and need not to be created.
    .
  2. To determine whether "dba" group exists, type the following command:
    [root@redhat6 ~]#grep dba /etc/group
    If the output shows dba group then the group exists and need not to be created.
    .
  3. To determine whether "oracle" user exists, type the following command:
    [root@redhat6 ~]#id oracle
    If the output shows oracle user then the user exists and need not to be created.
    The output should be similar to following, indicating "oinstall" as primary and "dba" as secondary group.
    uid=1001(oracle) gid=1001(oinstall) groups=1002(dba).
    If the primary group is not "oinstall" and the user "oracle" is not the member of "dba" group then we have to modify the user "oracle" as mentioned below::
    [root@redhat6 ~]#usermod -g oinstall -G dba oracle
    .
  4. If the user or the required groups doesn't exist then create them as mentioned below:
    [root@redhat6 ~]# groupadd -g 1001 oinstall
    [root@redhat6 ~]# groupadd -g 1002 dba
    [root@redhat6 ~]# useradd -m -u 1001 -g oinstall -G dba oracle

    Now check the status of "oracle" user.
    [root@redhat6 ~]# id oracle
    The output should be similar to following, indicating "oinstall" as primary and "dba" as secondary group.
    uid=1001(oracle) gid=1001(oinstall) groups=1002(dba).

    Now set the password of "oracle" user.
    [root@redhat6 ~]# passwd oracle
    and input a password for "oracle" user.
  5.  Verify that the user "nobody" Exists:
    Before installtion of oracle software, complete the following steps to verify that the user "nobody" exists on the system:
    To determine if the user exists, enter the following command:
    [root@redhat6 ~]# id nobody
    If this command displays information about the "nobody" user, then you do not have to create that user.
    If the user "nobody" does not exist, then enter the following command to create it:
    [root@redhat6 ~]# useradd nobody
 For all the screenshots, please visit the link:::  LINK FOR STEPS-SCREENSHOT

 Configuration of Kernel Parameters:
Verify that the kernel parameters shown in the following table are set to values greater than or equal to the minimum value shown.
Using any text editor, edit the /etc/sysctl.conf file, and add or edit lines similar to the following:
 fs.aio-max-nr  1048576
 fs.file-max  6815744
 kernel.shmall  2097152
 kernel.shmmax  4294967295
 kernel.shmmni  4096
 kernel.sem  250 32000 100 128
 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  1048586
[root@redhat6 ~]# vim /etc/sysctl.conf



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:
[root@redhat6 ~]# sysctl -p



If the output of the above command shows any error, please rectify the error before proceeding to next step.
To improve the performance on Linux systems, Oracle recommends us to increase the shell limits for the oracle software owner user "oracle".
Update the resource limits in the /etc/security/limits.conf configuration file for the installation owner (Here "oracle" user is the owner).
----------------------------
oracle  soft  nproc  2047
oracle  hard  nproc  16384
oracle  soft  nofile  1024
oracle  hard  nofile  65536
oracle  soft  stack  10240
----------------------------
[root@redhat6 ~]# vim /etc/security/limits.conf\






 Creation of Required Directories:
The next step is to create a directory that will be used to store the "Oracle Database software", "Oracle Database Datafiles" and "Flash Recovery Data".
After the directory is created, we must then specify the correct owner, group, and permissions for it.
For example:
[root@redhat6 ~]# mkdir -p /u01/app/
[root@redhat6 ~]# chown -R oracle:oinstall /u01/app/
[root@redhat6 ~]# chmod -R 775 /u01/app/



 Mount Oracle Database Disc:
If the installer is in zip format then unzip it .If it is on a disc then mount the disc and copy the contents as follows:
N.B: I have created "oracle_soft" named directory for storing "oracle database installation files".
[root@redhat6 ~]# mkdir -p /oracle_soft
[root@redhat6 ~]# chown -R oracle:oinstall /oracle_soft/
[root@redhat6 ~]# chmod -R 775 /oracle_soft/






 Configuring the oracle User’s Environment:
Set the default file mode creation mask (umask) to 022 for "oracle" user. For setting so, do the following:
[root@redhat6 ~]# su - oracle
[oracle@redhat6 ~]$ vim ~/.bash_profile
Add a line as written below and save the file.
umask 022
N.B:Before starting the Oracle Universal Installer, we should first verify that the server from where we are doing the installation, have X server installed on it. For verification we can type "xclock" in the terminal, it will show a clock if X server is available.
Before starting the installation we have to run the xhost + command as root from the console to allow X Server connections.
[root@redhat6 ~]# xhost +
If we are performing installation from a remote machine then we have to give complete IP address of the remote machine, as shown below:
[oracle@redhat6 ~]$ export DISPLAY=IP_REMOTE_MACHINE:0 









  Installation of Oracle Database:
After configuring the oracle user’s environment, start Oracle Universal Installer (OUI) and install Oracle Database as follows:
[root@redhat6 ~]# su - oracle
Go to the directory where our installation software is copied and type "./runInstaller" , then our installation will begin:
[oracle@redhat6 ~]$cd /oracle_soft/dbsoft/database
[oracle@redhat6 ~]$ ./runInstaller

 Link for Installation of Oracle Database

Set Oracle User Profile:
Open the profile file and add the below mentioned lines:

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=mydb
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
umask 022
[oracle@redhat6 ~]$ vim ~/.bash_profile
Or use any editor of your choice, to edit the profile of "Oracle" user.




After editing the profile run it for checking errors and loading.
[oracle@redhat6 ~]$ . ~/.bash_profile
If there is any syntax error in the profile it will be reported.If there is no error then we will get the prompt silently.










Listener Creation:
[root@redhat6 ~]# xhost +
Open command prompt(terminal) & type “netca” as shown in the below screen:
[oracle@redhat6 ~]$ netca

 Link for Listener Creation








 Database Creation:
[root@redhat6 ~]# xhost +
Open command prompt and type "dbca", as shown in the below screenshot:
[oracle@redhat6 ~]$ dbca

 Link for Database Creation







 Connect to the Database:
Open command prompt(terminal).
[oracle@redhat6 ~]$ export ORACLE_SID=mydb
[oracle@redhat6 ~]$ sqlplus sys@mydb as sysdba
And you will be connected to the database.



For all the screenshots, please visit the link:::  LINK FOR STEPS-SCREENSHOT








No comments:

Post a Comment

Post a Comment