Thursday, July 28, 2011

Fusion Applications: Installing Oracle Database 11g for Oracle Identity Management

In my previous post I described the steps you need to take to install Oracle Enterprise Linux. As prerequisite for Oracle Fusion Applications, Oracle Identitiy Management needs to be installed and configured.

Oracle Identity Management is the equivalent of LDAP for Windows, except Oracle uses a database (surprisingly) to store its user management.

This post will describe the steps you need to take to install Oracle Database 11.2.0.2 on Oracle Enterprise Linux.

We first have to stage the installation software of Oracle Database 11.2.0.2. The installation files can be found on the first installation DVD of Oracle Fusion Applications. So we will start by coping and unpacking the installation software on Linux.

I created an install directory under /home/oracle/. Here I will stage all installation software. Within the /home/oracle/install directory I created another directory called database.

After you copy and unpack the installation files you end up with two directories, Disk1 and patch.

Directory Disk1 contains the installation files for Oracle Database 11.2.0.2. Directory patch contains patches for Oracle Database 11g that are needed for the Oracle Fusion Applications database. It is not mandory to install these patches for IDM. We will install these patches as well, what is needed for Oracle Fusion Applications database, cannot be bad to also use for the IDM database. At least we will end up with two databases (IDM, FAPP) that are at the same patch level.

Before we start the installation of the database, we need to create a so called ORACLE_BASE directory where the Oracle Database source files will reside after installation.

Log in as root and issue the following commands to create the ORACLE_BASE directory.

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

ORACLE_BASE will be /u01/app/oracle.

After this edit the .bash_profile for the oracle user and add the following lines:


Now we are ready to start the installer. Log in as user oracle and start the installer by starting a terminal session and issue  ./runInstaller



The Oracle Database installer will start and you will be presented the first screen asking you if you want to stay informed about security patches. At this screen I will choose not to be informed and click on Next. Now the installer will bring us to the screen where we choose to download and install patches with this installer.



I will choose option Skip software update. After the database is installed, we will patch the database manually with the patches that came on DVD1, mentioned prior. Click on Next and on the next screen choose the option Create and configure a database and click on Next. On the next screen you have the option to select the installation type. I will choose Desktop class to keep my database small and manageable. On the next screen we have to submit the directory where the database source files will be installed.



By the default the first three file locations are filled in like above screenshot. Make sure the Oracle base directory is the same one as we created prior.

Select AL32UTF8 as Character Set. This is mandatory for Identity Management. Supply your SID (in my case it's FIDM) and password for the database users SYS and SYSTEM and click on Next.

On the next screen you need to supply the inventory directory. Leave this default and click on Next. Now a Summary screen show with all parameters we have chosen. Click on Install and the installation of Oracle Database will start. Once all the source files are copied, the database creation starts and at the end you will be prompted with a screen where you can adjust locked users and set passwords.



We do not want to unlock any users now and we have already supplied the password for SYS and SYSTEM during the installation wizard. On this screen click on the OK button. Now a screen pops up, telling us we need to run two scripts as root before finishing the installation wizard.



Open a terminal session and execute these scripts as root. Once executed, click on OK on above screen. We will now see a screen that our database was succesfully created and that we can connect to the Enterprise Manager through a browser.



Start the url https://host:1158/em in a browser and log in with user SYSTEM and the password we supplied during installation.



Now we have succesfully created our database.

Automatic Startup


With Windows as OS we are used to Oracle Database to startup automatic when the OS is started through the use of services, which are created by the installer. With Linux we have to do this manually.

First we have to create a script which we will use to start and stop the database. Create a file called dbora in directory /etc/init.d/ with the root user. The script will look like this:
#! /bin/sh  -x
#
#     /etc/rc.d/init.d/dbora
#
# Starts Oracle Database
#
# chkconfig: 349 99 10
# description: Starts and stops Oracle DB
# processname: dbora
ORA_HOME=/u01/app/fusionapps/product/11.2.0/db_1
#
# Change the value of ORACLE to the login name of the
# oracle owner at your site.
#
ORACLE=oracle
PATH=${PATH}:$ORACLE_HOME/bin
HOST=`hostname`
PLATFORM=`uname`
export ORACLE_HOME PATH
#
if [ ! -f $ORA_HOME/bin/dbstart ]
then
   echo "Oracle startup: cannot start"
   exit
fi
#
case "$1" in
    'start')
        # Start the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        su - $ORACLE -c "$ORA_HOME/bin/dbstart $ORA_HOME"
        touch /var/lock/subsys/dbora
        ;;
    'stop')
        # Stop the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        su - $ORACLE -c "$ORA_HOME/bin/dbshut $ORA_HOME"
        rm -f /var/lock/subsys/dbora
        ;;
esac
exit

After this issue the following commands to give access to the dba group and create symbolic links so that this script will startup the database on starting Linux and will shutdown the database when Linux is shut down.



Now open file oratab in directory /etc/ and change the last character from N to Y.



Bounce Linux to see if the database comes up automatically.

Once Linux and the database are up and running, we need to change some oracle initialization parameters. Start sqlplus as SYSDBA and issue the following commands in a terminal session.

sqlplus "/ as sysdba"
alter system set session_cached_cursors=100 scope=spfile;
alter system set aq_tm_processes=1 scope=spfile;
alter system set dml_locks=200 scope=spfile;
alter system set job_queue_processes=10 scope=spfile;
alter system set open_cursors=800 scope=spfile;
alter system set session_max_open_files=50 scope=spfile;
alter system set sessions=500 scope=spfile;
alter system set processes=500 scope=spfile;
alter system set sga_target=512M scope=spfile;
alter system set sga_max_size=800M scope=spfile;
alter system set pga_aggregate_target=100M scope=spfile;

Bounce the database by issuing the following commands

. /etc/init.d/dbora stop
. /etc/init.d/dbora start

and the parameters will be set.

Patching  the database

I started the post by saying that on DVD1 of Oracle Fusion Applications the database installation files come pre-delivered with some patches.

The following patches are pre-delivered.



To install patches the database should not be running. So shutdown the database now.

To install a patch go to the directory with the patch number. On the patch root directory issue the following command.


The patch will be applied to the database.

On each patch root directory there is also a Readme file. Check this file per patch to see if there are post-installation steps that need to be taken. For some patches you need to recompile packages or run scripts.

Do this for all 20 patches.

This concludes the installation of Oracle Database 11g for IDM. In my next post, I will describe running Repository Creation Utility to create the necessary schemas.

7 comments:

  1. Kevin1:12 PM

    Hi Hakan,

    Thank you for your detailed posts on your Fusion installation. It really helps me doing the installation myself.

    Just wondering: why didn'y you use the install from the Fusion Applications Provisioning wizard which can also install the Fusion Transaction database. This wizard apparently makes a lot of specific setting to the database for Fusion Apps. Afterwards, you canadd an additional IDM database to the DBMS. I'm just determing the approach to follow for installing FA. Hope you can enlighten me a bit on this.

    Regards.

    ReplyDelete
  2. Hi Kevin,

    It was my idea to create two fysical environments (server&database), one for Fusion Applications and one for Oracle Fusion Middleware, in this case IDM. Using the Fusion Applications Provisioning wizard to create a database uses a template specific for the Oracle Fusion Applications Database. For example this will create a blank database of 51GB, this is overkill for IDM.
    For this reason I created the database for IDM manually, to keep it small and managable.

    Hakan

    ReplyDelete
  3. rinky3:11 PM

    You don't need to dick around in /etc/init.d to get your databases to start automatically. If you install the oracle grid infrastructure first, you can register your databases (plus listener & ASM if you like) so they start/stop with the OS. Normally you use the grid infrastructure for a cluster build, but it's useful also for a single instance. This is called Oracle Restart. See http://download.oracle.com/docs/cd/E14072_01/server.112/e10595/restart001.htm.

    ReplyDelete
  4. Hi Akkan,

    Thanks for the good work. I will like to know whether jdk 6 should be install for opatch to work, because i have not being able to patch my dbase.following the patching instruction.

    Regards,

    Jide

    ReplyDelete
  5. Jide,

    From the Oracle Documentation:

    Prerequisite Checks in OPatch

    Before you invoke OPatch, perform the following prerequisite checks:
    Check ORACLE_HOME Environment Variable

    OPatch verifies if the Oracle home is present. You must ensure that the ORACLE_HOME environment variable is set to the Oracle home of the product you are trying to patch. Check your respective vendor documentation for the details to set the environment variable.

    Check for JRE and JDK

    OPatch requires JDK 1.4 or higher to work properly. JRE comes as a part of JDK.

    OPatch uses the jar utility that comes with JDK for its jar, war, and ear operations. Opatch searches for JDK inside the specified Oracle home. If the Oracle home does not have JDK, you have to use the -jdk option in OPatch to provide an alternate location. OPatch displays an error if there is a jar/war/ear operation and cannot locate the Java SDK location.

    To find the version of JDK installed, execute the following command:

    JDK/bin/java -version

    Hakan

    ReplyDelete