Blog Archives
How to Install Oracle 11g Release 2 on OEL 5.4 on VirtualBox: Installing Grid Infrastructure
In Oracle 11g Release 2 you will find that things have changed even for single instance database installation. I will try to illustrate in this series of posts how to install a single instance Oracle 11g Release 2 database to your Linux machines.
As the first part of our installation series, we will start by installing brand new Grid Infrastructure which you might think to be a fancy name for CRS+ASM but you will find out later that it is a bit more.
VirtualBox Configuration
Here is the sufficient VirtualBox virtual hardware configuration for your 11g Release 2 playground (Keep in mind that this is the bare minimum configuration to have a painless installation. More resource is obviously better):
You are now ready to start your VirtualBox for Oracle 11g Release 2 installation.
Install Grid Infrastructure
Pre-work
There are a few important tasks in OS level we should complete before starting grid infrastructure installation.
Physical Partition Creation
The first thing is to create physical partitions over your virtual SCSI devices. Actually this is not crucial for ASM installation because ASM can use physical disk as a whole without any partition. However if you wish to create ASMLIB you will need those partitions.
[root@localhost ~]# fdisk /dev/sda Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. 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 will be corrected by w(rite)Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-261, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-261, default 261): Using default value 261Command (m for help): w The partition table has been altered!
Calling ioctl() to re-read partition table. |
Changing ASM devices ownership to oracle
Physical partitions we have created are owned by root. They should be changed to be owned by ASM user (oracle in our case) in order to make them visible for ASM discovery.
[root@localhost ~]# ls –la /dev/sd?1 brw-r—– 1 root disk 8, 1 Sep 21 05:03 /dev/sda1 brw-r—– 1 root disk 8, 17 Sep 21 05:03 /dev/sdb1 brw-r—– 1 root disk 8, 33 Sep 21 05:03 /dev/sdc1 brw-r—– 1 root disk 8, 49 Sep 21 05:03 /dev/sdd1 brw-r—– 1 root disk 8, 65 Sep 21 05:03 /dev/sde1 brw-r—– 1 root disk 8, 81 Sep 21 05:03 /dev/sdf1[root@localhost ~]# chown oracle:dba /dev/sd?1[root@localhost ~]# ls –la /dev/sd?1 brw-r—– 1 oracle dba 8, 1 Sep 21 05:03 /dev/sda1 brw-r—– 1 oracle dba 8, 17 Sep 21 05:03 /dev/sdb1 brw-r—– 1 oracle dba 8, 33 Sep 21 05:03 /dev/sdc1 brw-r—– 1 oracle dba 8, 49 Sep 21 05:03 /dev/sdd1 brw-r—– 1 oracle dba 8, 65 Sep 21 05:03 /dev/sde1 brw-r—– 1 oracle dba 8, 81 Sep 21 05:03 /dev/sdf1 |
In order to make those changes permanent (if you reboot the system Linux will set all device owners back to root otherwise) you should create a udev permission file
[root@localhost ~]# more /etc/udev/rules.d/99-oracle.rules #ASM disks KERNEL==”sda”, OWNER=”oracle”, GROUP=”dba”, MODE=”0660″ KERNEL==”sdb”, OWNER=”oracle”, GROUP=”dba”, MODE=”0660″ KERNEL==”sdc”, OWNER=”oracle”, GROUP=”dba”, MODE=”0660″ KERNEL==”sdd”, OWNER=”oracle”, GROUP=”dba”, MODE=”0660″ KERNEL==”sde”, OWNER=”oracle”, GROUP=”dba”, MODE=”0660″ KERNEL==”sdf”, OWNER=”oracle”, GROUP=”dba”, MODE=”0660″ |
Ensure /dev/shm is sufficiently sized
You should ensure that /dev/shm is minimum 256MB for a successful ASM installation (and 512-750M for RDBMS installation) with MEMORY_TARGET parameter.
[root@localhost ~]# df –ha |
Filesystem | Size | Used | Avail | Use% | Mounted on |
/dev/mapper/VolGroup00-LogVol00 | 15G | 9.9G | 3.9G | 72% | / |
proc | 0 | 0 | 0 | – | /proc |
sysfs | 0 | 0 | 0 | – | /sys |
devpts | 0 | 0 | 0 | – | /dev/pts |
/dev/hda1 | 99M | 32M | 63M | 34% | /boot |
tempfs | 125M | 0 | 125M | 0% | /dev/shm |
none | 0 | 0 | 0 | – | /proc/sys/fs/binfmt_misc |
sunrpc | 0 | 0 | 0 | – | /var/lib/nfs/rpc_pipefs |
oracleasmfs | 0 | 0 | 0 | – | /dev/oracleasm |
You can resize tempfs online by using
[root@localhost ~]# mount /dev/shm –o size=750M,remount |
In order to make this mount operation persistent you should modify the tempfs line in /etc/fstab file as follows:
[root@localhost ~]# cat /etc/fstab | grep tempfs tmpfs /dev/shm tmpfs size=750m 0 0 |
Notice that although we have VirtualBox instance with 512M memory, Linux allows us to mount tempfs with a size of 750M. This most probably due to lazy allocation of memory over tempfs.
Create installation directory and set its ownership
Final step is to create our software directory and set the required ownership to it.
[root@localhost ~]# mkdir -p /u01/app |
[root@localhost ~]# chown -R oracle:oinstall /u01/app/oracle |
Installation
![]() |
|
|
![]() |
Choose Install and Configure Grid Infrastructure for a Standalone Server option and click on Next > button. | |
![]() |
Set Selected Language language to English and click on Next > button. | |
![]() |
Next step is to perform ASM configuration for your grid. Choose External as the redundancy of DATA diskgroup. Now click on Change Discovery Path… button to define asm_diskstring parameter. | |
![]() |
Set Disk Discovery Path to /dev/sd?1 and click on OK | |
![]() |
Since /dev/sd?1 matches all six SCSI partitions and they are not members of any other diskgroup, installer will list all of them as Candidate disks.Check-out /dev/sda1,/dev/sdb1,/dev/sdc1 devices as members disks of DATA diskgroup then click on Next >Other disks will be used for Flash Recovery Area later on. | |
![]() |
Choose Use same passwords for these account for a simple configuration then set Specify Password and Confirm Password fields to same password strings and click on Next >.I will be using sysadm throughout the post for any Oracle password required. | |
![]() |
One of the security enhancements introduced in Release 2 is the separation of different levels of ASM access. This defines different roles for “Who can start/stop ASM instance ?”, “Who can add/drop disks to/from diskgroups?” or “Who can use those diskgroups at RDBMS level ?”For the simplicity of installation we will be setting all roles to dba group.Now set all three select lists to dba and click on Next >. | |
![]() |
Set Oracle Base to /u01/app/oracle and Software Location to /u01/app/oracle/product/11.2.0/grid. Then click on Next >. | |
![]() |
Next step is unique to first Oracle software installation as you all may know. You should set Inventory Directory (if it is not already set by installer) to /u01/app/oraInventory. Keep oraInventory Group Name as oinstall and click on Next > | |
![]() |
In this step installer will check the installation prerequisites as it does in previous releases. | |
![]() |
By 11g Release 2, if any of the prerequisites fail it will be reported in a tree structure with different categories. In my case majority of the kernel settings are automatically managed since I have installed oracle-validated-configuration rpm during OEL installation.Only problem seems to be insufficiently sized core.net.wmem_max which is defined to be the maximum socket send buffer size.When you click on Fix & Check Again button, installer will generate a single shell script for you to correct all fixable errors and after its execution it will recheck for any possible problems left. | |
![]() |
Run the generated script as root user
When the script is executed click OK to restart the prerequisite check process. |
|
![]() |
As you see kernel parameter problem has gone. Other three errors can not be corrected by installer automatically, but we know that those are not critical ones. First one is PhysicalMemory error due to our VirtualBox 512 MB memory size. The second one is insufficient SwapSize that can be by-passed also for a play ground. And the final problem is RunLevel of Linux which is also not a great deal for us.Now check Ignore All and click on Next > (button will be enabled after checking out Ignore All) to continue. | |
![]() |
On the summary screen confirm that everything is ok and click on Finish to start installation. | |
![]() |
After installer successfully completes copy,install,link,etc steps it will pop-up a root.sh execution dialog. Run the required scripts as root.
Then switch back to installation dialog and click OK in Execute Configuration scripts dialog to proceed. |
|
![]() |
Final tasks for installer will be to configure new HA service for ASM, diskgroup (DATA) and the default listener (on port 1521) which will be automatically configured also . | |
![]() |
Finally we are done 🙂 Your ASM, default listener, and HA service is ready to be used. |
Post Installation Checks
Login ASM
[oracle@localhost ~]$ export ORACLE_HOME = /u01/app/oracle/product/11.2.0/grid [oracle@localhost ~]$ export ORACLE_SID = +ASM [oracle@localhost ~]$ export PATH = $ORACLE_HOME/bin:$PATH [oracle@localhost ~]$ sqlplus / as sysasm SQL*Plus: Release 11.2.0.0.2 Beta on Mon Sep 21 05:45:58 2009 Copyright © 1982, 2009, Oracle. All right reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.0.2 – Beta With the Automatic Storage Management option
SQL> select name from v$asm_diskgroup; NAME |
Check Default Listener Status
[oracle@localhost ~]$ lsnrctl status LSNRCTL for Linux: Version 11.2.0.1.0 – Production on 31-OCT-2009 12:05:36 Copyright (c) 1991, 2009, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) STATUS of the LISTENER ———————— Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.1.0 – Production Start Date 31-OCT-2009 11:51:00 Uptime 0 days 0 hr. 14 min. 37 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/oracle/product/11.2.0/grid/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml Listening Endpoints Summary… (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521))) Services Summary… Service “+ASM” has 1 instance(s). Instance “+ASM”, status READY, has 1 handler(s) for this service… The command completed successfully |
Check HA Targets
[oracle@localhost ~]$ crs_stat -t Name Type Target State Host ———————————————————— ora.DATA.dg ora….up.type ONLINE ONLINE localhost ora….ER.lsnr ora….er.type ONLINE ONLINE localhost ora.asm ora.asm.type ONLINE ONLINE localhost ora.cssd ora.cssd.type ONLINE ONLINE localhost ora.diskmon ora….on.type ONLINE ONLINE localhost |
Ta(e)sting ZFS on Oracle Enterprise Linux 5.4 with FUSE
ZFS (Zeta File System) is my favorite storage solution for Oracle databases (in some later post I may explain why) after ASM. Although ZFS is shipped with Solaris and Open Solaris, it is also possible to use (at least taste) it with FUSE file system in your favorite Linux distro. You can find how to use ZFS on your Ubuntu in ZED House (The ZFS on Linux with FUSE) article at Linux Pro Magazine (June 2009).
One problem for Oracle Enterprise Linux (or Red Hat if you like) distro in using ZFS was that FUSE was not shipped (and supported) until 5.4 which is the latest update. By now you can choose to install FUSE modules (development libraries, kernel & user modules, and management tools) and use any FUSE file system in your system.
It might be a bit tricky to enable ZFS on OEL 5.4 if you have no experience on FUSE, ZFS and Linux stuff. I will try to explain the installation step by step. In this post I will not dive into demos of ZFS which is available in Open Solaris related page.
Ensure that you have installed the FUSE packages during the OEL 5.4 Installation
The first point is to ensure that you have FUSE related packages (rpms) installed with your OEL 5.4. You can ensure this by choosing the following packages during your installation:
- Development >> Development Libraries >> fuse-devel-2.7.4-8.el5.i386
- Base System >> Base >> fuse-2.7.4-8.el5.i386
- Base System >> Base >> fuse-libs-2.7.4-8.el5.i386
Download & Install SConS first
Since it is totally out of this post’s scope, I will not explain what SCons is but you can think it as a improved,cross-platform substitute for Make utility implemented in Python. ZFS-FUSE has been packed with SCons so you need to install SCons rpm first. You can download SCons rpm by clicking here (If you have any problems, click here to go sourceforge SCons download page).
Install SCons rpm as root user:
[oracle@localhost Desktop]$ su - Password: [root@localhost ~]$ cd /home/oracle/Desktop [root@localhost Desktop]$ rpm -ivh scons-1.2.0.d20090919-1.noarch.rpm Preparing... ############################################ [100%] 1:scons ############################################ [100%]
Download & Install ZFS-FUSE
Now you are ready to download and install ZFS-FUSE to your OEL 5.4. Either click here to download 0.5.0 version of zfs-fuse or directly go to download main page by clicking here. To build and install zfs-fuse
[root@localhost Desktop]# ark --extract zfs-fuse-0.5.0.tar.bz2 [root@localhost Desktop]# cd zfs-fuse-0.5.0/src [root@localhost src]# scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building target ... [root@localhost src]# scons install scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building target ...
Run ZFS-FUSE
Before using any ZFS command like zfs or zpool, you should first start up zfs-fuse daemon by
[root@localhost src]# cd zfs-fuse [root@localhost zfs-fuse]# ./run & [1] 8796
Test ZFS
There is a detailed test module packed with zfs-fuse. To check zfs-fuse is running you can use it. Before using it please ensure that /tmp has more than 2 GB of free space
[root@localhost zfs-fuse]# cd ../cmd/ztest [root@localhost ztest]# ./runtest -T 300 Start date: Fri Sep 25 04:13:53 EEST 2009 5 vdevs, 7 datasets, 23 threads, 300 seconds...
After completing the test, its your responsibility to clear temporary files in /tmp
[root@localhost ztest]# cd /tmp [root@localhost tmp]# rm ztest.*
If everything is fine, you are ready to play with zfs and apply any demonstrations mentioned above or you find on internet.