Professional Documents
Culture Documents
Content
Introduction: ............................................................................................................................................2
Step 1: Download the required software ..................................................................................4
Step 2: Install Virtual Box..................................................................................................................5
Step 3: Create the first virtual node (rob01db01) ............................................................. 10
Step 4: Create the guest operating system for rob01db01 .......................................... 19
Step 5: Linux Post Installation steps on virtual node rob01db01 ............................. 27
Step 6: Create /u01 logical volume on node rob01db01 ............................................... 36
Step 7: Configure DNS ..................................................................................................................... 44
Step 8: Create +ASM storage ........................................................................................................ 48
Step 9: Create the second Virtual Machine ........................................................................... 57
Step 10: Final checks before Grid and DB installation .................................................... 62
Step 11: Install Grid Infrastructure ........................................................................................... 64
Step 12: Install Database Software ........................................................................................... 78
Step 13: Create a Container Database ..................................................................................... 86
Step 14: Install SQL Developer (optional) .............................................................................. 91
υ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Introduction:
In this manual you can read how to create your own virtual Oracle 12c RAC environment with 1
container database (CDB) and several pluggable databases (PDB). Just follow the manual step by step,
but first read this little introduction section, so you know what we will be doing:
In order to install a fully functional RAC, the following IP addresses are required:
• 2 public IPs, one for each node, for the primary OS network interface
• 2 public IPs, one for each node, for the Virtual IP
• 3 public IPs, one for each SCAN listener
• 2 private IPs, one for each node, for the cluster private interconnect
φ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Component Installation:
Requirements:
• 3 GB memory for each virtual node
• 15 GB local diskspace for each virtual node
• 20 GB of shared storage
χ
Create a virtual Oracle 12 RAC database ͟͢͠͞
In this workshop all the software will be placed in the location Z:\O12c_rac\software and all the data will
be placed in Z:\O12c_rac\data. You can choose your own location of course.
ψ
Create a virtual Oracle 12 RAC database ͟͢͠͞
ω
Create a virtual Oracle 12 RAC database ͟͢͠͞
ϊ
Create a virtual Oracle 12 RAC database ͟͢͠͞
ϋ
Create a virtual Oracle 12 RAC database ͟͢͠͞
ό
Create a virtual Oracle 12 RAC database ͟͢͠͞
Run the Virtual Box Manager and choose from the main screen File => Preferences => Network
Double-click on Virtual Box Host-Only Ethernet Adapter. You can see the default settings, which should
be as shown below. If not, change them accordingly:
ύ
Create a virtual Oracle 12 RAC database ͟͢͠͞
υτ
Create a virtual Oracle 12 RAC database ͟͢͠͞
υυ
Create a virtual Oracle 12 RAC database ͟͢͠͞
The default of 12 GB is sufficient because we will create a separate volume for the /u01 filesystem later.
Now the Virtual Compute Node is configured. However, before we can start with the Linux installation we
have to perform some additional configuration steps:
υφ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Select the virtual box machine rob01db01 and click on Instellingen (Settings) in the upper left hand
corner. Open the USB sub-menu and uncheck the “Enable USB Controller” check box:
υχ
Create a virtual Oracle 12 RAC database ͟͢͠͞
υψ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Choose the adapter 2 tab. Check the box for Enable Network Adapter and change to Internal Network.
Enter the name rac-priv in the Name field:
Note: step below skipped for now. Choose nat for the 3rd adapter.
υω
Create a virtual Oracle 12 RAC database ͟͢͠͞
When you now look at the network adapters, it should be like shown below:
υϊ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Choose the adapter 3 tab.Check the box for Enable Network Adapter and change to NAT:
υϋ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Click on OK. You are now ready to install the Linux OS in the next step
υό
Create a virtual Oracle 12 RAC database ͟͢͠͞
Press on the Start button and browse to the first Linux ISO file you downloaded in an earlier step and
press Start:
Before you continue Select Weergave and then “Schaalmodus” to format your VM screen output:
υύ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Use the TAB key to move to “Skip”, and just follow the screens below.
φτ
Create a virtual Oracle 12 RAC database ͟͢͠͞
φυ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Leave the Configure Network button for now. We’ll configure the network at a later stage.
φφ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Click on Next
φχ
Create a virtual Oracle 12 RAC database ͟͢͠͞
φψ
Create a virtual Oracle 12 RAC database ͟͢͠͞
φω
Create a virtual Oracle 12 RAC database ͟͢͠͞
Finally, press Reboot and this step is ready. You can log on to the system as the root user. You have to
answer a few questions such as setting the time and disabling kdump.
Note: it is possible that you do not see the menu bar with “Machine, Weergeven, Apparaten, Help”. In that
case you probably run in the scale mode, which does not show that menu bar. Change to another mode
with the right CTRL button and press C at the same time.
φϊ
Create a virtual Oracle 12 RAC database ͟͢͠͞
First view the settings of you r virtual adapter on your laptop / host computer , start a cmd prompt and
type ipconfig:
You can see in the output above that the Virtual box Host Only Network gateway is 192.168.56.1, which
is the default.
Proceed with the virtual node rob01db01 and log on as the root user. Start a terminal session and stop
the nics. Then change the nic configuration as shown below. The entries in blue need to be added:
# ifdown eth0
# ifdown eth1
# cd /etc/sysconfig/network-scripts
[root@rob01db01 network-scripts]# cat ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:2E:4F:00
TYPE=Ethernet
UUID=f2f989bc-ddc2-481b-99dc-8069c2f743b6
NM_CONTROLLED=yes
ONBOOT=yes
BOOTPROTO=none
IPV6INIT=no
IPADDR=192.168.56.101
NETMASK=255.255.255.0
GATEWAY=192.168.56.1
DNS1=192.168.56.101
DNS2=192.168.56.102
DOMAIN=robdomain
DEFROUTE=yes
NAME="System eth0"
φϋ
Create a virtual Oracle 12 RAC database ͟͢͠͞
# ifup eth0
# ifup eth1
# ifconfig -a
Create a new session in putty to the virtual node rob01db01 and connect to the virtual node:
φό
Create a virtual Oracle 12 RAC database ͟͢͠͞
1
Disable SELinux
Start the VI editor and edit file /etc/selinux/config
Change entry SELINUX=enforced/targeted to SELINUX=disabled
Reboot the server
# vi /etc/selinux/config
# change entry SELINUX=enforced/targeted to SELINUX=disabled
# reboot
Disable kdump
Kdump is used for crash recovery and dumps the kernel prior to a crash for analysis. However, in this test
setup, as using kdump costs memory, we do want to make sure kdump is turned off:
1
Security-Enhanced Linux (SELinux) is a Linux feature that provides the mechanism for supporting access control
security policies, including United States Department of Defense-style mandatory access controls, through the use
of Linux Security Modules (LSM) in the Linux kernel. It is not a Linux distribution, but rather a set of kernel
modifications and user-space tools that can be added to various Linux distributions.
φύ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Add the Installation DVD/ISO as a repository and install additional packages
As a first step we have to mount the ISO cd rom.
Make sure the ISO file is selected in the Oracle VM Virtual Box Manager first:
Now we will create a local yum repostitory, which points to the mounted cd-rom.
χτ
Create a virtual Oracle 12 RAC database ͟͢͠͞
χυ
Create a virtual Oracle 12 RAC database ͟͢͠͞
local/primary_db
| 3.8 MB 00:00 ...
http://public-
yum.oracle.com/repo/OracleLinux/OL6/UEKR3/latest/x86_64/repodata/repomd.xml:
[Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'public-yum.oracle.com'"
Trying other mirror.
repo id repo name
status
local Rob Repo
3,754
public_ol6_UEKR3_latest Unbreakable Enterprise
Kernel Release 3 for Oracle Linux 6Server (x86_64)
0
public_ol6_latest Oracle Linux 6Server Latest
(x86_64)
0
repolist: 3,754
χφ
Create a virtual Oracle 12 RAC database ͟͢͠͞
If you did NOT run the package, create the Oracle user and groups
# groupadd -g 54321 oinstall
# groupadd -g 54322 dba
# groupadd -g 54323 oper
# groupadd -g 54324 backupdba
# groupadd -g 54325 dgdba
# groupadd -g 54326 kmdba
# groupadd -g 54327 asmdba
# groupadd -g 54328 asmoper
# groupadd -g 54329 asmadmin
χχ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Run additional packages that are required for the RAC installation:
χψ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Modify the pam.d login file to use limits
Run the package below which is required by the Firefox Browser for EM Database Express
Download package flash-plugin-11.2.202.394-release.x86_64.rpm
Place it in the shared folder directory
Run as the root user on the linux os:
χω
Create a virtual Oracle 12 RAC database ͟͢͠͞
First of stop the shutdown the Linux Virtual Server and then continue.
Click on “opslag” and then press on the green Plus next to “Controller: SATA” to create a new harddisk.
χϊ
Create a virtual Oracle 12 RAC database ͟͢͠͞
χϋ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Press on Aanmaken and you can now see that the new disk is added:
Because this disk is dynamically allocated the initial size is only 83 KB.
χό
Create a virtual Oracle 12 RAC database ͟͢͠͞
The sda disks are the disks that were already configured during the linux installation. The sdb disk is the
new disk that was added. It needs to be configured now:
# fdisk –l
. . . .
Disk /dev/sdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
χύ
Create a virtual Oracle 12 RAC database ͟͢͠͞
ψτ
Create a virtual Oracle 12 RAC database ͟͢͠͞
And ..
[root@rob01db01 dev]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "oracle_software" using metadata type lvm2
Found volume group "vg_rob01db01" using metadata type lvm2
ψυ
Create a virtual Oracle 12 RAC database ͟͢͠͞
In order to make sure that the file system is automatically mounted after a reboot, enter the following
entry in /etc/fstab: /dev/oracle_software/oracle /u01 ext3 rw,noatime 0 0
ψφ
Create a virtual Oracle 12 RAC database ͟͢͠͞
J: Log in as user Oracle and add the following lines to the /home/oracle/.bash_profile file:
. . .
. . .
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=rob01db01.localdomain
export ORACLE_UNQNAME=CDBRAC
export ORACLE_BASE=/u01/app/oracle
export GRID_HOME=/u01/app/12.1.0.1/grid
export DB_HOME=$ORACLE_BASE/product/12.1.0.1/db_1
export ORACLE_HOME=$DB_HOME
export ORACLE_SID=robdb
export ORACLE_TERM=xterm
export BASE_PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$GRID_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
Also create files grid_inv and db_env with execute rights in $HOME of user oracle as show below:
[oracle@rob01db01 ~]$ cat db_env
export ORACLE_SID=robdb
export ORACLE_HOME=$DB_HOME
export PATH=$ORACLE_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
ψχ
Create a virtual Oracle 12 RAC database ͟͢͠͞
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
managed-keys-directory "/var/named/dynamic";
};
logging {
ψψ
Create a virtual Oracle 12 RAC database ͟͢͠͞
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
zone "robdomain" {
type master;
file "robrack";
};
zone "in-addr.arpa" {
type master;
file "in-addr.arpa";
};
Step 7.5 Create the zone file for the racattack domain on rob01db01
Run the command below o create the zone file, copy/paste the complete code block and execute:
# echo '$TTL 3H
@ IN SOA collabn1 hostmaster (
101 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS rob01db01
NS rob01db02
localhost A 127.0.0.1
rob01db01 A 192.168.56.101
rob01db01-vip A 192.168.56.111
rob01db01-priv A 192.168.1.101
rob01db02 A 192.168.56.102
rob01db02-vip A 192.168.56.112
rob01db02-priv A 192.168.1.102
rob01-scan A 192.168.56.251
rob01-scan A 192.168.56.252
rob01-scan A 192.168.56.253' \
ψω
Create a virtual Oracle 12 RAC database ͟͢͠͞
> /var/named/robrack
# echo '$TTL 3H
@ IN SOA rob01db01.robdomain. hostmaster.robdomain. (
101 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS rob01db01.robdomain.
NS rob01db02.robdomain.
ψϊ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Name: rob01-scan.robdomain
Address: 192.168.56.252
Name: rob01-scan.robdomain
Address: 192.168.56.253
Name: rob01-scan.robdomain
Address: 192.168.56.251
ψϋ
Create a virtual Oracle 12 RAC database ͟͢͠͞
In the VirtualBox Manager, select the machine collabn1, click Settings -> Storage.
Select Controller SATA and click on the Add Hard Disk button:
ψό
Create a virtual Oracle 12 RAC database ͟͢͠͞
ψύ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Repeat the steps above to create 4 more disks of 4 GB each. Afterwards, you can see that all the disks
are added:
ωτ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Click on File => Virtual Manager in order to make the disks sharable:
ωυ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Rightclick on each asm disk and select Modify. Then mark the disk as Sharable:
Note: in the box below you can see how you can perform the steps above without the GUI interface,
using the CLI interface:
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
ωφ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Z:\software\Virtual_Box\VBoxManage.exe storageattach rob01db01 --storagectl "SATA" --
port 7 --device 0 --type hdd --medium c:\virtual_disks\12c_standalone\asm6.vdi --mtype
shareable
Z:\software\Virtual_Box\VBoxManage.exe storageattach rob01db01 --storagectl "SATA" --
port 8 --device 0 --type hdd --medium c:\virtual_disks\12c_standalone\asm7.vdi --mtype
shareable
ωχ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Perform the same for disks sdd . . . sdi. Afterwards you can see that all the disks have been configured:
[root@rob01db01 dev]# ls -l sd*
brw-rw---- 1 root disk 8, 0 Jun 25 08:32 sda
brw-rw---- 1 root disk 8, 1 Jun 25 08:32 sda1
brw-rw---- 1 root disk 8, 2 Jun 25 08:32 sda2
brw-rw---- 1 root disk 8, 16 Jun 25 08:32 sdb
brw-rw---- 1 root disk 8, 17 Jun 25 08:32 sdb1
brw-rw---- 1 root disk 8, 32 Jun 25 08:50 sdc
brw-rw---- 1 root disk 8, 33 Jun 25 08:50 sdc1
brw-rw---- 1 root disk 8, 48 Jun 25 08:53 sdd
brw-rw---- 1 root disk 8, 49 Jun 25 08:53 sdd1
brw-rw---- 1 root disk 8, 64 Jun 25 08:53 sde
brw-rw---- 1 root disk 8, 65 Jun 25 08:53 sde1
brw-rw---- 1 root disk 8, 80 Jun 25 08:53 sdf
brw-rw---- 1 root disk 8, 81 Jun 25 08:53 sdf1
brw-rw---- 1 root disk 8, 96 Jun 25 08:54 sdg
brw-rw---- 1 root disk 8, 97 Jun 25 08:54 sdg1
Essentially, what udev does is apply rules defined in files in the "/etc/udev/rules.d" directory to the
device nodes listed in the "/dev" directory. The rules can be defined in a variety of ways, but what we
need to do is identify the device and say what we want udev to do with it.
Create file /etc/scsi_id.config with entry options=-g to make the SCSI devices trusted.
ωψ
Create a virtual Oracle 12 RAC database ͟͢͠͞
We are going to write device-specific rules, so we need to be able to identify each device consistently,
irrespective of the order in which Linux discovers it. To do this run the code block below:
ωω
Create a virtual Oracle 12 RAC database ͟͢͠͞
The shared disks are now configured and ready for the grid infrastructure. At a later stage the
ASM_DISKSTRING parameter can be set to "/dev/asm-disk*".
ωϊ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Name: rob01db02.robdomain
Address: 192.168.56.102
Name: rob01db01.robdomain
Address: 192.168.56.101
ωϋ
Create a virtual Oracle 12 RAC database ͟͢͠͞
First of all stop the second node (rob01db02) and add the disks as shown below:
Click on the plus to add a hard disk. But in the dialogue below we will now choose the option: “use an
existing disk”, since we already created that disk before, when we were working on node rob01db01:
In the popup screen, navigate to the first hard disk location (asm1)
ωό
Create a virtual Oracle 12 RAC database ͟͢͠͞
Repeat the steps for disks asm2, asm3, asm4 and asm5. In the end we will see all 5 asm disks appear in
the Storage section of node rob01db02
ωύ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Log on to the compute node again and you can see that the disks are already present and formatted:
ϊτ
Create a virtual Oracle 12 RAC database ͟͢͠͞
ϊυ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Name: rob01-scan.robdomain
Address: 192.168.56.252
Name: rob01-scan.robdomain
Address: 192.168.56.253
Name: rob01-scan.robdomain
Address: 192.168.56.251
ϊφ
Create a virtual Oracle 12 RAC database ͟͢͠͞
ϊχ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Step 10.0 First mount the shared folder as the oracle user
Perform the steps below on both nodes (rob01db01 and rob01db02):
[root@rob01db01 sf_software]# ls
DualServerInstallerV7.12.exe linuxamd64_12c_grid_1of2.zip VirtualBox-
4.2.18-88781-Win.exe
linuxamd64_12c_database_1of2.zip linuxamd64_12c_grid_2of2.zip
linuxamd64_12c_database_2of2.zip V41362-01.iso
After this operation the 2 subdirectories “grid” and “database” are created in /media/sf_software
ϊψ
Create a virtual Oracle 12 RAC database ͟͢͠͞
ϊω
Create a virtual Oracle 12 RAC database ͟͢͠͞
ϊϊ
Create a virtual Oracle 12 RAC database ͟͢͠͞
ϊϋ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Now click the "SSH Connectivity..." button and enter the password for the "oracle" user. Click the "Setup"
button to configure SSH connectivity, and the "Test" button to test it once it is complete:
ϊό
Create a virtual Oracle 12 RAC database ͟͢͠͞
Press setup to setup ssh connectivity between the nodes. This will be configured automatically and you
will see the popup box below appear:
ϊύ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Click the "Identify network interfaces..." button and check the public and private networks are specified
correctly. Remember to mark the NAT interface as "Do Not Use"
Click OK and then Next in the previous screen that shows up again. A number of tests and validations
are fired off and then the screen below appears:
ϋτ
Create a virtual Oracle 12 RAC database ͟͢͠͞
Enter details as shown above. The password of SYSASM is set to oracle. Click NEXT
ϋυ
Create a virtual Oracle 12 RAC database ͟͢͠͞
All disks belong to the DATA diskgroup. In another lab we will add disks and create a RECO group as well.
ϋφ
Create a virtual Oracle 12 RAC database ͟͢͠͞
ϋχ
Create a virtual Oracle 12 RAC database ͟͢͠͞
The next screen is the prerequisite check screen. This will take some time to complete
ϋψ
Create a virtual Oracle 12 RAC database ͟͢͠͞
The errors above can be ignored. There was one additional error about NTP. This error can be fixed by
removing the ntp package on both nodes. In stead of NTP RAC cluster synchronization services (CSS) will
be configured automatically by the installer:
Note: If there are any more errors see the webpage http://www.hhutzler.de/blog/cluvfy_error/ for
troubleshooting.
ϋω
Create a virtual Oracle 12 RAC database ͟͢͠͞
Press on continue and the installation will continue. After some time it is completed:
ϋϊ
Create a virtual Oracle 12 RAC database ͟͢͠͞
NAME TOTAL_MB
------------------------------ ----------
DATA 20470
Before we start with the installation of the RDBMS Software it may be a good idea to stop all the nodes
and make another intermediate backup of all the compute nodes and ASM disks.
ϋϋ
Create a virtual Oracle 12 RAC database ͟͢͠͞
ϋό
Create a virtual Oracle 12 RAC database ͟͢͠͞
ϋύ
Create a virtual Oracle 12 RAC database ͟͢͠͞
ότ
Create a virtual Oracle 12 RAC database ͟͢͠͞
όυ
Create a virtual Oracle 12 RAC database ͟͢͠͞
όφ
Create a virtual Oracle 12 RAC database ͟͢͠͞
όχ
Create a virtual Oracle 12 RAC database ͟͢͠͞
όψ
Create a virtual Oracle 12 RAC database ͟͢͠͞
όω
Create a virtual Oracle 12 RAC database ͟͢͠͞
Add the line below to the file /etc/oratab and start the dbca afterwards
όϊ
Create a virtual Oracle 12 RAC database ͟͢͠͞
όϋ
Create a virtual Oracle 12 RAC database ͟͢͠͞
όό
Create a virtual Oracle 12 RAC database ͟͢͠͞
όύ
Create a virtual Oracle 12 RAC database ͟͢͠͞
ROBCDB1:/u01/app/oracle/product/12.1.0.1/db_1:N: # line
added by Agent
Then shutdown the node and resize the memory in the virtual machine console to 2 GB:
ύτ
Create a virtual Oracle 12 RAC database ͟͢͠͞
First download SQL Developer 4.0 from OTN. Place it in the software shared folder directory:
sqldeveloper-4.0.2.15.21-1.noarch.rpm
Preparing... ###########################################
[100%]
1:sqldeveloper ###########################################
[100%]
ύυ