12.1.0.2 Stand Alone Database Install with ASM Oracle Linux 6.X on Virtual Box

Purpose
How to setup a device on Oracle Virtual Box – and use that device for a Oracle stand alone ASM database install.
Assumptions
Assumptions Oracle Enterprise Linux 6.6 with oraclerdbmsserver12cR1preinstall RPM installed – with at least 35GB free space on a pre-existing file system.  Other 6.X releases of Oracle Linux should work.  BTW, this rpm works for 12c RAC too – in other words sets clusterware kernel params.
Do the following to confirm the Oracle RPM is already there.

[root@stby12102 sf_OEL6.6+DBSetups]# yum list | grep -i rdbms
oracle-rdbms-server-12cR1-preinstall.x86_64

If it is not installed do this:

[root@stby12102 sf_OEL6.6+DBSetups]# yum install oracle-rdbms-server-12cR1-preinstall
Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
Package oracle-rdbms-server-12cR1-preinstall-1.0-14.el6.x86_64 already installed and latest version
Nothing to do

Note: if using another provider of Oracle Linux 6 – like RHEL 6, or CentOS 6, the pre-install package cannot be used to my knowledge – so replace the package install with all the steps that the package does for you – this is outside the scope of this blog.

Creating a device to use for ASM with VirtualBox

Shut your VM down.
Add a storage controller – pick add new SCSI controller to your VM.
Add a hard drive device to your existing Linux 6.6 VM by:
selecting the SCSI you just added and clicking on the + icon to  the right of it.
Create new disk,  Accept VDI
Say 50 GB thin provisioned (Dynamically Allocated)
Name it DATA
Do NOT click on Use Host IO Cache.

FDISK the device so that it can be used by ASM

Restart your OEL 6 VM
You’ll see something like this:
[root@stby12102 Desktop]# ls -al /dev/sd*
brw-rw—- 1 root disk 8, 0 Feb 13 17:23 /dev/sda
brw-rw—- 1 root disk 8, 1 Feb 13 17:23 /dev/sda1
brw-rw—- 1 root disk 8, 2 Feb 13 17:23 /dev/sda2
brw-rw—- 1 root disk 8, 16 Feb 13 17:23 /dev/sdb
[root@stby12102 Desktop]#
/dev/sdb is the new device – notice there are no partitions under like there are with sda (sda1 & sdb2).
Now run fdisk against in a create a primary partion as follows:

[root@stby12102 Desktop]# 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 0x5edc3256.
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): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition’s system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-6527, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-6527, default 6527):
Using default value 6527
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Notice you have new sub-partitions
[root@stby12102 Desktop]# 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 0x5edc3256.
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): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition’s system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-6527, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-6527, default 6527):
Using default value 6527
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Pre-Installation Steps For 12.1.0.2 ASM grid Install

Install Oracle ASM RPMs

While the assumed pre-installed oraclerdbmsserver12cR1preinstall  RPM does a lot of the pre-installation steps for you, it does not setup a dual grid / oracle environment for ASM (oracle user is created).
You’ll need to use “yum” to install two of the three ASM components necessary.  And RPM to get the third as follows:

[root@stby12102 Desktop]# yum install oracleasm
Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package kernel-uek.x86_64 0:3.8.13-118.3.1.el6uek will be installed
–> Processing Dependency: kernel-firmware = 3.8.13-118.3.1.el6uek for package: kernel-uek-3.8.13-118.3.1.el6uek.x86_64
–> Running transaction check
—> Package kernel-uek-firmware.noarch 0:3.8.13-118.3.1.el6uek will be installed
–> Finished Dependency Resolution

Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
kernel-uek x86_64 3.8.13-118.3.1.el6uek public_ol6_UEKR3_latest 42 M
Installing for dependencies:
kernel-uek-firmware noarch 3.8.13-118.3.1.el6uek public_ol6_UEKR3_latest 2.2 M
Transaction Summary
================================================================================
Install 2 Package(s)
Total download size: 44 M
Installed size: 177 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): kernel-uek-3.8.13-118.3.1.el6uek.x86_64.rpm | 42 MB 00:11
(2/2): kernel-uek-firmware-3.8.13-118.3.1.el6uek.noarch. | 2.2 MB 00:00
——————————————————————————–
Total 3.5 MB/s | 44 MB 00:12
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : kernel-uek-firmware-3.8.13-118.3.1.el6uek.noarch 1/2
Installing : kernel-uek-3.8.13-118.3.1.el6uek.x86_64 2/2
Verifying : kernel-uek-3.8.13-118.3.1.el6uek.x86_64 1/2
Verifying : kernel-uek-firmware-3.8.13-118.3.1.el6uek.noarch 2/2
Installed:
kernel-uek.x86_64 0:3.8.13-118.3.1.el6uek
Dependency Installed:
kernel-uek-firmware.noarch 0:3.8.13-118.3.1.el6uek
Complete!

[root@stby12102 Desktop]# yum install oracleasm-support
Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package oracleasm-support.x86_64 0:2.1.8-1.el6 will be installed
–> Finished Dependency Resolution

Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
oracleasm-support x86_64 2.1.8-1.el6 public_ol6_latest 73 k
Transaction Summary
================================================================================
Install 1 Package(s)
Total download size: 73 k
Installed size: 216 k
Is this ok [y/N]: y
Downloading Packages:
oracleasm-support-2.1.8-1.el6.x86_64.rpm | 73 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : oracleasm-support-2.1.8-1.el6.x86_64 1/1
Verifying : oracleasm-support-2.1.8-1.el6.x86_64 1/1
Installed:
oracleasm-support.x86_64 0:2.1.8-1.el6
Complete!
But uh-oh – the third does not exist:

[root@stby12102 Desktop]# yum install oracleasmlib
Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
No package oracleasmlib available.
Error: Nothing to do

Well if you are running OEL 6.x you can go here and get it (download it):
http://www.oracle.com/technetwork/server-storage/linux/asmlib/ol6-1709075.html
Choose (assuming you are using 64 bit OEL 6:

I just download it via Windows to a share setup for the OEL 6 VM
cd /media/sf_OEL6.6+DBSetups/
[root@stby12102 sf_OEL6.6+DBSetups]# ls -al oracleasmlib*
-rwxrwx— 1 root vboxsf 17168 Feb 12 19:41 oracleasmlib-2.0.12-1.el6.x86_64.rpm
rpm -Uvih oracleasmlib-2.0.12-1.el6.x86_64.rpm
[root@stby12102 sf_OEL6.6+DBSetups]# rpm -Uvih oracleasmlib-2.0.12-1.el6.x86_64.rpm
Preparing… ########################################### [100%]
1:oracleasmlib ########################################### [100%]
[root@stby12102 sf_OEL6.6+DBSetups]#

Create groups and grid unix user


/usr/sbin/groupadd -g 54321 oinstall
/usr/sbin/groupadd -g 54322 dba
/usr/sbin/groupadd -g 54323 oper
/usr/sbin/groupadd -g 54324 backupdba
/usr/sbin/groupadd -g 54326 kmdba
/usr/sbin/groupadd -g 54327 asmdba
/usr/sbin/groupadd -g 54328 asmoper
/usr/sbin/groupadd -g 54329 asmadmin

The oracle unix account will need a little work as well- asmdba group should be added to it.

 [root@stby12102 sf_OEL6.6+DBSetups]# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba)
/usr/sbin/usermod -u 54321 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba oracle
# hint if you use "usermod -a -G asmdba oracle" that is sufficient -a just appends to the groups you already have
if the oracle account has set any of the following environment variables - unset them - comment them out of .bash_profiles etc.
$ unset ORACLE_HOME
$ unset ORACLE_BASE
$ unset ORACLE_SID
$ unset TNS_ADMIN
Here is all you'll need in terms of env variables
ORACLE_BASE=/u01/app/oracle;
export ORACLE_BASE
The grid account will not exist

[root@stby12102 sf_OEL6.6+DBSetups]# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba)
if it does just do a usermod instead of a useradd – and ask yourself why it already exists?
useradd -g oinstall -G asmdba,asmoper,asmadmin grid
usermod -g oinstall -G dba,oper,asmdba,asmoper,asmadmin oraclepasswd grid
Optional – if you have done previous installs with other oracle version with the “oracle” UNIX user – uninstall any existing homes – unless they are used for other instances.
If you leave them in place, make sure that during this install they are not referenced.
mkdir -p /u01/app/12.1.0/grid
mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle
chown -R grid:oinstall /u01/app/grid
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/

[root@stby12102 Desktop]# which oracleasm
/usr/sbin/oracleasm
[root@stby12102 Desktop]# 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 []:
grid
Default group to own the driver interface []:
asmadmin
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
[root@stby12102 Desktop]#
 
 

# use the disk you created “DATA” with virtualbox – and partitioned with fdisk /dev/sd1
/etc/init.d/oracleasm createdisk DATA /dev/sdb1

Install Grid Infrastructure

# give grid and oracle access to virtualbox shares – so you can install from there
# don’t forget the -a (below) or you will not append the group you will overwrite and lose your other groups
[root@stby12102 media]# usermod -a -G vboxsf grid
[root@stby12102 media]# usermod -a -G vboxsf oracle
# allow grid and oracle to run X apps like runInstaller
[root@stby12102 Desktop]# xhost +
access control disabled, clients can connect from any host
su – grid
cd /media/sf_OEL6.6+DBSetups/grid
./runInstaller
 

Capture

Without giving you 25 screen shots,
proceed thru the install – importantly –
Select Install and Configure Grid Infrastruction for a Standalone Server
Check the 1 DATA disk when you get to that screen and select External Redundancy – you’ll need more than one device if you select high or normal.
Don’t register with EM Cloud Control (outside scope).
asmadmin, asmdba, and asmoper(optional) should be the “Privileged Operating Groups specified – when you get to that screen.
Specifiy Installation Location screen
Oracle base: /u01/app/grid
Software location: /u01/app/grid/product/12.1.0/grid
Check root script execution and supply the root password
Prereq check is run if there are errors:
# run the fixup script and rerun the check
[root@stby12102 Desktop]# cd /tmp/CVU_12.1.0.2.0_grid/
[root@stby12102 CVU_12.1.0.2.0_grid]# ./runfixup.sh
All Fix-up operations were completed successfully.
# tell the installer you want to move past warnings – as long as you know they are warning that will not break (almost always the case with a warning)
Capture
Let ‘er fly…
With a little luck… you’ll see
Capture
Answer “Yes”.  The root scripts are run for you automatically.
Next message.
“Successful installation of Grid Infrastructure for a Standalone Server was successful.”

Post Grid Infrastructure Installation Steps

Update your .bash_profile or setup – ORACLE_HOME etc. environment variables.
ORACLE_SID=+ASM
export ORACLE_SID
ORACLE_HOME=/u01/app/grid/product/12.1.0/grid
export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin

Oracle Database Installation

I’m not going to go thru the DB installation as it is fairly straight forward – just choose ASM rather than file system for your datafiles.  I do an advanced install – and since I didn’t set up a FRA ASM device – I don’t put it in archivelog yet.
unzip 1 and 2 … zips – run xhost + as root
and as the oracle user:
cd into the database dir and…
./runInstaller
and if you like add something like this to your .bash_profile
export ORACLE_SID=orcl
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin
Have fun… hope this helps… next opatchauto – 12.1.0.2.6 (Jan 2016 PSU)

Leave a Comment

Scroll to Top