Installing Oracle Database 11g R2 on Oracle Linux 6.3 with ASM (ENG)

On this post, i am going to show you how to install a single instance Oracle Database 11g release 2 with ASM using Oracle Enterprise Linux 6 x86_64 and role separation.

In order to setup the environment you will need:

Note: You will need your OTN login in order to download the products. If you don’t have one, go ahead and register.

I am going to use Oracle Virtual Box to setup the lab. Here are the details for the VM.

We are going to make the installation in the following order.

  1. Installing and configuring the Operating system.
  2. Installing Oracle Grid Infrastructure and ASM.
  3. Installing the Database Software and creating the Database.

Let’s Begin

PART I – Installing and configuring Oracle Enterprise Linux 6 x86_64

Once you create your VM/Server and downloaded your Linux media, boot your VM/Server to begin the installation.

Once the anaconda installer loads up, click next to begin

Select your preferred language and keyboard

Select your type for storage and continue

Setup your hostname and network interfaces and continue

Choose your time zone

Choose your root password

Select your type of installation and continue.

Next you will be prompted to choose which type of server installation you want. Here I prefer to select a custom installation to select only the packages that i need.

In the next screen select all the required packages that you need, at least include:

Once you’re done with the packages, click next to begin the installation

Click reboot to finish

When the operating system reboots, you will need to complete the setup as follows

You could create the grid user here. I prefer to do it later, click Forward to continue

Select your time to continue

Click Finnish

Now you will need to login using the root user. This is because the oracle user created by the Oracle Preinstall package does not have password. Log on and set it up

Disable the firewall. Go go System/Administration/Firewall

Depending on your environment edit your network interface as follows.

Edit your hosts file hosts file with your hostname and ip.

Reload your network as follows

Install your virtual box guest additions. This will not be necessary if you’re on a physical server or VmWare.

Create the necessary directories and the grid user.

Set the necessary permissions

Edit the file ‘/home/grid/.bash_profile’ and add the following lines to set up the grid user environment

Edit the file ‘/home/oracle/.bash_profile’ and add the following lines to set up the oracle user environment

Shutdown your system and add the necessary disks to be used as ASM disks. In this case I’ll created 3 disks

Startup you system and configure you ASM driver as the root user

Check if your disks are available

It’s time to setup the disks. As you saw in the previous screenshot, i have three additional disks named (/dev/sdb, /dev/sdc, /dev/sdd ) we need to partition each disks in order to make them available for ASM. We will use fdisk to partition them, here is the order you’ll have to follow.

  1. fdisk /dev/sdb
  2. n,p,1,1,w
  3. fdisk /dev/sdc
  4. n,p,1,1,w
  5. fdisk /dev/sdd
  6. n,p,1,1,w

Here is how it looks like:

Let’s check again our disks. You will notice that 3 more devices appear, those are the partition we created.

Next let’s disable SELinux as follows ‘vi /etc/selinux/config’

Create your ASM disks as follows

oracleam createdisk ‘DISK1’ /dev/sdb1

oracleam createdisk ‘DISK2’ /dev/sdc1

oracleam createdisk ‘DISK3’ /dev/sdd1

At this point we will have our server ready for the grid infrastructure installation.

PART II – Installing Oracle Grid Infrastructure 11.2.0.3 and ASM

In this installation we will use role separation of duties; we will proceed as the grid user who’s going to be the GRID_HOME owner

If you have downloaded all the files required, unzip the file p10404530_112030_Linux-x86-64_3of7.zip as follows

After unzipping the file, you will have a folder called “grid”. Start the installer with ./runInstaler

Skip the software updates

Select the option for a standalone server as shown in the picture

Select you languages

Create one diskgroup called DATA with disks ( DISK1, DISK2 ) with external redundancy a shown.

Specify a password for sys and asmsnmp accounts

Leave the default groups and continue

Choose the paths to de ORACLE_BASE and ORACLE_HOME

Note: 11.0.3 in the path, should be 11.2.3 if you follow OFA or you can choose whatever you want in your ORACLE_HOME path

Specify for inventory

Next the installer will perform a check on your server as shown

If the installer finds that something is not right with your server, it will tell you to run some fixup scripts. Run them as root until your good

Once ready continue with the installation

During the installation you will prompted to run two scripts a root user, run them to continue

After the installation ends click close to finnish

To verify the installation just execute the command “crsctl status resource –t” as grid user

And with sqlplus

At this point we have our Oracle Restart and ASM in place.

PART III – Installing the Database Software and creating the Database

Now we are going to install the database software as the oracle user. Unzip all the files required as follows

unzip p10404530_112030_Linux-x86-64_1of7.zip
unzip p10404530_112030_Linux-x86-64_2of7.zip

You’ll have a folder called “database” let’s get inside and ejecute the oracle installer with “./runInstaller”

If you have toy Oracle Support credencials put them in place and continue.

Skip Sofware updates if you want and continue

Select install software only and continue

Select Single instance Database installation and continue

Select your language and continue

Select enterprise Edition or the one you prefer and continue

Choose your ORACLE_BASE and ORACLE_HOME

Review your installation and click install to proceed

As the installation goes on, you will need to execute a script as the root user

At the end of the installation you will see something like this.

Now let’s create our database with dbca. As the oracle user execute the dbca

Select create a database

Select your template, this time we’re going to select general purpose

Write your Global database name and sid

Choose to configure the enterprise manager

Write in the passwords for the administrative users

Choose the storage for your database. Select ASM and write the name of your diskgroup.

Specify your asm credentials

Choose to enable or not archiving and the FRA for you database. This time we are not going to set it up. NOT RECOMMENDED IN PRODUCCTION SYSTEM.

Adjust your memory settings as you want or leave the defaults

Next review your database storage. You don’t really need yo modify anything here.

On the summary screen click “OK” to begin the creation of the database

At the end you will see a summary of the database you just created

Let’s verify

Done! We now have a fully functional single database instance using ASM for storage over Oracle Linux 6.

Good Luck!

Emmanuel

Emmanuel Avatar

Posted by

30 responses to “Installing Oracle Database 11g R2 on Oracle Linux 6.3 with ASM (ENG)”

  1. The Oracle Database 11g Software (11.2.0.3) isn’t free, you will need the support license to download.

    1. You are right. If you dont have a support licence you can use the 11.2.0.1(2)

  2. Hi Emmanuel,
    Why don’t have used asmlib ?
    with the discovering path “ORCL:*”
    Pierre

    1. Hi Pierre,

      You can use orcl:* in the discovery path as well. I just like to use the default path where ASMLIB create the disks.

      Regards.

  3. Have you try to use ADVM/ACFS ?
    Pierre

    1. Yes,

      In order to prepare for the 1z0-058 you must have a good understanding of ADVM and ACFS. By the way, i’m working in a tutorial to make a cold failover single instance database. We’ll make use of some of that.

      Regards.

  4. dingga fatih bahtera dp Avatar
    dingga fatih bahtera dp

    Hi emmanuel,

    I’ve finished istalled ASM (11.2.0.3), but when I tried installing oracle database, I can’t install the oracle database 11g R2, here is the output:
    ===========
    [oracle@bahteralab ~]$ cd database/
    [oracle@bahteralab database]$ ./runInstaller
    You do not have sufficient permissions to access the inventory ‘/u01/app/oraInventory’. Installation cannot continue. It is required that the primary group of the install user is same as the inventory owner group. Make sure that the install user is part of the inventory owner group and restart the installer.: Permission denied
    [oracle@bahteralab database]$
    =========

    any impact to ASM if I change the owner “/u01/app/oraInventory” from to owner grid to be owner oracle?
    I need your help to resolve this error.

    Many Thanks,

    1. Hi Dingga

      Changing the owner of the inventory will not cause any problems to the existing installation. you could do it with chown oracle:oinstall. Before doing that make sure that oracle is part of the dba/oinstall group. It’s strange that you are facing that issue if you changed the ownership to grid:oinstall when installing the clusterware.

      Regards.

      1. Hi Emmanuel,

        The problem has been solved after I executed the command usermod -g oinstall -G dba,asmdba,oper oracle.
        Installation oracle database 11g has been finished.
        but I found the new issue after I execute command
        create SPFILE from PFILE, below is the output:
        ====
        SQL> create SPFILE from PFILE=’/u01/app/oracle/product/11.0.3/db1/dbs/init.ora’;

        File created.

        SQL> startup nomount
        ORA-48108: invalid value given for the diagnostic_dest init.ora parameter
        ORA-48140: the specified ADR Base directory does not exist [/u01/app/oracle/product/11.0.3/db1/dbs/]
        ORA-48187: specified directory does not exist
        Linux-x86_64 Error: 2: No such file or directory
        Additional information: 1
        ==========
        could you please help me to resolve the issue?

        Thanks.

  5. Hi Emmanuel,

    The issue start up has been solved, but I can’t create the database,
    ========================
    SQL> oracle@bahteralab ~]$ sqlplus / as sysdba

    SQL*Plus: Release 11.2.0.3.0 Production on Fri Mar 1 15:54:05 2013

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

    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options

    SQL> startup nomount
    ORACLE instance started.

    Total System Global Area 567869440 bytes
    Fixed Size 2230392 bytes
    Variable Size 171968392 bytes
    Database Buffers 390070272 bytes
    Redo Buffers 3600384 bytes
    SQL>
    SQL> CREATE DATABASE orcl;
    CREATE DATABASE orcl
    *
    ERROR at line 1:
    ORA-01501: CREATE DATABASE failed
    ORA-00200: control file could not be created
    ORA-00202: control file: ‘+DATA/orcl/controlfile/current.260.808585161’
    ORA-17502: ksfdcre:4 Failed to create file
    +DATA/orcl/controlfile/current.260.808585161
    ORA-15046: ASM file name ‘+DATA/orcl/controlfile/current.260.808585161’ is not
    in single-file creation form

    SQL>
    ===========

    could you please help me?

    Thanks,

    1. Hi
      You could be missing something in the create database command. Why dont you use dbca to create de database.?

  6. Hi.
    Very good this post.
    One important question: I need GRID CONTROL. But you are showing DATABASE CONTROL. But in PART II – Installing Oracle Grid Infrastructure 11.2.0.3 and ASM, you talk about GRID. I done all listed here. But , at the end, I have DATABASE CONTROL running. How to change this to GRID CONTROL ?
    Thanks.
    Formiga

    1. Oracle Grid Control is a different product that needs to be installed on its own. It is ease to confuse it with database control because the interface is very similar ( versions 10g & 11g ) but is not the same thing.

      You should check it out here: http://www.oracle.com/technetwork/oem/grid-control/downloads/index.html

      DBAs usually call GRID, CRS and Clusterware to the ASM + Clusterware component of the database server. Another thing common is to create a grid user to be the owner of those components as well.

      Regards.

  7. That seems to be some missing packages. Did you installed the oracle preinstall package as shown in the tutorial?

    1. I missed that step since i had already installed the OS and was looking for document to install ASM and found your forum and started installing directly. Can we install the package now ? What is the exact name of package

      1. HI Emmanuel
        I installed the package referred by you but still i see the same error. Could you please let me know what to do next.

  8. Hi Emmanuel

    Thanks for the detailed document. It is very helpful.
    I am stuck at a point while installing database. When i select the storage type as ASM and enter the disk name as +DATA and hit next it giving me an error as below.
    can not use ASM for database storage due to following reason: could not connect to asm due to following error ora-01031: insufficient privilege.
    Could you please help me out of this.

    1. Did you installed ASM with another user?

      1. HI Emmanuel
        Sorry for the late reply.
        I Installed GRID and ASM i.e. PART II in the above steps as grid user and the oracle software as oracle user.

  9. I missed that step since i had already installed the OS and was looking for document to install ASM and found your forum and started installing directly. Can we install the package now ? What is the exact name of package

  10. Hi,
    Yes i have already install it and still get the same error 😦 😦

    please can you test the installation with oracle 6.4 to see the error that i get?

    please i really need your help

    1. It should install pretty well if you follow the steps from the beginning. I believe there are mayor changes in 6.3. I’ll try it. And let you know.

  11. Thank you so much for your time…ill be very happy if it works for me 🙂

    Please,note also the customes packages that you will choose when installing oracle 6.4 .as so ill do the some steps like you.

    Thank you (and sorry for my english 😉

    1. Honestly, I did not understand. Do you mean If I know that package name?

  12. sorry… what i mean thats when u’ll install oracle 6.,let me know what exactly you gonna choose in “costumes package” in order to do like you

  13. Hello Emmanuel,

    First, thank you for creating such a fine and very helpful blog. This is truly a Godsend for people like my wife and myself who are Oracle newbies and wondering how to get started. We are both enrolled in Oracle classroom taught classes and are working our way through this and recognized early on that the only way we are going to truly be able to learn Oracle db and get certified so that we can work in the field is to install oracle on a home PC so that we can work all of the labs and classroom exercises. I do have a couple of questions that I am hoping you can help me with. You said up above at the beginning:

    “In order to setup the environment you will need:

    The Oracle Database 11g Software (11.2.0.3). LINK
    The Oracle Grid Infrastructure 11g Software (11.2.0.3). LINK
    The Oracle Linux 6.3 x86_64 installation CD/ISO. LINK
    A Virtual Machine/ Server with x86_64 support”

    We do not have a virtual machine. Instead, we bought a new PC and we plan on installing Oracle Linux 6.4 on it. My question is this: Will we be able to do this (install Oracle linux 6.4 on a new PC using the guidelines you outline for version 6.3?) Thank you so much for reading this and I do look forward to your reply!

    Rob

    1. Yes you can. Just follow the same steps and avoid the part of creating the vm. Remember that a vm is just like a pc or server but with virtual hardware.

  14. million thanks & appreciate for sharing such a good article/tutorial =)

  15. Usually I do not learn afticle on blogs, but I would like to say that this write-up very pressured me to
    try and doo so! Your writing style has been surprised me.
    Thanks, quite nice article.

Leave a reply to Emmanuel Cancel reply