Wednesday 23 March 2016

Install Oracle 11g Grid infrastructure for standalone server on Linux

This document describe the step to step procedure to Install Oracle 11g Grid infrastructure for standalone server on Linux.

The /etc/hosts file must contain a fully qualified name for the server.
[root@oracle123 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
192.168.xx.xx oracle123 oracle123.localdomain


I'm using Virtual Box. so first need to configure local yum repository to install the required OS packages for Oracle Grid and Database.

Below are steps to configure the Local yum repository.

cd /etc/yum.repos.d/
[root@oracle123 yum.repos.d]# vi public-yum-ol6.repo
[root@oracle123 yum.repos.d]# cat public-yum-ol6.repo
[public_ol6_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=file:///mnt/Server
#gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6
gpgcheck=0
enabled=1

[root@oracle123 yum.repos.d]# mount /dev/sr0 /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only


After configuring Local yum repository.Install the following packages if they are not already present.


yum install binutils-2*x86_64*
yum install glibc-2*x86_64* nss-softokn-freebl-3*x86_64*
yum install glibc-2*i686* nss-softokn-freebl-3*i686*
yum install compat-libstdc++-33*x86_64*
yum install glibc-common-2*x86_64*
yum install glibc-devel-2*x86_64*
yum install glibc-devel-2*i686*
yum install glibc-headers-2*x86_64*
yum install elfutils-libelf-0*x86_64*
yum install elfutils-libelf-devel-0*x86_64*
yum install gcc-4*x86_64*
yum install gcc-c++-4*x86_64*
yum install ksh-*x86_64*
yum install libaio-0*x86_64*
yum install libaio-devel-0*x86_64*
yum install libaio-0*i686*
yum install libaio-devel-0*i686*
yum install libgcc-4*x86_64*
yum install libgcc-4*i686*
yum install libstdc++-4*x86_64*
yum install libstdc++-4*i686*
yum install libstdc++-devel-4*x86_64*
yum install make-3.81*x86_64*
yum install numactl-devel-2*x86_64*
yum install sysstat-9*x86_64*
yum install compat-libstdc++-33*i686*
yum install compat-libcap*

Create OS groups and user.
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle

Create the directories in which the Grid software will be installed and change the ownership to appropriate user and group and grant permissions.i will use oracle user as Grid owner.

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

In order to configure ASM, we need to add additional disks in our virtual box storage.

Select the Machine and click on settings>Storage >controller:SATA>click on green plus disk sign.

Click on create new disk.

Choose default VDI

select fixed size

Select location and Size for the disk.

It will take few minutes.

Verify the storage disks.



Check the newly added disks are available.

[root@oracle123 ~]# cat /proc/partitions
major minor  #blocks  name

  11        0    1048575 sr0
   8        0  157286400 sda
   8        1   51200000 sda1
   8        2   40960000 sda2
   8        3    5120000 sda3
   8        4          1 sda4
   8        5    4096000 sda5
   8        6   55907328 sda6
   8       16    1048576 sdb
   8       32    1048576 sdc

Use fdisk command for each disks /dev/sdb and /dev/sdc and specify values.

[root@oracle123 ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x75956adf.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-130, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-130, default 130):
Using default value 130

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.


[root@oracle123 ~]# fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x181c9051.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-130, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-130, default 130):
Using default value 130

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Verify required partitions are available.

[root@oracle123 ~]# cat /proc/partitions
major minor  #blocks  name

  11        0    1048575 sr0
   8        0  157286400 sda
   8        1   51200000 sda1
   8        2   40960000 sda2
   8        3    5120000 sda3
   8        4          1 sda4
   8        5    4096000 sda5
   8        6   55907328 sda6
   8       16    1048576 sdb
   8       17    1044193 sdb1
   8       32    1048576 sdc
   8       33    1044193 sdc1

As the root user, configure oracleasm.

[root@oracle123 ~]# oracleasm configure -i
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: oracle
Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done

Initialize the asmlib. This command loads the oracleasm module and mounts the oracleasm filesystem.

[root@oracle123 ~]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Configuring "oracleasm" to use device physical block size
Mounting ASMlib driver filesystem: /dev/oracleasm

Create the ASM disk label for each disk.

[root@oracle123 ~]# oracleasm createdisk data /dev/sdb1
Writing disk header: done
Instantiating disk: done
[root@oracle123 ~]# oracleasm createdisk FRA /dev/sdc1
Writing disk header: done
Instantiating disk: done

Check that the disks are visible.

[root@oracle123 ~]# oracleasm listdisks
DATA
FRA

Check the disks are mounted in the oracleasm filesystem.

[root@oracle123 ~]# ls -l /dev/oracleasm/disks
total 0
brw-rw----. 1 oracle dba 8, 17 Mar 19 13:52 DATA
brw-rw----. 1 oracle dba 8, 33 Mar 19 13:53 FRA

ASM disk groups are ready to use in Grid configuration.

Copy the Grid binaries and unzip.

[root@oracle123]# unzip p13390677_112040_Linux-x86-64_3of7.zip

RunInstaller as Grid owner user.i'm using Oracle user.

[oracle@oracle123]$ ./runInstaller


Skip software updates.

Select Configure Oracle Grid Infrastructure for a Standalone Server.

Select language

if you are not able to see the disks. Click on change discovery path and specify location of ASM disks.

Enter disk group name, select redundancy and select disk.

Specify password for ASM accounts and remember it. During database installation when we choose ASM storage type it will prompt for password.

Ignore the message as i'm not using recommended asm groups. In real time create all oracle recommended groups.

Specify the ORACLE_BASE and ORACLE_HOME locations.

Location for orainventory.

Check if all prerequisites are met and succeeded.

Review the Summary and click on install.

 At the end you will see the Successful installation message.


After successful installation. check the Grid and ASM status.

[oracle@oracle123 bin]$ ./crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.DATA.dg    ora....up.type ONLINE    ONLINE    oracle123   
ora....ER.lsnr ora....er.type ONLINE    ONLINE    oracle123   
ora.asm        ora.asm.type   ONLINE    ONLINE    oracle123   
ora.cssd       ora.cssd.type  ONLINE    ONLINE    oracle123   
ora.diskmon    ora....on.type OFFLINE   OFFLINE               
ora.evmd       ora.evm.type   ONLINE    ONLINE    oracle123   
ora.ons        ora.ons.type   OFFLINE   OFFLINE   

Thanks

No comments:

Post a Comment