Oracle NZ - Francisco Munoz Alvarez

1. November 2008

Let’s play with Oracle RAC 11g and Oracle Enterprise Linux 5- Part I

Filed under: RAC, Tutorials — admin @ 14:55

 

This is the first of many workshops I’ll start to post on my blog, at the end of each one I’ll post the full paper and some videos teaching step by step each workshop.

Let’s start with the first one ;)

Part I - Creating the Virtual Environment

Project Name

Oracle Rac5/2008

Author

Francisco Munoz Alvarez

Software Used

Oracle Enterprise Linux 5

WMware Workstation 6.0.4 build 93057

Oracle 11.1.0.6 Database and Clusterware Software

Date

30/10/2008

 

The idea of this workshop, it’s to guide you on how to create a RAC Installation using VMware Workstation 6, Oracle Enterprise Linux 5, and Oracle 11g.

This installation should never be used for Production or Development purposes. This installation was created for educational purpose only, and is extremely helpful to learn and understand how Oracle RAC works and if you do not have access to traditional hardware resources.

1. Project Hardware and Software Overview

 

Host Machine

Machine Name

Francisco-PC

Operational System

Windows Vista Business SP1

VMware Version

WMware Workstation 6.0.4 build 93057

Host Machine

HP Pavilion 6730b

Memory

3 GB

External Hard Drive

600 GB

Processor

Intel Core Duo P8400

 

Virtual Machine #1 - Rac1

Operational System

Oracle Enterprise Linux 5

Machine Name

rac1

Database Version

11.1.0.6

Instance Name

Test1

Public Name/IP - (eth0)

rac1.dbisonline.com - 192.168.2.8

Interconnect Name/IP - (eth1)

rac1-vip.dbisonline.com -10.10.10.11

Memory

860 MB

CPU

2 CPUs

Hard Drive

18 GB

Location

C:\Users\francisco\Documents\labs-virtual-machines\RAC\rac1

Virtual Machine #2 - Rac2

Operational System

Oracle Enterprise Linux 5

Machine Name

rac2

Database Version

11.1.0.6

Instance Name

Test2

Public Name/IP - (eth0)

rac2.dbisonline.com - 192.168.2.9

Interconnect Name/IP - (eth1)

rac2-vip.dbisonline.com -10.10.10.12

Memory

860 MB

CPU

2 CPUs

Hard Drive

18 GB

Location

C:\Users\francisco\Documents\labs-virtual-machines\RAC\rac2

VMware File

Virtual Disks

Virtual Device Node

Size (GB)

Description

RAC\rac1\localdisk-flat.vmdk

/dev/sda1

/dev/sda2

SCSI 0:0

8

/

Mount Point

Swap space

Oracle Binaries

RAC\shared_storage\ocfs2-flat.vmdk

/dev/sdb1

SCSI 1:0

1

OCFS2 Disk

RAC\shared_storage\asm1-flat.vmdk

/dev/sdc1

SCSI 1:1

3

ASM disk group 1

RAC\shared_storage\asm2-flat.vmdk

/dev/sdd1

SCSI 1:2

3

ASM disk group 2

RAC\shared_storage\asm3-flat.vmdk

/dev/sde1

SCSI 1:3

3

ASM Flash Recovery Area

 

2. The Software

You can download all software you will need to this project at the following urls:

 

 

3. Virtual Machine Rac1 Setup

 

We are going to create 2 virtual machines (Rac1 and Rac2) that will share 5 disks (asm1, asm2, asm3, ocfs2 and local disk).

First we will create the windows folders to have the virtual machines and the shared storage.

  • C:\Users\francisco\Documents\labs-virtual-machines\RAC\rac1
  • C:\Users\francisco\Documents\labs-virtual-machines\RAC\rac2
  • C:\Users\francisco\Documents\labs-virtual-machines\RAC\shared_storage

1. Then Double-click on the VMware Icon your desktop to bring up the application:

clip_image002[1]

2.   Click on the New Virtual Machine Icon.

clip_image004[1]

3. New Virtual Machine Wizard: Click on Next.

clip_image006[1]

4. In the Select the Appropriate Configuration Window Select Custom and then press next.

clip_image008[1]

5. Press Next in the Compatibility Window.

clip_image010[1]

6. Select a Guest Operating System:

  • a. Guest operating system: Select Linux.
  • b. Version: Select Red Hat Enterprise Linux 5.

c. Press Next

clip_image012[1]

7. Name the Virtual Machine:

  • a. Virtual machine name: Enter rac1
  • b. Location: Enter C:\Users\francisco\Documents\labs-virtual-machines\RAC\rac1\
  • c. Press Next

clip_image014[1]

8. Processor Configuration

  • a. Number of processors: Select Two
  • b. Press Next

clip_image016[1]

9. Memory for the Virtual Machine

  • a. Memory: Enter 860 MB
  • b. Press Next

clip_image018[1]

10. Network Type

  • a. Network Connection: Select Use bridged networking
  • b. Press Next

clip_image020[1]

11. Select I/O Adapter Types

  • a. SCSI Adapters: Select LSI Logic
  • b. Press Next

clip_image022[1]

12. Select a Disk:

  • a. Disk: Select create a new virtual disk.
  • b. Press Next

clip_image024[1]

13. Select a Disk Type:

  • a. Virtual Disk Type: Select SCSI (Recommended).
  • b. Press Next

clip_image026[1]

14. Specify Disk Capacity:

  • a. Disk capacity: Enter 8GB and Select Allocate all disk space now.
  • b. Press Next

clip_image028[1]

15. Specify Disk File:

  • a. Disk file: Enter localdisk
  • b. Click on Finish.

clip_image030[1]

clip_image032[1]

16. Now we will create the rest of shared disks:

  • a. VMware Server Console: Click on Edit virtual machine settings.

clip_image034[1]

17. Add Hardware Wizard: Click on Next.

clip_image036[1]

18. On Hardware Type:

  • a. Hardware types: Select Hard Disk
  • b. Then click on Next

clip_image038[1]

19. Select a Disk:

  • a. Disk: Select Create a new virtual disk.
  • b. Then Click Next

clip_image040[1]

20. Select a Disk Type:

  • a. Virtual Disk Type: Select SCSI (Recommended).
  • b. Mode: Select Independent
  • c. Mode: Select Persistent
  • d. Then Click Next

clip_image042[1]

21. Specify Disk File:

  • a. Disk file: Enter “C:\Users\francisco\Documents\labs-virtual-machines\RAC\shared_storage\ocfs2.vmdk”
  • b. Then Click Next

clip_image044[1]

22. Specify Disk Capacity:

  • a. Disk capacity: Enter “1.0GB”
  • b. Select Allocate all disk space now.
  • c. Then Click Finish

clip_image046[1]

clip_image048[1]

clip_image050[1]

Repeat steps 16 to 22 to create all the other virtual SCSI hard disks:

  • asm1.vmdk, C:\Users\francisco\Documents\labs-virtual-machines\RAC\shared_storage\asm1.vmdk (3GB),
  • asm2.vmdk, C:\Users\francisco\Documents\labs-virtual-machines\RAC\shared_storage\asm2.vmdk (3GB),
  • asm3.vmdk, C:\Users\francisco\Documents\labs-virtual-machines\RAC\shared_storage\asm3.vmdk (3GB).

Then when finish you will have something like this:

clip_image052[1]

Add an additional virtual network card for the private interconnects:

  • a. VMware Server Console: Click on Edit virtual machine settings.
  • b. Hardware types: Ethernet Adapter.
  • c. Then Click Next

clip_image054[1]

On Network Type:

  • a. On Network Connection Select Bridget: Connect directly to the physical network
  • b. Click on Finish.

clip_image056[1]

Then Select Floppy then:

  • a. click on Remove
  • b. Then OK.

clip_image058[1]

clip_image060[1]

Like you see the hard drives are showing:

  • Hard Disk (SCSI 0:0) 8 GB
  • Hard Disk (SCSI 0:1) 1 GB
  • Hard Disk (SCSI 0:2) 3 GB
  • Hard Disk (SCSI 0:3) 3 GB
  • Hard Disk (SCSI 0:4) 3 GB

Now we need to change them to look like this:

  • Hard Disk (SCSI 0:0) 8 GB
  • Hard Disk (SCSI 1:0) 1 GB
  • Hard Disk (SCSI 1:1) 3 GB
  • Hard Disk (SCSI 1:2) 3 GB
  • Hard Disk (SCSI 1:3) 3 GB

To make this possible we will give double-click over the hard disk showing SCSI 0:1

  • a. Then Click on Advanced

clip_image062[1]

Then Change Virtual Device node

  • a. From SCSI 0:1 Hard Disk (SCSI 0:1)
  • b To SCSI 1:0
  • c. Then Click OK
  • d. Then Click OK one more time

clip_image064[1]

clip_image066[1]

Repeat these steps to change:

  • Hard Disk (SCSI 0:2) 3 GB to SCSI 1:1
  • Hard Disk (SCSI 0:3) 3 GB to SCSI 1:2
  • Hard Disk (SCSI 0:4) 3 GB to SCSI 1:3

clip_image068[1]

Now to finish this virtual machine, edit the file C:\Users\francisco\Documents\labs-virtual-machines\RAC\Red Hat Enterprise Linux 4.vmx.

               a. Then add the following lines to it like the example bellow:

disk.locking = "FALSE"
diskLib.dataCacheMaxSize = "0"
scsi1.sharedBus = "virtual"

b.

config.version = "8"

virtualHW.version = "6"

numvcpus = "2"

scsi0.present = "TRUE"

scsi0.virtualDev = "lsilogic"

memsize = "860"

scsi0:0.present = "TRUE"

scsi0:0.fileName = "localdisk.vmdk"

ide1:0.present = "TRUE"

ide1:0.fileName = "auto detect"

ide1:0.deviceType = "cdrom-raw"

floppy0.autodetect = "TRUE"

ethernet0.present = "TRUE"

ethernet0.wakeOnPcktRcv = "FALSE"

usb.present = "TRUE"

ehci.present = "TRUE"

sound.present = "TRUE"

sound.fileName = "-1"

sound.autodetect = "TRUE"

svga.autodetect = "TRUE"

pciBridge0.present = "TRUE"

mks.keyboardFilter = "allow"

displayName = "rac1"

guestOS = "rhel5"

nvram = "Red Hat Enterprise Linux 4.nvram"

deploymentPlatform = "windows"

virtualHW.productCompatibility = "hosted"

tools.upgrade.policy = "useGlobal"

disk.locking = "FALSE"

diskLib.dataCacheMaxSize = "0"

scsi1.sharedBus = "virtual"

ide1:0.autodetect = "TRUE"

floppy0.fileName = "A:"

extendedConfigFile = "Red Hat Enterprise Linux 4.vmxf"

scsi0:1.present = "FALSE"

scsi0:1.fileName = "C:\Users\francisco\Documents\labs-virtual-machines\RAC\shared_storage\ocfs2"

scsi0:1.mode = "independent-persistent"

scsi0:2.present = "FALSE"

scsi0:2.fileName = "C:\Users\francisco\Documents\labs-virtual-machines\RAC\shared_storage\asm1.vmdk"

scsi0:2.mode = "independent-persistent"

scsi0:3.present = "FALSE"

scsi0:3.fileName = "C:\Users\francisco\Documents\labs-virtual-machines\RAC\shared_storage\asm2.vmdk"

scsi0:3.mode = "independent-persistent"

scsi0:4.present = "FALSE"

scsi0:4.fileName = "C:\Users\francisco\Documents\labs-virtual-machines\RAC\shared_storage\asm3.vmdk"

scsi0:4.mode = "independent-persistent"

floppy0.present = "FALSE"

ethernet1.present = "TRUE"

ethernet1.wakeOnPcktRcv = "FALSE"

scsi1.present = "TRUE"

scsi1.virtualDev = "lsilogic"

scsi1:0.present = "TRUE"

scsi1:0.fileName = "C:\Users\francisco\Documents\labs-virtual-machines\RAC\shared_storage\ocfs2"

scsi1:0.mode = "independent-persistent"

scsi1:1.present = "TRUE"

scsi1:1.fileName = "C:\Users\francisco\Documents\labs-virtual-machines\RAC\shared_storage\asm1.vmdk"

scsi1:1.mode = "independent-persistent"

scsi1:2.present = "TRUE"

scsi1:2.fileName = "C:\Users\francisco\Documents\labs-virtual-machines\RAC\shared_storage\asm2.vmdk"

scsi1:2.mode = "independent-persistent"

scsi1:3.present = "TRUE"

scsi1:3.fileName = "C:\Users\francisco\Documents\labs-virtual-machines\RAC\shared_storage\asm3.vmdk"

scsi1:3.mode = "independent-persistent"

 

Ok, let’s finish here for today folks. Tomorrow I’ll explain how to create the second node and to install the Oracle Enterprise Linux 5

Cheers,

Francisco Munoz Alvarez 

16. September 2008

How to Start and Stop a RAC Environment

Filed under: Oracle FAQ, RAC, Questions — admin @ 10:28

Auto Start/Stop

The Oracle Cluster Services handle the automatic start and stop of the Cluster, Listener, ASM and the Database.

For the Grid Control Agent, the auto start- stop is handled via the /etc/init.d/dbora script.  On server boot the dbora script starts the agent with /home/oracle/scripts/start_agent. On server shutdown the dbora script calls /home/oracle/scripts/stop_agent

Manual Start/Stop

Each database instance may be manually started and stopped using standard sqlplus scripts. However, it is highly recommended that the srvctl command interface be used in a RAC environment. Note that srvctl commands can be run remotely from any node in the cluster.

Nodeapps

srvctl start nodeapps –n hostname

srvctl stop nodeapps –n hostname 

Listener

srvctl start listener –n hostname

srvctl stop listener –n hostname 

Database

srvctl start database –d edwdev

srvctl stop database –d edwdev –o immediate

Instance

srvctl start instance –d edwdev –i edwdev1

srvctl start instance –d edwdev –i edwdev2

srvctl stop instance –d edwdev –i edwdev1

srvctl stop instance –d edwdev –i edwdev2

ASM

srvctl start asm –n hostname

srvctl stop asm –n hostname 

Grid Control Agent

Set environment to ‘agent’ using . oraenv

$ORACLE_HOME/bin/emctl start agent

$ORACLE_HOME/bin/emctl stop agent 

Regards,

Francisco Munoz Alvarez

Powered by WordPress