Tuesday, April 28, 2009

oraInventory Basics

You all might be familiar with oraInventory & its importance so lets take a look at few common things about it like binary/xml inventory, What to do if Inventory is corrupted , What is global / Local Inventory and where to find documentation related to oraInventory .

What is oraInventory ?
oraInventory is repository (directory) which store/records oracle software products & their oracle_homes location on a machine. This Inventory now a days in XML format and called as XML Inventory where as in past it used to be in binary format & called as binary Inventory.
There are basically two kind of Inventory Global Inventory (also called as Central Inventory) and Local Inventory also called as Oracle Home Inventory.

Global Inventory ?
Global Inventory holds information about Oracle Products on a Machine. These products can be various oracle components like database, oracle application server, collaboration suite, soa suite, forms & reports or discoverer server . This global Inventory location will be determined by file oraInst.loc in /etc (on Linux) or /var/opt/oracle (solaris). If you want to see list of oracle products on machine check for file inventory.xml under ContentsXML in oraInventory (Please note if you have multiple global Inventory on machine check all oraInventory directories)

You will see entry like
HOME NAME="ORA10g_HOME" LOC="/u01/oracle/10.2.0/db" TYPE="O" IDX="1"/
...
...

Local Inventory
Inventory inside each Oracle Home is called as local Inventory or oracle_home Inventory. This Inventory holds information to that oracle_home only.

Can I have multiple Global Inventory on a machine ?
Quite common questions is that can you have multiple global Inventory and answer is YES you can have multiple global Inventory but if your upgrading or applying patch then change Inventory Pointer oraInst.loc to respective location. If you are following single global Inventory and if you wish to uninstall any software then remove it from Global Inventory as well.

What to do if my Global Inventory is corrupted ?
No need to worry if your global Inventory is corrupted, you can recreate global Inventory on machine using Universal Installer and attach already Installed oracle home by option
-attachHome

./runInstaller -silent -attachHome -invPtrLoc $location_to_oraInst.loc
ORACLE_HOME="Oracle_Home_Location" ORACLE_HOME_NAME="Oracle_Home_Name"
CLUSTER_NODES="{}"

Do I need to worry about oraInventory during oracle Apps 11i cloning ?
No, Rapid Clone will update both Global & Local Inventory with required information , you don't have to worry about Inventory during Oracle Apps 11i cloning.

Those of you who have registered email notification and not receiving any mails, drop me a mail at v.sundeepreddy@gmail.com

Your comments are quite important to me so leave comments about posts , suggestions, criticism, topics you want to hear or any thing about this post ....

Labels:

Install Oracle RAC Database part IV

This is fourth and last post for installing Oracle RAC Database on single machine using VMWare virtual machines. For previous posts visit

Are you scared of Oracle RAC Database
Install Oracle RAC Database I
Install Oracle RAC Database Part II
Install Oracle RAC Database Part III

In this part we will install oracle clusterware and rac database

Copy Oracle RAC and Oracle Database Software to RAC1

Create a directory software in $HOME and copy clusterware and database zip files downloaded

unzip 10201_clusterware_linux32.zip
unzip 10201_database_linux32.zip

This will create directory clusterware (for clusterware software) and database (for database software)

Verify all prereq. for clusterware installation
------------------------------------------------------------

cd /home/oracle/softwar/clusterware/cluvfy

Make sure
--Second Machine/Node RAC2 is up
-- You have configured and changes hostname and network IP of RAC2
-- RAC1 can ping RAC2 and vice versa
-- User equivalency is set for user oracle on RAC1 and RAC2
-- You can connect to rac2 from rac1 as user oracle without prompting password and vice versa

./runcluvfy.sh stage –pre crsinst –n rac1,rac2

Make sure Node reachable and User Equivalency is met, rest other checks (related memory) can be ignored

Once RAC1 and RAC2 can ping each other and oracle user can connect to other machine's oracle user without prompting password then start clusterware installation from user oracle.


Change directory to location where you have unzipped clusterware software and start clusterware installation by running runInstaller

./runInstaller





Ignore memory related prereq.


Add second node rac2 by clicking on Add link



Change subnet as per your network configuration as you did while configuring network card.




Make one public and another private (Private interconnect for clusterware)










Specify ocr location like /apps/oracle/oradata/ocr (or as per your naming convention)





Specify voting disk location like /apps/oracle/oradata/votingdisk (or as per your naming convention)







Click on Install to install clusterware.
After clusterware installation, Install Database

Install RAC Database
Go to location where you unzipped database disks
./runInstallerignoreSysPrereqs (this is required as our memory is less (below 900MB) required, if your machine spec is higher you can ignore using ignoreSysPrereqs)
























Specify database oracle_home (make this different from clusterware oracle_home installed in previous step)



































Enter database name of your choice











Select ASM









Ignore any warnings and click on OK








Define location of ASM as /dev/raw/raw3 and make redundancy as external

















Click on Install
Why number of voting disks should always be odd number only ?
How to troubleshoot RAC database and clusterware issue ?
.. Coming in future posts

Labels: ,

Step by Step install RAC using VMWare part III

his is fourth post on step by step building Oracle RAC Database on your desktop / laptop using VMWare (Virtual Machine)

For previous three posts visit

Try installing Orcale RAC on your laptop
RAC Part I - Install Virtual Machine and Linux
RAC Part II - Install Virtual Disk and Network Card

In this post you will

--Clone RAC1 to RAC2 and change IP address of RAc2
--Configure User equivalency for Orale Clusterware installation


Clone RAC1 to RAC2
-------------------------------

- Make sure virtual linux machine is shutdown
-Copy folder rac1 to folder rac2 in c:\Atul\VMWARE (This is on windows laptop/machine)










--In both RAC1 and RAC2 folder open “Red Hat Enterprise Linux 3.vmx” (This is virtual machine configuration file) using notepad or wordpad

--Add following lines (This will avoid locking for shared files and two linux machines RAC1 and RAC2 can start together using shared files votingdisk, crs and asm)


disk.locking = "FALSE"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.dataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize = "4096"
diskLib.maxUnsyncedWrites = "0"


--Now on vmx file of RAC2 “Red Hat Enterprise Linux 3.vmx” change following lines from displayName = "RAC1" to displayName = "RAC2"

--On VMWare Server Console, Click on File and Open or “Ctrl + O”


















--Click on Browse and select “red hat enterprise linux 3.vmx” from RAC2 directory

--Now you should see two linux machines RAC1 and RAC2 on VMWare Console




















Start RAC1 and RAC2 and when you get below warning on RAC2, select create and click OK
















Make sure you can start both machine at same time, if you get message like unable to lock files, check you have added following lines in both machines vmx files mentioned above (regarding disk locking)



Change Network Settings (IP) on RAC2
-------------------------------------------------

Login as ROOT user in RAC2 machine and click System Setting -> Network




















Select eth0 and click on Edit




















Change Address from 192.168.1.101 to 192.168.1.102


Click on Hardware Device Tab and Click on Probe button






















--Repeat steps for second network card eth1 and change its IP from 192.168.0.101 to 192.168.0.102

Make sure you clicked probe on eth1 as well as shown above





















Activate both network cards by clicking on Activate as shown below





















































If you get error message that eth0 has different MAC address expected as shown below; make sure you have clicked on probe on “Bind to Mac Address” on “Hardware Device” mentioned above.





















Make sure both network cards are active now, as shown below





















Add following entry in /etc/hosts file of both RAC1 and RAC2

####


127.0.0.1 loalhost.localdomain localhost
192.168.1.102 rac2.focusthread.com rac2 rac2-vip.focusthread.com rac2-vip
192.168.0.102 rac2-priv.focusthread.com rac2-priv
192.168.1.101 rac1.focusthread.com rac1 rac1-vip.focusthread.com rac1-vip
192.168.0.101 rac1-priv.focusthread.com rac1-priv

###


Now trying to ping RAC2 machine from RAC1 and RAC1 machine from RAC2



































Change Host Name of newly cloned RAC2

-------------------------------------------------


Follow below step on how to change hostname on RAC2 (newly cloned) Linux machine
Open file /etc/sysconfig/network and edit line like : HOSTNAME=XXXXX i.e. from
HOSTNAME rac1.focusthread.com To HOSTNAME rac2.focusthread.com



Configure User Equivalency

-----------------------------------

User equivalency for user oracle is required so that user oracle from RAC1 can communicate to user oracle on RAC2 machine without prompting for password for clusterware to work properly.


--Login as user oracle in machine RAC1
--Make sure sshd daemon is running (pgrep sshd), If not start it from root user like “service start sshd
--Create RSA and DSA key on each node
-From oracle user go to user home directory by “cd $HOME” or type cd and press enter
-mkdir .ssh (note that there is dot before ssh which means this is hidden directory)
-chmod 700 .ssh
-ssh-keygen –t rsa
-ssh-keygen –t dsa
press enter when prompted for file to save the key and passphrase (check screenshot for more information)













Repeat this on both the nodes i.e. RAC1 and RAC2



Add keys to authorized key file (authorized_keys)
------------------------------------------------------------
-cd .ssh
-touch authorized_keys
-ls (You should see authorized_keys, id_dsa, id_dsa.pub, id_rsa, id_rsa.pub. Here pub files are dsa and rsa public key file and id_dsa and id_rsa are private key files)
ssh rac1 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
ssh rac1 cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys
ssh rac2 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
ssh rac2 cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys
Send authorized_keys from RAC1 to RAC2
scp authorized_keys rac2:/home/oracle/.ssh












From RAC1 machine as user oracle
exec /usr/bin/ssh-agent $SHELL
/usr/bin/ssh-add











Test User Equivalency (User oracle can login to other machine without password prompt)
----------------------------
ssh rac1 date
ssh rac2 date

Test this from both nodes RAC1 and RAC2 (You should not be prompted for oracle user password)

For more information on User Equivalency visit chapter 2 (Page 51 to 53) of clusterware and rac installation guide


Coming Next :
Installing clusterware on RAC1 and RAC2
Installing RAC database on RAC1 and RAC2 linux machines using ASM

Labels: ,

Step by Step build RAC part II

This is Part II of Step by Step RAC configuration on your laptop/desktop without investing anything extra on hardware (Free) using virtual server, virtual hard disk and virtual network cards.

For first two posts visit
Try installing Orcale RAC on your laptop
RAC Part I - Install Virtual Machine and Linux

In this Part II, We will install required linux operating package for clusterware & database, additional hard disk (voting disk, ocr and ASM), network card for interconnect and configure newly added hard disk and network card.

Install rpm’s
------------------------

Install following rpm’s (These rpm’s are in Red Hat ES CD’s or download them from rhn.redhat.com ) and install them using root account

(compat-glibc-7.x-2.2.4.32.6.i386.rpm, gnome-libs-1.4.1.2.90-34.2.i386.rpm, sysstat-4.0.7-4.EL3.3.i386.rpm )

rpm –ivh compat-glibc-7.x-2.2.4.32.6.i386.rpm
rpm –ivh gnome-libs-1.4.1.2.90-34.2.i386.rpm
rpm –ivh sysstat-4.0.7-4.EL3.3.i386.rpm


Create Shared Disk on Virtual Machine for Cluster Registry, Voting Disk and ASM
------------------------------------------------------------
--Shutdown linux machine RAC1 (installed in part I) as “shutdown now” (from root user)
--Create folder “shared” in location “c:\atul\VMWARE” (or any other location of your choice)
--From VM Ware Console Press Ctrl + D to see Virtual Machine Settings

Or from screen




Click on Edit Virtual Machine Setting


Click on Add



Click on Next


Select Hard Disk as shown here and click Next



Select Create a New Virtual Disk and click Next





Select SCSI and click Next




Select 5.0 GB for voting disk and 5.0 GB for ocr (add second disk of 5 GB for ocr using same method) and 8 GB for asm (add third disk of 8 GB for ASM using same method)






Enter location and disk file name in folder shared created above.
Note* Select votingDisk for disk one created , ocr for second disk created and asm for third disk created . This name doesn't matter and this is for our understanding only.
Click Finish








Repeat above step of adding disk for ocr and asm. Finally you should see Hard Disk 2,3,4
Hard Disk 2 : for votingDisk (5 GB)
Hard Disk 3 : for ocr (5 GB)
Hard Disk 4 : for ASM (8GB)

This completes addition of hard disk (How to configure and share these hard disks coming next ..)


Adding Network Card for Interconnect
----------------------------
Next step is to create network card, there is already an existing network card which is used as public connection for connecting to this machine and database isnatance on this machine and new card will be used oracle clusterware as private inerconnect between two nodes of RAC i.e. RAC1 and RAC2. This private interconnect is used for clusterware talking to all remote nodes in cluster.
From VMWare Console press Ctrl + D













Select Ethernet Adapter this time and click Next











Select Bridged and click Finish





Now Start your linux Virtual Machine

On start of linux Virtual Machine you linux machine will detect newly added network card which you can configure now (at boot time only) or you can configure later as well.




Press Any Key to enter into setup part of network card






Select Configure and click enetr or you can configure it later as well






Enter following details
IP Address -----------------192.168.0.101
Netmask ------------------- 255.255.255.0
Default Gateway --------- 192.168.0.254
Primary Nameserver ---- 192.168.0.1




and select OK and press enter




Login as Root User when prompted to login
Above we configured newly added network card eth1 (used for interconnect).
With below method we will configure original network card (for public connection)




Syetem Setting -> Network






select eth0 and click Edit









Add entry like
----------------------
Address 192.168.1.101
Subnet Mask 255.255.255.0
Default Gateway Address 192.168.0.254



Click OK and activate this netowrk card


Activate eth0 by clicking on Activate button










Click on Yes, when prompted to save network configuration





Now you should see both network card eth0 and eth1 as Active








ifconfig , from root should show you result as shown in screenshot








Format and Configure Virtual disks (voting disk, ocr and asm )
----------------------------------------------------

In this step We will format and configure Virtual Disks created above.

From user root

fdisk –l (This is to see list of disks, You will see entry like /dev/sdb, /dev/sdc, /dev/sdd doesn’t contain valid partition table)


fdisk /dev/sdb (Means we are dealing with /dev/sdb)
n (Create new disk)
p (Of type primary partition)
1 (First Cylinder)
Enter (carriage return)
Enter (carriage return)
w (Save table to disk and exit)

(For more information check man fdisk or below screenshot)
Repeat above step for /dev/sdc and /dev/sdd























So now fdisk –l you should details of /dev/sdb, dev/sdc, dev/sdd
--Add These disks as raw devices in file /etc/sysconfig/rawdevices as
/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdc1
/dev/raw/raw3 /dev/sdd1
--Restart rawdevices service as service rawdevices restart










Create directory /apps/oracle/oradata (For storing voting disk, ocr and ASM) as

mkdir –p /apps/oracle/oradata (From Root Account)

-->Create symbolic link pointing to these raw devices so that we know which one is for what (Optional)

ln –s /dev/raw/raw1 /apps/oracle/oradata/ocr
ln –s /dev/raw/raw2 /apps/oracle/oradata/votingdisk
ln –s /dev/raw/raw3 /apps/oracle/oradata/asm
--Change ownership of these directories to oracle:oracle
chown oracle:oracle /dev/raw/raw1
chown oracle:oracle /dev/raw/raw2
chown oracle:oracle /dev/raw/raw3


Shutdown this machine as this is now ready to clone and to create RAC2 machine.
Coming Next
-Cloning RAC1 to RAC2
-Changing RAC2 network and hostname details
-Configuring user equivalency
-Installing clusterware 10.2.0.1
-Installing Oracle rac database 10.2.0.1
-Tips and Tricks of troubleshooting Oracle RAC Database and clusterware.....

Labels: ,