oracle database 11g release 2 installation on rhel

Upload: husseingabriel

Post on 13-Oct-2015

91 views

Category:

Documents


7 download

DESCRIPTION

Instalacion de Oracle 11g

TRANSCRIPT

Oracle Database 11g Release 2 Installation on RHEL/CentOS 6.x/5.x/4.xByNarad ShresthaUnder:OracleOn:September 23, 2013As we all knowOracle databaseis the most popular and widely usedRelational Database Management System (RDBMS)in the world. This post describes step by step installation ofOracle Database 11g Release 2 32bit on CentOS 6.4 32bit. The installation steps should not be vary on most of theRed Hatbased Linux distributions.

Installing Oracle Database 11g Release 2Step 1: Install Oracle DependenciesWe use oracle-rdbms-server-11gR2-preinstall package offered by Oracle Public Yum repository. The Oracle public yum repository provides a free and easiest way to install all the latest Oracle Linux dependencies automatically. To setup yum repository, follow the instructions provided below.Use wget command to Download appropriate yum configuration file under/etc/yum.repos.d/directory asrootuser.RHEL/CentOs 6.x# cd /etc/yum.repos.d# wget https://public-yum.oracle.com/public-yum-ol6.repoRHEL/CentOs 5.x# cd /etc/yum.repos.d# wget https://public-yum.oracle.com/public-yum-el5.repoRHEL/CentOs 4.x# cd /etc/yum.repos.d# wget https://public-yum.oracle.com/public-yum-el4.repoNow perform the following yum command to install all the necessary prerequisites automatically.[root@oracle]# yum install oracle-rdbms-server-11gR2-preinstallWhile importingGPGkey, you might get GPG key retrieval failed error as shown below. Here, you need to import properGPGkey for yourOSrelease.Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracleGPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracleDownload and verify the appropriate Oracle LinuxGPGKey that best matches yourRHEL/CentOScompatible OS release.RHEL/CentOs 6.x# wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracleRHEL/CentOs 5.x# wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracleRHEL/CentOs 4.x# wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-el4 -O /usr/share/rhn/RPM-GPG-KEY-oracleStep 2: Setting HostnameOpen the /etc/sysconfig/network file and modify theHOSTNAMEto match yourFQDN(Fully Qualified Domain Name) host name.[root@oracle]# vi /etc/sysconfig/networkHOSTNAME=oracle.tecmint.comOpen /etc/hosts file and add fully qualified hostname for the server.[root@oracle]# vi /etc/hosts192.168.246.128oracle.tecmint.comoracleNow you need torestart networkingon the server to make sure that changes will be persistent onreboot.[root@oracle]# /etc/init.d/network restartStep 3: Oracle User SettingsSet the password for the oracle user.[root@oracle]# passwd oracle

Changing password for user oracle.New password:BAD PASSWORD: it is based on a dictionary wordRetype new password:passwd: all authentication tokens updated successfully.Add the entry to file /etc/security/limits.d/90-nproc.conf as described below.[root@oracle]# vi /etc/security/limits.d/90-nproc.conf# Default limit for number of user's processes to prevent# accidental fork bombs.# See rhbz #432903 for reasoning.

* soft nproc 1024# To this* - nproc 16384Set SELinux to permissive mode by editing the file /etc/selinux/config.[root@oracle]# vi /etc/selinux/configSELINUX=permissiveOnce youve made change, dont forger torestart the serverto reflect new changes.[root@oracle]# rebootLogin asOracleuser and open file .bash_profile, which is available on oracle users home directory, make an entries as described below. Make sure you set correct hostname to ORACLE_HOSTNAME=oracle.tecmint.com.[root@oracle]# su oracle[oracle@oracle ~]$ vi .bash_profile# Oracle SettingsTMP=/tmp; export TMPTMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=oracle.tecmint.com; export ORACLE_HOSTNAMEORACLE_UNQNAME=DB11G; export ORACLE_UNQNAMEORACLE_BASE=/u01/app/oracle; export ORACLE_BASEORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOMEORACLE_SID=DB11G; export ORACLE_SIDPATH=/usr/sbin:$PATH; export PATHPATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATHCLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH export PATHSwitch torootuser and issue the following command to allowOracleuser to accessX Server.[root@oracle]# xhost +Create the directories and set the appropriate permissions in which the Oracle software will be installed.[root@oracle]# mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1[root@oracle]# chown -R oracle:oinstall /u01[root@oracle]# chmod -R 775 /u01Step 4: Downloading Oracle SoftwareSign-up and Download the Oracle software using the following link. Oracle Database 11g Release 2

Download Oracle 11g Release 2The Oracle package contains2 zipfiles which you must first accept thelicense agreementbefore downloading. Ive given the files names for you reference, please download these files for your system architecture somewhere under /home/oracle/.For Linux x86 Systemshttp://download.oracle.com/otn/linux/oracle11g/R2/linux_11gR2_database_1of2.zip

http://download.oracle.com/otn/linux/oracle11g/R2/linux_11gR2_database_2of2.zipFor Linux x86-64 Systemshttp://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_1of2.zip

http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_2of2.zipStep 5: Oracle InstallationNow lets start Oracle installation. First of all need to switch asoracleuser to install database.[oracle@oracle ~]$ su oracleExtract compressed Oracle database source files to the same directory /home/oracle/.[oracle@oracle ~]$ unzip linux_11gR2_database_1of2.zip

[oracle@oracle ~]$ unzip linux_11gR2_database_2of2.zipPost unzip source file, directory calleddatabasewill be created, go to inside the directory and execute below script to start Oracle database installation process.[oracle@oracle database]$ cd database

[oracle@oracle database]$ ./runInstaller1.RunInstallerwill callOracle Universal Installer (OUI), wherein look and feel & steps are the same across all the operating system.

Oracle Universal Installer2.Provide youremail addressto be informed of security issues and receive security updates.

Configure Oracle Security Updates3.Create and Configure aDatabase

Create Oracle Database4.Choose the system class, eitherDesktoporServer.

Select Oracle System Class5.Select the type ofdatabase installationyou want to perform.

Select Database Installation Type6.Select Typical install option to install full oracle installation with basic configuration.

Select Typical Install7.SetAdministrative passwordand perform full Database installation with basic configuration.

Set Oracle Administrative Password8.Please click on Yes to continue with installation.

Typical Install Configuration Confirm9.CreateInventory

Create Inventory10.If you faced prerequisites warning during installation. Click on Fix & Check Again. Oracle fixes Prerequisites by itself. This is the new feature ofOracle Database 11g.

Perform Prerequisite ChecksThepdkshpackage is not available inOracle repositorydue to which you need to download and install it manually.[root@oracle]# wget ftp://rpmfind.net/linux/redhat-archive/6.2/en/os/i386/RedHat/RPMS/pdksh-5.2.14-2.i386.rpmDuringpdkshpackage installation you may encountered conflict error ofkshpackage. Removekshpackage forcefully and install thepdkshpackage with given below command:-[root@oracle]# rpm -e ksh-20100621-19.el6_4.4.i686 --nodeps[root@oracle]# rpm -ivh pdksh-5.2.14-2.i386.rpm11.Performing Prerequisite checks: Its test whether sufficient totalSWAPspace is available on the system.

Performing Prerequisite SWAP Check12.Installation Summary: Click onSave Response File. This file is useful forOracle Silent Mode Installation

Oracle Installation Summary13.Save Response Filesomewhere in your system.

Save Response File14.ProductInstallation Progress

Product Install15.Copyingdatabasefiles

Copying Database Files16.Click on Password Management.

Oracle Password Management17.Set password for user SYS and click onOKto continue.

Set SYS User Password18.Configuration scripts need to be executed as the root user. Go to the path given in the screen and execute the scripts one by one. Click onOK once scripts is executed.

Execute Configuration Scripts[root@oracle]# cd /u01/app/oraInventory[root@oracle oraInventory]# ./orainstRoot.shChanging 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@oracle]# cd /u01/app/oracle/product/11.2.0/dbhome_2/[root@oracle dbhome_2]# ./root.shRunning 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_2

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 byDatabase Configuration Assistant when a database is createdFinished running generic part of root.sh script.Now product-specific root actions will be performed.Finished product-specific root actions.19.The installation ofOracle Databaseis successful.

Oracle Installation Finish20.To test yourOracle installationnavigate to web based management interface for your system at localhost with the user name SYS connecting as SYSDBA and using thepasswordyou set during the install of Oracle. Remember to open port1158on your firewall and restart theiptablesservice.[root@oracle]# iptables -A INPUT -p tcp --dport 1158 -j ACCEPT[root@oracle]# service iptables restarthttps://localhost:1158/em/

Oracle Enterprise Manager Login21.Oracle EnterpriseDatabase Control Manager

Oracle Database Control ManagerNow you can start usingOracle. I highly recommend you to follow theOracle Documentationfor more help. There are number of client applications out there which can help you, like the command line tool calledOracle Instant Clientand theOracle SQL Developer UIprogram.This is end of theOracle Database Software Installation. In our upcoming article we will be covering how to create database usingDBCAand how toStart-upandShutdownOracle Database. Please stay tuned!!!