Oracle 12c 2 Nodes RAC Environment On Laptop Version 1.0: Short Introduction
Oracle 12c 2 Nodes RAC Environment On Laptop Version 1.0: Short Introduction
0
2014.10.11
Shanoj Kumar
Short Introduction
It is my humble effort to help me like people to setup their own RAC environment on Laptop for practice. In second
version I am planning to include 12c Dataguard and Pluggable Database.
References
www.oracle-base.com
Oracle Database 11g Release 2 (11.2.0.3.0) RAC On Oracle Linux 6.3 Using VirtualBox
Oracle Linux 6 Installation
Windows 7 64 bit
Virtual Box
o https://www.virtualbox.org/
o 4.2.14 r86644
Note: I have updated to 4.2.16 version as of 2014 .07.05. It works ok.
Pre-installed DualServer 6.94 (Local Windows DNS Server for SCAN)
o http://dhcp-dns-server.sourceforge.net/
o See “DualServer configuration” appendix for how to configure it for the needs of this implementation.
Download Oracle software from eDelivery web site
o Oracle Linux 6.4
E11882_01.zip =>unzip =>V37084-01.iso
http://edelivery.oracle.com/linux
o Oracle Grid Infrastructure and Database 12c (12.1.0.1)
V38501-01_1of2.zip
V38501-01_2of2.zip
V38500-01_1of2.zip
V38500-01_2of2.zip
https://edelivery.oracle.com/
Network configuration
I have used the following network setup. Feel free to adjust to your needs:
Public IPs 10.154.137.0/24
o internal network only
o visible and available to your laptop only even if it isn’t connected to any network
Interconnect 10.154.138.0/24
o private IPs available from RAC nodes only
SCAN
o Name =>scan-f1.shanojfun.com
o IPs =>10.154.137.115/116/117
Internet access from RAC nodes (e.g. access to Oracle public yum)
o Just run "ifup eth2" (NAT interface) while connected to an internet
Change log
Remove 70-persistent-net.rules on second node
mv /etc/udev/rules.d/70-persistent-net.rules ~/
Implementation process
Main steps
1. Setup VBOX
2. Create one node
3. Create shared ASM devices
4. Clone node
5. Install Grid Infrastructure
6. Install Database Software
7. Create Database
8. Enjoy and experiment
Node
OVB => Machine => New =>
ol6-12c-rac1
=> Linux => Oracle 64bit =>Memory Size
3072
=> Create a virtual hard drive now =>VDI => Dynamically allocated =>
F:\vbox\ol6-12c-rac_1\ol6-12c-rac1.vdi
30 GB
=> Create
Network setup
OVB =>ol6-12c-rac1 => Settings ... => Network =>
Adapter 1 => Host-only Adapter =>Enable Network Adapter
Adapter 2 =>Internal Network =>Enable Network Adapter
Adapter 3 =>NAT => Enable Network Adapter
OK
Notes:
Adapter 1 => Host only Adapter - Allows to start and access the Cluster even if you are not connected to any
networks
Adapter 3 - Allows you to get access to the Internet from RAC nodes by starting eth2 adapter
Plug in CDROM
OVB => ol6-12c-rac1 => Settings ... => Storage =>Empty => =>
=>V37084-01.iso
OK
Install Linux
OVB => ol6-12c-rac1 => Machine =>Start
Next=> Any time zone => Next=>< root password > =>Next
Next
Result:
cd /etc/yum.repos.d
wget http://public-yum.oracle.com/public-yum-ol6.repo
real 7m9.748s
...
real 34m48.846s
Complete!
real 3m35.784s
user 2m37.210s
sys 0m28.499s
[root@ol6r01 yum.repos.d]#
real 0m1.170s
user 0m1.021s
sys 0m0.146s
[root@ol6r01 yum.repos.d]#
real 10m2.364s
user 0m40.615s
sys 0m4.445s
-- Create 4 disks
OVB =>ol6-12c-rac1 => Settings ... => Storage => Controller SATA =>
Add Hard Drive =>
=>VDI =>Fixed Size (otherwise you will not be able to make it sharable)
F:\vbox\ol6-12c-rac_1\asm1.vdi
5120 MB
=> Create
-- Create 3 more Disks
F:\vbox\ol6-12c-rac_1\asm2.vdi
5120 MB
F:\vbox\ol6-12c-rac_1\asm3.vdi
5120 MB
F:\vbox\ol6-12c-rac_1\asm4.vdi
5120 MB
OK
-- Make the HDDs shareable
OVB => File => Virtual Media Manager =>asm1/2/3/4.vdi => Modify => Shareable => Close
VBoxLinuxAdditions
Remove mounted CD ROM
OVB => ol6-12c-rac1 => Settings ... => Storage =>CDROM
NOTE: You Oct need to check what path is used for cdrom in your case and mount the right one "ls -l /dev/cdrom*"
NOTE: “Installing the Window System drivers [FAILED]” - could be ignored as we don’t run X Windows.
fdisk /dev/sdb
fdisk /dev/sdc
fdisk /dev/sdd
fdisk /dev/sde
"n", "p", "1", "Return", "Return" and "w"
ls -l /dev/sd*
cat >/etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent",
RESULT=="1ATA_VBOX_HARDDISK_VB425c30d2-a5a6fd28", NAME="asm-disk1", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent",
RESULT=="1ATA_VBOX_HARDDISK_VBf3f3b07b-fc36040a", NAME="asm-disk2", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent",
RESULT=="1ATA_VBOX_HARDDISK_VBc1c2a35c-e0d538cc", NAME="asm-disk3", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent",
RESULT=="1ATA_VBOX_HARDDISK_VB23d133e5-2420ccc8", NAME="asm-disk4", OWNER="oracle", GROUP="dba", MODE="0660"
Note: I have restarted the VM. But the following command should do.
/sbin/partprobe/dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1
/sbin/udevadm test /block/sdb/sdb1
/sbin/udevadm control --reload-rules
/sbin/start_udev
ls -al /dev/asm*
Test
[root@ol6r01 ~]# dig scan-f1.shanojfun.com
;; QUESTION SECTION:
;scan-f1.shanojfun.com. IN A
;; ANSWER SECTION:
scan-f1.shanojfun.com. 36000 IN A 10.154.137.115
scan-f1.shanojfun.com. 36000 IN A 10.154.137.116
scan-f1.shanojfun.com. 36000 IN A 10.154.137.117
[root@ol6r01 ~]#
Clone the VM
init 0
Node
OVB => Machine => New =>
ol6-12c-rac2
Linux => Oracle 64bit =>
3072
Use an existing virtual hard drive file =>
F:\vbox\ol6-12c-rac_1\ol6-12c-rac2.vdi
Create
Network setup
OVB =>ol6-12c-rac1 => Settings ... => Network =>
Adapter 1 => Host-only Adapter => Enable Network Adapter
Adapter 2 =>Internal Network => Enable Network Adapter
Adapter 3 =>NAT => Enable Network Adapter
OK
Note HWaddr
vi /etc/sysconfig/network-scripts/ifcfg-eth0
HWADDR=08:00:27:34:6C:04
IPADDR=10.154.137.102
# Delete =>UUID entry
vi /etc/sysconfig/network-scripts/ifcfg-eth1
HWADDR=08:00:27:77:1A:03
IPADDR=10.154.138.102
# Delete =>UUID entry
vi /etc/sysconfig/network-scripts/ifcfg-eth2
HWADDR=08:00:27:8B:7D:8B
# Delete =>UUID entry
mv /etc/udev/rules.d/70-persistent-net.rules ~/70-persistent-net.rules.orig
reboot
OVB => ol6-12c-rac1 => Settings ... => Shared Folder => Add Shared Folder =>Folder Path =>C:\Downloads\12c
=>Folder Name =>12c =>Auto-mount =>Ok => Ok
OVB => ol6-12c-rac2 => Settings ... => Shared Folder => Add Shared Folder => Folder Path =>C:\Downloads\12c
=> Folder Name =>12c=> Auto-mount =>Ok => Ok
Non-authoritative answer:
Name: scan-f1.shanojfun.com
Address: 10.154.137.115
Name: scan-f1.shanojfun.com
Address: 10.154.137.116
Name: scan-f1.shanojfun.com
Address: 10.154.137.117
[root@ol6r01 sf_12c]#
/media/sf_12c/grid/runInstaller
vncviewer =>10.154.137.101:1
Install GUI
ol6r02
ol6r02-vip
Setup
scan-f1.shanojfun.com
Next
oracle1
/dev/asm*
~/12crac_r01.rsp
putty [email protected]
ORAENV_ASK=NO; ORACLE_SID=+ASM1; . oraenv
[oracle@ol6r01 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE ol6r01 STABLE
ONLINE ONLINE ol6r02 STABLE
ora.LISTENER.lsnr
ONLINE ONLINE ol6r01 STABLE
ONLINE ONLINE ol6r02 STABLE
ora.asm
ONLINE ONLINE ol6r01 Started,STABLE
ONLINE ONLINE ol6r02 Started,STABLE
ora.net1.network
ONLINE ONLINE ol6r01 STABLE
ONLINE ONLINE ol6r02 STABLE
ora.ons
ONLINE ONLINE ol6r01 STABLE
ONLINE ONLINE ol6r02 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE ol6r02 STABLE
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE ol6r01 STABLE
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE ol6r01 STABLE
ora.cvu
1 ONLINE ONLINE ol6r01 STABLE
ora.oc4j
1 OFFLINE OFFLINE STABLE
ora.ol6r01.vip
1 ONLINE ONLINE ol6r01 STABLE
ora.ol6r02.vip
1 ONLINE ONLINE ol6r02 STABLE
ora.scan1.vip
1 ONLINE ONLINE ol6r02 STABLE
ora.scan2.vip
1 ONLINE ONLINE ol6r01 STABLE
ora.scan3.vip
1 ONLINE ONLINE ol6r01 STABLE
--------------------------------------------------------------------------------
[oracle@ol6r01 ~]$
CAT.shanojfun.com
PAT
Connecting to the database
putty [email protected]
echo "CAT1:/u01/app/oracle/product/12.1.0/dbhome_1:N:" >> /etc/oratab
ORAENV_ASK=NO; ORACLE_SID=CAT1; . oraenv
sqlplus / as sysdba
[oracle@ol6r01 ~]$ sqlplus / as sysdba
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
BANNER
--------------------------------------------------------------------------------
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
PL/SQL Release 12.1.0.1.0 - Production
CORE 12.1.0.1.0 Production
TNS for Linux: Version 12.1.0.1.0 - Production
NLSRTL Version 12.1.0.1.0 - Production
SQL>
Appendixes:
DualServer configuration (do before installing oracle)
Overview
The following is a short tasks overview that you need to accomplish to setup you DualServer to serve a local DNS
service for SCAN component.
1. Download and install “as administrator” DualServer on your windows workstation (http://dhcp-dns-
server.sourceforge.net/)
2. Make a backup copy of the DualServer.ini file and adjust the parameters mentioned in the “DualServer.ini”
section below
3. Restart the “Dual DHCP DNS Service” windows service
4. Add a Windows firewall rule (see “Windows Local Firewall setup” section).
5. Test the local DNS setup
DualServer.ini
Make a backup copy before adjusting the parameter file. I have highlighted the sections in yellow below to indicate
what parameter you need to change.
notepad [installation path]\DualServer\DualServer.ini
# in my case "notepad C:\prog\DualServer\DualServer\DualServer.ini"
[SERVICES]
DNS
;DHCP
...
[LISTEN_ON]
10.154.137.1
# 127.0.0.1
...
[DNS_ALLOWED_HOSTS]
1.0.0.1-255.255.255.254
...
[DOMAIN_NAME]
...
shanojfun.com
...
[DNS_HOSTS]
...
scan-f1=10.154.137.115
scan-f1=10.154.137.116
scan-f1= 10.154.137.117
ol6r01=10.154.137.111
ol6r01.shanojfun.com=10.154.137.111
ol6r02= 10.154.137.112
ol6r02.shanojfun.com= 10.154.137.112
ol6r01-vip= 10.154.137.113
ol6r01-vip.shanojfun.com= 10.154.137.113
ol6r02-vip= 10.154.137.114
ol6r02-vip.shanojfun.com= 10.154.137.114
Restart “Dual DHCP DNS Service”
Windows => Search Program => Services => (Right click, Run as Administrator)
Windows => Search Program => Firewall => (Right click, Run as
Administrator)
Next => Next
RAC12c_DNS
Test setup
From your workstation
cmd
C:\Users\velikanov>nslookup
Default Server: home.gateway.home.gateway
Address: 192.168.1.254
> scan-f1.shanojfun.com
Server: [10.154.137.1]
Address: 10.154.137.1
Non-authoritative answer:
Name: scan-f1.shanojfun.com
Addresses: 10.154.137.115
10.154.137.116
10.154.137.117
>