How To Install Oracle 11gR2 with ASM using OUI/Manual DB Creation on OEL

How To Install Oracle 11g On Oracle Enterprise Linux

BACKGROUND & OVERVIEW

The following documentation provides instructions for building an Oracle 11g R2 database with ASM residing on an Oracle Enterprise Linux Server (OS version 5.5, Kernal version 2.6.18)

ASSUMPTIONS & PRE-REQUISITES

This document expects and assumes the following:
  • The instructions are carried out by a qualified DBA, fully conversant with Oracle and Linux.
  • Access to the internet is available.
  • All necessary client software, e.g. Telnet and X-Server is available.
  • The resultant database will be standalone, i.e. not part of a cluster or failover configuration.
  • All references to SID should be replaced with correct database name as derived using the database naming standard.
  • All $variable references assume the .profile for oracle as described in the File Listingssection have been implemented and run.
  • There is only ONE database installed on the server.
  • The required Oracle Software will be loaded into /u01/app/oracle/SOFTWARE.
  • Two devices will be made available for use with ASM.
  • For the purposes of demonstrating patching, the Oct 2010 PSU (9952216) patchset will be used.

USEFUL INFORMATION

This section outlines useful information and changes to previous 10g documentation. Some have been made for cosmetic reasons, others for more practical considerations.
  • On Linux, as opposed to Solaris, the oratab and the oraInst.loc files are kept in directory/etc and a symbollic link from /var/opt/oracle is created to ensure software compatibility.
  • A new init.ora parameter called diag_dest has been set and maps to the diag directory.
  • The listener.ora file, which resides in the $ASM_HOME/network/admin directory has a new parameter called ADR_BASE_LISTENER. This parameter maps to the diag_dest.
  • There are a number of new maintenance jobs in 11g.
  • In order to get the database working with ASMOracle Grid Infrastructure will need to be installed. This should not be mistaken for Oracle Grid Control. The following guide explains how to install Oracle Grid Infrastructure.
  • Oracle 11g 64-bit installations no longer include the 32-bit libraries, therefore a seperate installation and patching process must be performed - this is described as part of the Step-By-Step Guide. See also Metalink article 883702.1 for further details.

STEP-BY-STEP GUIDE

  1. Get a UNIX administrator perform the following:
    • Check the Metalink article 169706.1 to ensure that the OEL build meets Oracle's requirements.
    • Check that the correct OS packages have been installed as detailed in the Packagessection below.
    • Set the machine to permissive mode.
      • setenforce 0
    • Install ASMLIB. At the time of writing this guide, the following Linux package had been identified by the Unix team, oracleasm-2.6.18-128.4.1.0.1.el5-2.0.5-1.el5.x86_64.rpm. This will install the following ASM 2.0 libraries
      • oracleasmlib-2.0 - The ASM libraries
      • oracleasm-support-2.0 - Utilities needed to administer ASMLib
      • oracleasm - A kernel module for the ASM library
    • Create a single partition on each device to be used by ASM.
      • fdisk /dev/mapper/
      • kpartx /dev/mapper/
    • Create the ASM disks
      • oracleasm createdisk > /dev/mapper/
  2. Ensure the Unix oracle account and dba group exists.
  3. Ensure the Oracle Enterprise Linux OS version is 5.5 or higher.
    • lsb_release -id
  4. Ensure the Oracle Enterprise Linux Kernal version is 2.6.18 or higher.
    • uname -r
  5. Ensure that shmmax is set to 4 GB minus 1 byte. This is to accomodate bug/feature detailed in Metalink article 567506.1.
    • grep -i shmmax /etc/sysctl.conf
  6. Ensure that net.ipv4.ip_local_port_range is set to 9000 to 65500
    • grep -i ip_local_port_range /etc/sysctl.conf
  7. Confirm the machine is in permissive mode. The following command should return Disabled.
    • getenforce
    • Note: This is required due to a bug/feature in Oracle.
  8. Ensure /dev/shm is large enough. It should be set to the size of the physical RAM minus an appropriate amount reserved for the OS.
    • cd /dev/shm
    • df -h .
  9. Create and run .profile
    • cd $HOME
    • . ./.profile
  10. Ensure the /u01 database file systems has been created with correct permissions and have been sized appropriately for the application - to at least 20 GB.
    • ls -ld /u01
    • df -h /u01
  11. Configure the DISPLAY variable, if not already set.
  12. Unset the ORACLE_HOME and TNS_ADMIN
    • unset ORACLE_HOME
    • unset TNS_ADMIN
  13. Set the ORACLE_BASE
    • export ORACLE_BASE=/u01/app/oracle
  14. Ensure $ORACLE_HOME/bin is NOT in the $PATH
  15. Start X-server, if not already running.
  16. Start the installer.
    • cd /u01/app/oracle/SOFTWARE/grid
    • ./runInstaller
  17. Follow the instructions as demonstrated in the Example ASM Install section below.
  18. Link /var/opt/oracle/oratab to /etc/oratab
    • ln -s /etc/oratab /var/opt/oracle/oratab
  19. Create additional ASM Disk Groups
    • . oraenv
      • +ASM
    • sqlplus / as sysasm
    • create diskgroup REC00 EXTERNAL REDUNDANCY disk 'ORCL:VOL2';
    • exit
  20. Remove old init.ora files
    • cd $ORACLE_HOME/dbs
    • rm init.ora
  21. Configure the DISPLAY variable, if not already set.
  22. Start X-server, if not already running.
  23. Unset the ORACLE_SIDORACLE_HOME and TNS_ADMIN
    • unset ORACLE_SID
    • unset ORACLE_HOME
    • unset TNS_ADMIN
  24. Start the installer.
    • cd /u01/app/oracle/SOFTWARE/database
    • ./runInstaller
  25. Follow the instructions as demonstrated in the Example Database Install section below.
  26. Use vi to add SID entry to /etc/oratab
    • SID:/u01/app/oracle/product/11.2.0/dbhome:Y
  27. Patch the database software home
    • . oraenv
      • SID
    • cd /u01/app/oracle/SOFTWARE/PATCH/PSU_OCT_2010/9952216
    • opatch apply
      • Y
      • Y
  28. Patch the ASM software home
    • . oraenv
      • +ASM
    • crsctl stop has
    • Confirm the clusterware has stopped.
    • cd /u01/app/oracle/SOFTWARE/PATCH/PSU_OCT_2010/9952216
    • opatch apply
      • Y
      • Y
    • crsctl start has
    • Confirm the clusterware has started.
      • Note: The +REC00 diskgroup will not restart.
    • srvctl start diskgroup -g REC00
  29. Create the SID database.
    • . oraenv
      • SID
    • mkdir -p /u01/app/oracle/admin/SID/pfile
    • mkdir -p /u01/app/oracle/admin/SID/create
    • Create an appropriate /u01/app/oracle/admin/SID/pfile/initSID.ora file - File Listings section.
    • Create /u01/app/oracle/admin/SID/create/createdb.sql file - File Listings section.
    • cd $ORACLE_HOME/dbs
    • rm init.ora
    • ln -s /u01/app/oracle/admin/SID/pfile/initSID.ora initSID.ora
    • cd /u01/app/oracle/admin/SID/create
    • sqlplus / as sysdba
      • @createdb.sql
        • SID
      • Note: This can take 10 mins to complete…
      • set echo off
      • Identifiy the values for the Control File parameter using v$parameter.
      • exit
    • Use the control file information to update/u01/app/oracle/admin/SID/pfile/initSID.ora
    • sqlplus / as sysdba
      • shutdown immediate
      • startup
      • create spfile from pfile;
      • shutdown immediate
      • exit
    • cd $ORACLE_HOME/dbs
    • rm initSID.ora
    • sqlplus / as sysdba
      • startup
      • shutdown immediate
      • exit
    • srvctl add database -d SID -o /u01/app/oracle/product/11.2.0/dbhome
    • srvctl modify database -d SID -a "DATA00,REC00"
    • srvctl start database -d SID
  30. Confirm database, ASM and clusterware can stop and start correctly.
    • . oraenv
      • +ASM
    • crsctl stop has
    • Confirm the clusterware stack has stopped.
    • crsctl start has
    • Confirm the clusterware stack has started.
  31. Configure archive logging and switch off the recycle bin.
    • . oraenv
      • SID
    • sqlplus / as sysdba
      • alter system set log_archive_dest='+REC00' scope=spfile;
      • purge dba_recyclebin;
      • alter system set recyclebin=off scope=spfile;
      • shutdown immediate
      • startup
      • alter system switch logfile;
      • exit
  32. Configure and run an archive log backup.
    • export DATE=‘date ’+%d%m%y_%H%M%S'‘
    • . oraenv
      • SID
    • rman target /
      • configure controlfile autobackup on;
      • crosscheck archivelog all;
      • backup format ’rman_${ORACLE_SID}_${DATE}_%U_%t' archivelog all delete input;
      • exit
  33. Configure security measures.
    • . oraenv
      • SID
    • sqlplus / as sysdba
      • revoke execute on utl_file from public;
      • revoke execute on dbms_random from public;
      • revoke execute on utl_http from public;
      • revoke execute on utl_smtp from public;
      • revoke execute on utl_tcp from public;
      • alter database default tablespace users;
      • alter user outln password expire account lock;
      • exit
  34. Configure orapw file.
    • . oraenv
      • SID
    • cd $ORACLE_HOME/dbs
    • orapwd file=orapwSID password=
  35. Configure & test SQL*Net.
    • . oraenv
      • SID
    • cd $ORACLE_HOME/network/admin
    • rm -r samples
    • Create an appropriate tnsnames.ora file - File Listings section.
    • chmod 755 tnsnames.ora
    • sqlplus system/@SID
      • exit
  36. Configure the DISPLAY variable, if not already set.
  37. Start X-server, if not already running.
  38. Unset the ORACLE_SIDORACLE_HOME and TNS_ADMIN
    • unset ORACLE_SID
    • unset ORACLE_HOME
    • unset TNS_ADMIN
  39. Start the installer.
    • cd /u01/app/oracle/SOFTWARE/client
    • ./runInstaller
  40. Follow the instructions as demonstrated in the Example 32-bit Install section below.
  41. Patch the 32-bit software home
    • export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome32
    • cd /u01/app/oracle/SOFTWARE/PATCH/PSU_OCT_2010_32/9952216
    • opatch apply
      • Y
      • Y
  42. Confirm the environment can survive a server reboot by getting the Unix Administrator to perform a box bounce.
    • After the box has restarted, confirm that the oracle software stack has restarted correctly.

PACKAGES

OS PACKAGES FOR ORACLE ENTERPRISE LINUX V5

The following OS packages at the following minimum version should be installed on Oracle Enterprise Linux v5 before starting the Oracle software install.
  • Correct as of 01 September 2009
  • 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
  • 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)

ORACLE SOFTWARE

  • Oracle 11gR2 for Linux Operating System (64-bit)
    • linux.x64_11gR2_database_1of2.zip : 1,239,269,270 bytes; cksum - 3152418844
    • linux.x64_11gR2_database_2of2.zip : 1,111,416,131 bytes; cksum - 3669256139
    • linux.x64_11gR2_grid.zip : 1,052,897,657 bytes; cksum - 3369676398
    • linux_11gR2_client.zip : 642,016,988 bytes; cksum - 1997033971

FILE LISTINGS


oracle .profile

#----------------------------------------------------------------------
# Configure Terminal Settings.
#----------------------------------------------------------------------

stty susp ^Z
stty quit ^C
stty erase ^?
export TERM=vt100-w
export ORACLE_TERM=vt100

#----------------------------------------------------------------------
# Configure Shell Settings.
#----------------------------------------------------------------------

set -o vi
export PATH=/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/ccs/bin:$PATH
export EDITOR=vi
export HOSTNAME=`hostname`
export PS1='$LOGNAME@$HOSTNAME:$ORACLE_SID> '
export TMPDIR=/tmp
export TEMP=/tmp
export TMOUT=7200
umask 022

#----------------------------------------------------------------------
# Configure Aliases.
#----------------------------------------------------------------------

alias ll="ls -la"
alias bdf="df -h"

#----------------------------------------------------------------------
# Configure Oracle Settings.
#----------------------------------------------------------------------

export ORACLE_BASE=/u01/app/oracle
export SQLPATH=$ORACLE_BASE/DBA/SQL
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome
export TNS_ADMIN=$ORACLE_HOME/network/admin
export OPATCH_LIB=/u01/app/oracle/SOFTWARE/OPATCH/OPatch
export PATH=$ORACLE_HOME/bin:$PATH:$OPATCH_LIB
export ORA_CRS_HOME=/u01/app/oracle/product/11.2.0/grid

createdb.sql

--
-- Title : createdb.sql
-- Description : Build an empty database.
--
-- Usage/Notes : For use with 11g databases.
-- Required answers for SYS,
-- SYSTEM and SID.
--
--

ACCEPT syspw PROMPT 'Enter SYS password : '
ACCEPT systpw PROMPT 'Enter SYSTEM password : '
ACCEPT sid PROMPT 'Enter SID name : '

SET VERIFY OFF
SET ECHO ON

SPOOL createdb.log

STARTUP NOMOUNT

CREATE DATABASE &sid
USER SYS IDENTIFIED BY &syspw
USER SYSTEM IDENTIFIED BY &systpw
MAXDATAFILES 1024
MAXINSTANCES 1
MAXLOGFILES 32
MAXLOGMEMBERS 4
MAXLOGHISTORY 100
CHARACTER SET AL32UTF8
ARCHIVELOG
DATAFILE '+DATA00'
SIZE 1000m
EXTENT MANAGEMENT LOCAL
SYSAUX DATAFILE '+DATA00'
SIZE 500m
LOGFILE
GROUP 1 ('+DATA00')
SIZE 50m,
GROUP 2 ('+DATA00')
SIZE 50m,
GROUP 3 ('+DATA00')
SIZE 50m,
GROUP 4 ('+DATA00')
SIZE 50m
UNDO TABLESPACE undo
DATAFILE '+DATA00'
SIZE 500m
DEFAULT TEMPORARY TABLESPACE temp
TEMPFILE '+DATA00'
SIZE 500m
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1m
/

SET ECHO OFF

PROMPT
PROMPT
PROMPT Now running CATALOG. Please wait..
PROMPT
PROMPT

SET TERMOUT OFF

@${ORACLE_HOME}/rdbms/admin/catalog

SET TERMOUT ON

PROMPT
PROMPT
PROMPT Now running CATBLOCK. Please wait..
PROMPT
PROMPT

SET TERMOUT OFF

@${ORACLE_HOME}/rdbms/admin/catblock

SET TERMOUT ON

PROMPT
PROMPT
PROMPT Now running CATPROC. Please wait..
PROMPT
PROMPT

SET TERMOUT OFF

@${ORACLE_HOME}/rdbms/admin/catproc

SET TERMOUT ON

SET ECHO ON

CREATE TABLESPACE tools
DATAFILE '+DATA00' SIZE 500m
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
SEGMENT SPACE MANAGEMENT AUTO
/

CREATE TABLESPACE users
DATAFILE '+DATA00' SIZE 500m
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
SEGMENT SPACE MANAGEMENT AUTO
/

CREATE TABLESPACE indx
DATAFILE '+DATA00' SIZE 500m
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
SEGMENT SPACE MANAGEMENT AUTO
/

CREATE USER ops$oracle IDENTIFIED EXTERNALLY
DEFAULT TABLESPACE users
/

GRANT DBA TO ops$oracle
/

CONN system/&systpw

SET ECHO OFF

PROMPT
PROMPT
PROMPT Now running PUPBLD. Please wait..
PROMPT
PROMPT

SET TERMOUT OFF

@?/sqlplus/admin/pupbld.sql

SET TERMOUT ON

CONN system/&systpw

SET ECHO OFF

PROMPT
PROMPT
PROMPT Now running HLPBLD. Please wait..
PROMPT
PROMPT

SET TERMOUT OFF

@?/sqlplus/admin/hlpbld.sql

SET TERMOUT ON
SET ECHO ON

SPOOL OFF

init.ora

###########################################
# Cache and I/O
###########################################
db_block_size=8192
memory_target=1606418432
db_block_checking=MEDIUM
db_block_checksum='FULL'

###########################################
# Cursors and Library Cache
###########################################
open_cursors=500

###########################################
# Database Identification
###########################################
compatible='11.2.0.0.0'
db_name='SID'

###########################################
# Diagnostics and Statistics
###########################################
diagnostic_dest='/u01/app/oracle'

###########################################
# File Configuration
###########################################
control_files='+DATA00','+REC00'

###########################################
# Processes
###########################################
processes=1000

###########################################
# System Managed Undo and Rollback Segments
###########################################
undo_tablespace='UNDO'

###########################################
# Security and Auditing
###########################################
audit_trail='db'
remote_login_passwordfile='EXCLUSIVE'

###########################################
# Enabling Archivelog mode
###########################################
log_archive_format=arch_%t_%s_%r.log

###########################################
# Defer Segment Creation
###########################################
deferred_segment_creation=FALSE

tnsnames.ora

 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = tcp)(HOST = )(PORT = 1521))
    (CONNECT_DATA =
      (SID = )
    )
  )

EXAMPLE ASM INSTALL


ogi1.jpg
  • Select Install and Configure Grid Infrastructure for a Standalone Server
  • Click Next

ogi2.jpg
  • Ensure English & English (United Kingdom) languages are selected
  • Click Next

ogi3.jpg
  • Set Disk Group Name to DATA00
  • Ensure the Redundancy radio button is set to External
  • Ensure the Candidate Disk radio button is selected
  • Tick the box next to the candidate disk(s) required for the +DATA00 diskgroup
  • Click Next

ogi4.jpg
  • Select Use same passwords for these accounts
  • Enter a valid and appropriately secure password in the Specify Password box
  • Re-enter the password in the Confirm Password box
  • Click Next

ogi5.jpg
  • Set the ASM Database Administrator (OSDBA) Group to dba
  • Set the ASM Instance Administration Operator (OSOPER) Group to dba
  • Set the ASM Instance Administrator (OSASM) Group to dba
  • Click Next

ogi6.jpg
  • Click Yes to continue.

ogi7.jpg
  • Ensure Oracle Base is set to /u01/app/oracle
  • Ensure Software Location is set to /u01/app/oracle/product/11.2.0/grid
  • Click Next

ogi8.jpg
  • Ensure the Inventory Directory is set to /u01/app/oraInventory
  • Click Next

ogi9.jpg
  • Review the Summary screen
  • Click Finish

ogi10.jpg
  • Wait approx 5 mins for install to complete…

ogi11.jpg
  • As root, ask the UNIX administrator to run /u01/app/oraInventory/orainstRoot.sh
  • As root, ask the UNIX administrator to run /u01/app/oracle/product/11.2.0/grid/root.sh
    • Enter /usr/local/bin
  • Click OK

ogi12.jpg
  • Wait for configuration to complete…

ogi13.jpg
  • Click Close


EXAMPLE DATABASE INSTALL


11gOracleInstall_01.jpg
  • Un-tick the I wish to receive security updates via My Oracle Support box
  • Click Next

11gOracleInstall_02.jpg
  • Click Yes to remain uninformed

11gOracleInstall_03.jpg
  • Select Install database software only
  • Click Next

11gOracleInstall_04.jpg
  • Ensure Single instance database installation is selected
  • Click Next

11gOracleInstall_05.jpg
  • Ensure English & English (United Kingdom) languages are selected
  • Click Next

11gOracleInstall_06.jpg
  • Select the required edition, e.g. Standard Edition
  • Click Next

11gOracleInstall_07.jpg
  • Ensure Oracle Base is set to /u01/app/oracle
  • Ensure Software Location is set to /u01/app/oracle/product/11.2.0/dbhome
  • Click Next

11gOracleInstall_08.jpg
  • Ensure Database Administrator (OSDBA) Group is set to dba
  • Ensure Database Operator (OSOPER) Group is set to dba
  • Click Next

11gOracleInstall_09.jpg
  • Review the summary
  • Click Finish

11gOracleInstall_10.jpg
  • Wait approx 5 mins for install to complete…

11gOracleInstall_11.jpg
  • As root, ask the UNIX administrator to run/u01/app/oracle/product/11.2.0/dbhome/root.sh
    • Enter /usr/local/bin
    • Enter Y
    • Enter Y
    • Enter Y
  • Click OK

11gOracleInstall_12.jpg
  • Click Close


EXAMPLE 32-BIT INSTALL


11gOracle32Install_01.jpg
  • Ensure Administrator is selected
  • Click Next

11gOracle32Install_02.jpg
* Ensure English & English (United Kingdom) languages are selected
* Click Next

11gOracle32Install_03.jpg
  • Ensure Oracle Base is set to /u01/app/oracle
  • Ensure Software Location is set to /u01/app/oracle/product/11.2.0/dbhome32
  • Click Next

11gOracle32Install_04.jpg
  • Review the summary
  • Click Finish

11gOracle32Install_05.jpg
  • Wait approx 5 mins for install to complete…

11gOracle32Install_06.jpg
  • As root, ask the UNIX administrator to run/u01/app/oracle/product/11.2.0/dbhome32/root.sh
    • Enter /usr/local/bin
    • Enter Y
    • Enter Y
    • Enter Y
  • Click OK

11gOracle32Install_07.jpg
  • Click Close

No comments: