29
Oracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that testbeds are vital for the DBA’s success. With a testbed, the DBA can test new things without impacting anyone else. Lots of company’s have development and test environments, but as I’m fond of saying…while those aren’t production, they’re production for someone. Our development environment is not for our production end users. But if I break the development database, I can have multiple application developers twiddling their thumbs until I fix the issue. I typically test out some of my work on my own personal testbed before I hit the developmenttestproduction chain of environments. This testbed can be used for non-RAC work as well. For this article, I will be creating a two-node Oracle RAC system on my MacBook Pro laptop. This laptop has a 500GB SSD for storage, 16GB of memory, and a 4-core CPU. This is plenty for my testbed but know that I won’t see blazing performance from this system. I will be using Oracle’s Virtual Box 4.3 for a virtualization solution. This article will show how to install Oracle Grid Infrastructure 12.1.0.2 and create an Oracle 12.1.0.2 RAC database. I will be using Oracle Linux 6.5 for the OS. These instructions can be easily adapted to Windows platforms as well. Creating The First Node So its time to create the first virtual machine, which will be the first node of the Oracle RAC cluster. I started Virtual Box and was presented with the Virtual Box Manager. I clicked on the New button to create a new virtual machine as I currently have none. I will call this machine “host01”. I verified that Linux is selected and that Oracle (64-bit) is the OS of choice. I changed the memory allocation to 4GB. With two hosts running, that will eat up half of my laptop’s

Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

  • Upload
    lexuyen

  • View
    213

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

Oracle RAC on Laptop

For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that testbeds are vital for the DBA’s success. With a testbed, the DBA can test new things without impacting anyone else. Lots of company’s have development and test environments, but as I’m fond of saying…while those aren’t production, they’re production for someone. Our development environment is not for our production end users. But if I break the development database, I can have multiple application developers twiddling their thumbs until I fix the issue. I typically test out some of my work on my own personal testbed before I hit the developmenttestproduction chain of environments. This testbed can be used for non-RAC work as well.

For this article, I will be creating a two-node Oracle RAC system on my MacBook Pro laptop. This laptop has a 500GB SSD for storage, 16GB of memory, and a 4-core CPU. This is plenty for my testbed but know that I won’t see blazing performance from this system. I will be using Oracle’s Virtual Box 4.3 for a virtualization solution. This article will show how to install Oracle Grid Infrastructure 12.1.0.2 and create an Oracle 12.1.0.2 RAC database. I will be using Oracle Linux 6.5 for the OS. These instructions can be easily adapted to Windows platforms as well.

Creating The First Node

So its time to create the first virtual machine, which will be the first node of the Oracle RAC cluster. I started Virtual Box and was presented with the Virtual Box Manager. I clicked on the New button to create a new virtual machine as I currently have none. I will call this machine “host01”. I verified that Linux is selected and that Oracle (64-bit) is the OS of choice. I changed the memory allocation to 4GB. With two hosts running, that will eat up half of my laptop’s memory, but I shouldn’t have any problems. With the initial settings defined, I pressed the Create button.

Page 2: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

On the next screen, I can define how much disk space is carved out for the VM’s internal disk. I specified a size of 40GB, which will be big enough to let me install Oracle Grid Infrastructure and the RDBMS software. The database will be installed on shared disk that will be configured later. With the disk size specified, the Create button is pressed.

Page 3: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

At this point, the VM has been created but needs additional configuration before it is started. I need to define the network interfaces. Many Oracle RAC installations in a virtual environment often go wrong in how the network configuration is defined. To support Oracle RAC, I will need a public network and a private network. The “public” network will only be public within my laptop. This means I’ll be able to connect to the RAC instances with SQL Developer or the like. I’m also going to want a third network that can access the Internet at large so that I can download updates. My host will have three network adapters defined, but I can disable the last one after updates have completed if so desired.

Before I can proceed, I need to configure Virtual Box to have two host-only networks. By default, there is only one. I’ll use vboxnet0 for the Oracle RAC public network and vboxnet1 for the Oracle RAC private network. I navigate to VirtualBox Preferences. On Windows, the Preferences item will likely be under the Tools menu. Next, I click on the Network section. Then I click on the Host-only Networks button. I should see only vboxnet0 in the list. So I click on the icon to the left with a green plus-sign to add a new one. This creates the vboxnet1 network for me. Virtual Box now has two host-only networks.

Page 4: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

But before we can use the new Host-only network, vboxnet1, I must configure it within Virtual Box. To do that, I single click on the vboxnet1 network name and then click on the screwdriver icon to the left to configure it. With the adapter button chosen, I see that the IP address for this network is 192.168.57.1 and the netmask is 255.255.255.0. I click on the DHCP server button and fill out the next screen as follows.

Back in the Virtual Box Manager, I single-clicked on the host01 VM and pressed the Settings button. Next, I selected the Network option. For Adapter 1, I selected “Host-only adapter” and made sure to use vboxnet0. For Adapter 2, I selected, “Host-only adapter” and made sure to use vboxnet1. For Adapter 3, I selected “NAT”. Make sure all three adapters have the Enable Network Adapter box checked, which likely had to be done before the adapter type could be chosen.

Page 5: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

The most common problem I’ve seen with the network configuration is to have the wrong adapter type and to have VM’s mix and match adapters. We’ll resolve this by cloning the VM for the second host. But if you add a third host at a later time, make sure the adapter number has the same adapter type (i.e., vboxnet0) as the other nodes. I also won’t be assigning IP addresses at this point. My experience has taught me to let Virtual Box assign the IP addresses dynamically. Later on, I’ll make the IP assignments permanent.

At this point, I can click on OK to confirm the settings. I can then press the Start button to initially start the VM. There is no OS loaded yet so the first thing Virtual Box will do is to ask me for the location of the ISO image that contains the OS installation. I point Virtual Box to my Oracle Linux ISO image I downloaded from Technet and press Start. I will then be prompted for the installation type. This will be a clean installation so I select the first option and hit the Enter key.

Page 6: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

On the next step, I skipped Media Detection as I know this is a valid ISO file. What follows next is to configure how Oracle Linux will initially be installed. I select my language and press Next. I then select my keyboard option and press Next. When asked about the storage type, I make sure Basic Storage Devices is selected and press Next. At this point, I will get a warning that is essentially telling me that the disk will be wiped out. This is expected and I let the installer wipe the disk by pressing the Yes button.

To this point, the installation of the OS has been straightforward. On the next screen, we enter the host name, which for me will be “host01.localdomain”. Do not press the Next button. Instead, press the Configure Network button on the bottom of the screen.

The screen that pops up shows three network adapters, eth0, eth1, and eth2. I single-clicked on eth0 and pressed the Edit button. I then made sure that the Connect Automatically box is selected. I pressed the Apply button and repeated for the other adapters.

Page 7: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

The next screen lets me choose the timezone my VM lies in. I also made sure to uncheck the System Clock Uses UTC box at the bottom of this screen. Pressing Next brings me to the screen to define my root password, which I entered. I accepted the default values on the next screens until I got to the screen that asks which type of server to be installed. The default is the Basic Server, which is fine for me, but I want to add GUI support so that I can install with the OUI in an X-Windows environment. So I click on the Customize Now button at the bottom of the screen and press Next. The only thing extra that I added was to click on the Desktops item in the left pane and then select the options in the right pane as seen below.

When I pressed Next, the OS is installed in the VM. After the OS has been installed, I was prompted to reboot. The OS install is not quite complete yet as I’m asked to accept the license agreement and set up OS updates (which I politely declined).

Page 8: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

When prompted to create a user, I did not enter any information. I’ll be setting up the user’s later. After accepting the default values for the next two screens, I am finally able to login as root.

The first node is now up and running, but it needs some additional setup before I can clone it to create the second node. First, I need to add the Oracle Validated RPM and ASM libraries. A few simple commands will install those for me.

yum install oracle-rdbms-server-12cR1-preinstallyum install oracleasmyum install oracleasm-support

The first yum install will make sure I have all of the required packages and kernel settings. It will also create the ‘oracle’ user and relevant groups. The other two yum installs will make sure we have the needed packages to be able to install ASM for our storage. Before we can install ASM with Grid Infrastructure, I need to perform a simple configuration as seen below. [root@host01 ~]# 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 []: oinstall Start Oracle ASM library driver on boot (y/n) [n]: y Scan for Oracle ASM disks on boot (y/n) [y]: Writing Oracle ASM library driver configuration: done

I could stop here and clone the VM for host02, but I would like to perform a few actions that would save me from having to do them twice. First, I’ll set up the directory to install Grid Infrastructure.

mkdir /u01mkdir /u01/appmkdir /u01/app/grid/12.1.0.2chown –R oracle:oinstall /u01

Before I clone the VM, I will need to disable secure Linux by editing /etc/selinux/config to have the following line:

SELINUX=disabled

Page 9: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

I will also need to turn off the default firewall. If the firewall is installed, the two nodes won’t be able to talk to each other on the private network. The following will stop the firewall from starting on reboot.

chkconfig iptables off

Network Setup

At this point, the one VM has two network interfaces, on different Host-Only adapters. Adapter eth0 will be for the public network and eth1 will be for the private network. Adapter eth2 is for accessing the Internet should I need to download updates later. Right now, all adapters are using DHCP, which dynamically assigns the IP address to the adapter. For eth2, this configuration is fine. However, the other two adapters will need static IP addresses. Also, my laptop does not have a DNS server so I will need to use the local hosts file name resolution. First, I need to figure out the IP addresses for the eth0 and eth1 adapters. I use the ifconfig command and look for the “inet addr” value.

[root@host01 ~]# ifconfigeth0 Link encap:Ethernet HWaddr 08:00:27:6A:FD:84 inet addr:192.168.56.101 Bcast:192.168.56.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fe6a:fd84/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:95 errors:0 dropped:0 overruns:0 frame:0 TX packets:73 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:13085 (12.7 KiB) TX bytes:9945 (9.7 KiB)

eth1 Link encap:Ethernet HWaddr 08:00:27:0D:FD:15 inet addr:192.168.57.101 Bcast:192.168.57.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fe0d:fd15/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:6 errors:0 dropped:0 overruns:0 frame:0 TX packets:16 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2480 (2.4 KiB) TX bytes:2256 (2.2 KiB)

So eth0 has been assigned 192.168.56.101 and eth1 has been assigned 192.168.57.101. For host02, I’ll simply increase these IP addresses by a value of 1. I’ll have eth0 be 192.168.56.102 and 192.168.57.102 will be assigned to eth1. I’ll want to add the following to my hosts file:

host01 192.168.56.101host02 192.168.56.102host01-priv 192.168.57.101

Page 10: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

host02-priv 192.168.57.102

I will also need Virtual IP addresses for the standard Listeners. Since these are on the public network, they will need ‘56’ IP addresses. Just increasing the IP addresses already in use, I will assign these values.

host01-vip 192.168.56.103host02-vip 192.168.56.104

Lastly, I’ll want three IP addresses for the SCAN Listeners. I am going to name my cluster “racscan” and I will have the following IP addresses.

racscan 192.168.56.105racscan 192.168.56.106racscan 192.168.56.107

That’s all the IP addresses I’ll need. So will make sure that the VM’s /etc/hosts file contains the following entries:

192.168.56.101 host01.localdomain 192.168.56.102 host02.localdomain192.168.57.101 host01-priv.localdomain192.168.57.102 host02-priv.localdomain192.168.56.103 host01-vip.localdomain192.168.56.104 host02-vip.localdomain192.168.56.105 racscan192.168.56.106 racscan192.168.56.107 racscan

At this point, I also make sure my laptop’s local hosts file has the same entries. That way, I can use “racscan” to connect SQL Developer on my laptop to my 2-node RAC cluster. I can also use my workstation’s Terminal program to connect to the nodes.

Create host02

It is now time for me to clone the VM. I have my VM up and running so I need to shut it down first. Virtual Box has a clone wizard, which makes this process very easy. I go to Machine Clone to start the wizard. I need to supply the new machine’s name, which I will call “host02”. I make sure that the MAC address box is not checked. I will handle the MAC addresses shortly. I then press the Continue button.

Page 11: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

The next screen asks which clone type to perform. I make sure that Full Clone is checked and then I press the Clone button. This process can take awhile as Virtual Box will be copying the 40GB file that holds the VM.

After the wizard is done, host02 is ready for some minor changes. I will want to make the IP addresses static and also change the MAC addresses. I will also need to change the hostname. With host01 still powered down, I start up host02. Once it has finished booting up, I sign on as root and edit the /etc/sysconfig/network file to change the HOSTNAME value to ‘host02’.

Next, in my Gnome interface, I go to System Preferences Network Connections. I then single-click on the eth0 adapter and press the edit button. First, I’ll change the MAC address. The current MAC address is shown.

Page 12: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

Remember that this MAC address is the same address used by host01. So let’s simply change the last two characters to FF. The new MAC address in my example above will be 08:00:27:6A:FD:FF but since these are generated every time Virtual Box creates a new VM, your values will differ.

I then press the IPv4 Setting tab and change the Method to Manual so that I can define a static IP address. I then press the Add button to add an IP address. Remember that this is for eth0 on host02, which I defined to be using 192.168.56.102. The Netmask is 255.255.255.0 and the Gateway for all machines on my 56 network is 192.168.56.1. The configuration can be seen below.

Page 13: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

With the eth0 adapter defined, I press the Apply button. Next, I select the eth1 adapter and press the Edit button. Similarly, I change the last two characters of the MAC address to “FF” and the IP address to be static with a value of 192.168.57.102, same Netmask and the gateway is 192.168.57.1.

I have completed the network configuration in the VM, but I have one more task. I have to tell Virtual Box of the new MAC address. I shutdown host02. In the Virtual Box Manager, I single-click on host02 and press the Settings button. In the Network section, I make sure Adapter 1 is selected and open the Advanced menu underneath it. I then change the last two digits of the MAC address to “FF”. I perform a similar action for Adapter 2.

At this point, host02 is complete and I give it a quick reboot. I then power up host01 and configure it to have static IP addresses for eth0 and eth1. I then reboot host01. I have both VM’s up and running. I just want to verify that I have the network connections configured correctly. From host01, I verify that I can ping host02 and host02-priv. From host02, I verify that I can ping host01 and host01-priv. And from a terminal window on my laptop, I verify that I can ping all of the above. I then shutdown both VM’s to be able to perform the next steps.

Creating Shared Storage

At this point, I have two VM’s with a valid network configuration. I now need to set up the shared storage for the Oracle RAC database. In the Virtual Box Manager, I

Page 14: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

single-click on host01 and press the Settings button. I then select the Storage section. In the Storage Tree, I press on the second green plus sign to the right of the SATA Controller. This will add a new harddrive.

I then respond to Create New Disk when prompted. I name this file “rac_data_disk.vdi” as this will be where my database’s datafiles will reside. I make sure the file is 40GB in size. By default, this file will be in host01’s folder on the laptop but since this will be a shared file between hosts, I will put this in the parent directory. When done, I press Create.

I also want to create an ASM disk for my database’s online redo logs. I repeat the process with a file named “rac_redo_disk.vdi” and size it at 5GB. Similarly, I’ll need a

Page 15: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

Voting disk so I repeat the process with a file named “rac_vote_disk.vdi” and size it at 7GB. With the shared storage files created on the laptop, I pressed OK to exit host01’s Settings panel.

The next thing I need to do is to make this file shareable between VM’s. I go to File Virtual Media Manager and I can see the files I just created. I single-click on the first file and then press the Modify button. I select the Shareable option and press the OK button.

The same process is repeated for the other files to make them shareable. I then close the Virtual Media Manager.

The shared disk now needs to be added to host02. I single-click on host02 and press the Settings button. I click on the Storage button, then single-click on the SATA Controller. I then press the same green plus sign to add the harddrive. This time, I choose to add an Existing Disk. In the next screen I navigate to the shared disk file and press Open. This adds the file. I repeat for the other files. At this point, host01 and host02 are sharing the three files.

Next, I need to make these files into ASM disks. I start host01. From a terminal window, I can now see the disk devices.

[root@host01 ~]# ls -l /dev/sd*brw-rw---- 1 root disk 8, 0 Apr 7 23:34 /dev/sdabrw-rw---- 1 root disk 8, 1 Apr 8 04:34 /dev/sda1brw-rw---- 1 root disk 8, 2 Apr 8 04:34 /dev/sda2brw-rw---- 1 root disk 8, 16 Apr 8 04:34 /dev/sdbbrw-rw---- 1 root disk 8, 32 Apr 8 04:34 /dev/sdcbrw-rw---- 1 root disk 8, 32 Apr 8 04:34 /dev/sdd

Devices sdb, sdc, and sdd are the shareable files. They need to be formatted with the fdisk command. My responses are in red below.

Page 16: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

[root@host01 ~]# fdisk /dev/sdbDevice contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel with disk identifier 0x2e0f59cd.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): nCommand action e extended p primary partition (1-4)pPartition number (1-4): 1First cylinder (1-5221, default 1): Using default value 1Last cylinder, +cylinders or +size{K,M,G} (1-5221, default 5221): Using default value 5221

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

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

I repeat the process for the other disk devices. When I look for “sd*” devices, I can now see the formatted disk devices, sdb1, sdc1 and sdd1.

[root@host01 ~]# ls -l /dev/sd*brw-rw---- 1 root disk 8, 0 Apr 7 23:34 /dev/sdabrw-rw---- 1 root disk 8, 1 Apr 8 04:34 /dev/sda1brw-rw---- 1 root disk 8, 2 Apr 8 04:34 /dev/sda2brw-rw---- 1 root disk 8, 16 Apr 8 04:38 /dev/sdbbrw-rw---- 1 root disk 8, 17 Apr 8 04:38 /dev/sdb1brw-rw---- 1 root disk 8, 32 Apr 8 04:40 /dev/sdcbrw-rw---- 1 root disk 8, 33 Apr 8 04:40 /dev/sdc1brw-rw---- 1 root disk 8, 32 Apr 8 04:42 /dev/sddbrw-rw---- 1 root disk 8, 33 Apr 8 04:42 /dev/sdd1

Those new devices will be used by ASM. It’s now time to create the ASM disks.

Page 17: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

[root@host01 ~]# oracleasm createdisk DATA /dev/sdb1Writing disk header: doneInstantiating disk: done[root@host01 ~]# oracleasm createdisk REDO /dev/sdc1Writing disk header: doneInstantiating disk: done[root@host01 ~]# oracleasm createdisk VOTE /dev/sdd1Writing disk header: doneInstantiating disk: done

I then powered up host02 and issued “oracleasm listdisks” to verify that DATA, REDO, and VOTE are present on that node. At this point, the shared disk configuration is complete for my testbed.

Installing Grid Infrastructure

At this point, I can now breathe easier. The hardest part of setting this testbed is done. But all I’ve managed to accomplish is to get two distinctly different VM’s configured to act as my nodes in the cluster. The network has been set up and the shared storage connected to the nodes. Now its time to make it a cluster.

All good Grid Infrastructure installations should be preceded by a clean run of the Cluster Verification Utility (CVU). I won’t be covering execution of the CVU here. I’ll assume a clean run of the CVU was obtained before installing the Grid Infrastructure software.

I have downloaded Oracle 12.1.0.2 from My Oracle Support. Grid Infrastructure is files 3 and 4 of 8. I also downloaded files 1 and 2 of 8 since those are the RDBMS installation files. If you don’t have access to MOS, you can download the 12.1.0.1 version from Oracle’s Technet.

I need to sign on to my Gnome desktop on host01 as the ‘oracle’ user. I unzipped the Grid Infrastructure installation files into a directory and then launched the Oracle Universal Installer (OUI).

On step 1 of the OUI, I select the first option to Install and Configure GI for a Cluster. On step 2, I select the option of a standard cluster, not the Flex Cluster option. On step 3, I choose the Advanced Installation option. On step 4, I choose my language. On step 5, I have to define my SCAN information. My cluster name is “racscan” and the SCAN name is “racscan.localdomain”. I’m not using GNS, so I uncheck the box to configure it.

Page 18: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

On step 6, I add the information for host02 since the OUI only knows about the current host.

On this step, I also take the opportunity to set up my SSH keys for the ‘oracle’ user. I press on the SSH Connectivity button. I enter the ‘oracle’ user’s password and press the Setup button. I’m letting the OUI set up the SSH keys for me rather than having to do it manually at a later step.

Step 7 let’s me define the network configuration. When I created these nodes, I set up eth0 for the public interface, eth1 for the private interface, and eth2 was for my browser to connect to the outside world, which Grid Infrastructure will not use. In Step 7, I define the interfaces as seen in the following.

In Step 8, I choose to use Standard ASM for my shared storage. Step 9 is where I’ll select one of the ASM disks configured earlier for the Voting disk and OCR storage. By default, the OUI is looking for these in the wrong place. So I pressed the Change Discovery Path button and entered “/dev/oraclasm/disks”. I want to select my VOTE disk here. Since this is just a testbed and since I only have one ASM disk to use, I’ll specify External redundancy.

Page 19: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

In step 10, I specify the ASM passwords I want to use. In step 11, I decline to use IPMI. Step 12 asks for my Enterprise Manager information. I don’t have EM set up yet so I leave the box unchecked. In step 13, I accept the default groups. In step 14, I define my installation directory. Step 15 asks me for the Inventory location and I just accept the default value. Step 16 asks me for any configuration scripts to be run. I have no additional scripts so I just press the Next button.

Step 17 performs pre-requisite checks. If I had run CVU prior to the start of the install, then this step should not show any surprises. If any issues are discovered, they need to be resolved. Checks that fail can cause problems with the rest of the installation. Once the pre-req checks are good, I proceed the rest of the way through the OUI until it starts installing the software.

After the software is installed, I am prompted to run a few scripts on each node as root. It is vitally important when running the “root.sh” script to run it on one node first and then on the second node only after the first one has completed. Running them together will cause problems.

After the root scripts have completed on all nodes, I press the OK button in the OUI dialog box that requested me to run them. The OUI will complete some additional configuration. Before I call the installation of the GI software complete, I just want to verify that this is a cluster and all the nodes are present in it. First, I check the software version on all nodes.

[root@host01 bin]# ./crsctl query crs softwareversion -allOracle Clusterware version on node [host01] is [12.1.0.2.0]

Page 20: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

Oracle Clusterware version on node [host02] is [12.1.0.2.0]

Then I verify GI is running on all nodes.

[root@host01 bin]# ./crsctl status serverNAME=host01STATE=ONLINE

NAME=host02STATE=ONLINE

All looks great! Grid Infrastructure is installed and up and running. The hard work is over. The rest is pretty simple for any Oracle DBA that has installed Oracle, even non-RAC versions of it. It is now time to install the RDBMS software.

Install Oracle RAC

I had previously downloaded the RDBMS software. I simply start the Oracle Universal Installer to begin. Since Grid Infrastructure is up and running, the OUI will sense that its on a cluster and let me perform the RAC install as well.

Step 1 asks me for my email address to remain informed of security issues. I leave the fields blank and press Next. I’m then prompted to remain uninformed. On step 2, I choose the option to Install Database Software Only. I’ll create the database later. In step 3, the OUI knows this is a cluster so I can select Oracle RAC Database Installation. In step 4, I make sure that all of my nodes are selected. In step 5, I choose my language. In step 6, I choose my Edition. Step 7 lets me define my installation location. In step 8, I can define the groups. I use the default values here and press Next. The rest of the install is straightforward. At the end, I need to run a root.sh script on each node as the root user.

Before I can create the database, I need to make sure the ASM disks are available to the Oracle RAC database. From the Grid Infrastructure’s home, I start the ASM Configuration Assistant (asmca) utility. In the Disk Groups tab, only VOTE is present. I am missing REDO and DATA. I press the create button. I name the first disk group I am creating DATA. I select External Redundancy and check the box next to the DATA disk path as seen below.

Page 21: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

I repeat the process for the REDO disk group. The Disk Group tab should now show all three of the disk groups.

Create RAC Database

Now that the RDBMS software has been installed, it is time to create the first database. I start the Database Creation Assistant (DBCA). The process is pretty straightforward for those familiar with creating Oracle databases, even though this will be an Oracle RAC database.

In step 1 of the DBCA, I selected the option to Create a Database. In step 2, I selected Advanced mode. This way, I could chose my ASM disks and other non-default settings. Step 3 lets me choose the template for the database. Any template will suffice, but I typically choose the Custom Database template. In step 4, I am asked for the database name. I entered “orcl” for the database name.

In step 5, the OUI knows that the database is on an Oracle cluster. By default, the current node is selected. I want to make this an Oracle RAC database, so I make sure all nodes are selected.

Step 6 let’s me define Enterprise Manager options. Step 7 asks for SYS and SYSTEM passwords, which I supply. In step 8, I will initially define the data file locations to use the +DATA disk group. I’m not using the Flashback area or enabling archiving. My settings in Step 8 look as follows.

Page 22: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

On step 9, I can select my optional components. Step 10 lets me define the memory settings. I’ll use Automatic Memory Management and set my memory target to 2048MB. In step 11, I make sure the Create Database box is checked. At this point, the DBCA will make some final checks and then proceed with database creation.

To verify the Oracle RAC database is operational, I will connect from my laptop’s local SQL Developer program. In my connection properties, I use ‘racscan’ as the host name. The service name is ‘orcl’, as can be seen below.

Page 23: Oracle RAC on Laptop - Peasland Database Blog ... · Web viewOracle RAC on Laptop For this article, I figured I would show how to set up an Oracle RAC cluster on a laptop. I find that

With my connection properties defined, I make a connection to the database. I then query GV$INSTANCE to see all instances, their status, and the host.

At this point, I now have a running Oracle RAC database on my laptop.

Final Items

My Oracle RAC database is running on my laptop. There are a few final items worthy of discussion.

This is a testbed using virtual machines. One of the benefits of a VM solution is that we can take a snapshot of the machines. This way, we can always revert back to a known state. I shutdown both host01 and host02 and then use Virtual Box to take a snapshot of each VM. The snapshot will contain the OS and the installed software. However, it is missing the VDI shared files I created for the ASM disk groups. I will also need to make a backup copy of those files. If I need to revert back to a snapshot, I need to revert all nodes and I should restore the VDI shared files.

After database creation, I will move the online redo logs to the +REDO disk group. However, this is a simple database administration task outside the scope of this paper.

It has been my experience that it is best to shutdown the virtual machines when not using them. I have had issues with Grid Infrastructure trying to recover from my laptop waking up from its sleep. If I need to put the laptop to sleep, I shutdown the VM’s first. Also, Grid Infrastructure can have difficulty trying to recover from the VM that is put to sleep. Long story short, make sure that host01 and host02 are completely shut down.