… time for the grid infrastructure

March 23, 2012 — Leave a comment

The OS is prepared and everything is configured. Time to come to the first part of the installation: Oracle Grid Infrastructure

If you did not already transfer the source files to your Virtual Machine do it now. If your workstation runs on linux, here is an example:

scp -P 3000 p10404530_112030_Linux-x86-64_1of7.zip grid@localhost:/opt/oracle/stage
scp -P 3000 p10404530_112030_Linux-x86-64_2of7.zip grid@localhost:/opt/oracle/stage
scp -P 3000 p10404530_112030_Linux-x86-64_3of7.zip grid@localhost:/opt/oracle/stage
scp -P 3000 p13348650_112030_LINUX.zip grid@localhost:/opt/oracle/stage

Windows users may use tools like winscp, filezilla or cygwin to name a few of it.

As the Grid Infrastructure will be installed under the “grid” user, establish a ssh connection to your Virtual Machine and do the installation ( we will do a software only installation here, nothing will be configured for the moment ):

su - grid
cd /opt/oracle/stage
unzip p10404530_112030_Linux-x86-64_3of7.zip
cd grid
./runInstaller \
INVENTORY_LOCATION=/opt/oracle/oraInventory \
SELECTED_LANGUAGES=en \
oracle.install.option=CRS_SWONLY \
ORACLE_BASE=/opt/oracle/product/base \
ORACLE_HOME=/opt/oracle/product/crs/11.2.0.3 \
ORACLE_HOME_NAME=HCRS112030 \
UNIX_GROUP_NAME=oinstall \
oracle.install.asm.OSDBA=asmdba \
oracle.install.asm.OSASM=asmadmin \
FROM_LOCATION=../stage/products.xml \
DECLINE_SECURITY_UPDATES=true \
-ignoreSysPrereqs \
-ignorePrereq \
-waitforcompletion \
-silent
su -
/opt/oracle/oraInventory/orainstRoot.sh
/opt/oracle/product/crs/11.2.0.3/root.sh

That’s it for the software installation. Surprised ? The most important thing to remember if installing oracle software is: Read the installation guides and fulfill all the requirements. If you do this, the installation will be fast and easy.

Some explanations for the above commands:

  • runInstaller: this is oracle installer on linux/unix ( it is setup.exe on windows )
  • INVENTORY_LOCATION: the location where you want to store the central oracle inventory
  • SELECTED_LANGUAGES: the languages you want to install for the product
  • oracle.install.option: how do you want to install ( CRS_SWONLY is for installing the software, but do not configure anything )
  • ORACLE_BASE: the location you want to use for the $ORACLE_BASE
  • ORACLE_HOME: the location where you want to install the product, this is the $ORACLE_HOME
  • UNIX_GROUP_NAME: the OS group you want to own the installed software
  • oracle.install.asm.OSDBA: the OS group you want to use as asm dba
  • oracle.install.asm.OSASM: the OS group you want to use for sysasm
  • FROM_LOCATION: references the xml where all the products are defined
  • DECLINE_SECURITY_UPDATES: true means: do not try to connect to oracle support for downloading the latest patches
  • -ignoreSysPrereqs: ignore the system prerequisites
  • -ignorePrereq: ignore all the other prerequisites
  • -waitforcompletion: wait until the installation completes before returning to the shell
  • -silent: do a silent installation ( do not use the graphical mode )

Take a look at the sample response file if you want to learn about all the other options you can use ( /opt/oracle/stage/grid/response/grid_install.rsp ).

The root scripts:

  • /opt/oracle/oraInventory/orainstRoot.sh : Creates the pointer to the oraInventory and sets the correct permissions
  • /opt/oracle/product/crs/11.2.0.3/root.sh: Calls various other scripts to set up the installation

Lets see if if everything works as expected and configure the cluster stack for single node ( The Grid Infrastructure sofware is exactly the same for Cluster and Single Node installations. For single node installations, oracle calls this “Oracle Restart” ):

su -
/opt/oracle/product/crs/11.2.0.3/crs/install/roothas.pl

The output should like this:

[root@oracleplayground stage]# /opt/oracle/product/crs/11.2.0.3/crs/install/roothas.pl
Using configuration parameter file: /opt/oracle/product/crs/11.2.0.3/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node oracleplayground successfully pinned.
Adding Clusterware entries to inittab
oracleplayground 2012/03/23 09:18:15 /opt/oracle/product/crs/11.2.0.3/cdata/oracleplayground/backup_20120323_091815.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server

If you had troubles you can deconfigure the whole stack and try again:

su -
/opt/oracle/product/crs/11.2.0.3/crs/install/roothas.pl -deconfig -force
### check the logfiles ( $ORACLE_HOME/log/oracleplayground/* ) for the issue and try to configure again
/opt/oracle/product/crs/11.2.0.3/crs/install/roothas.pl

There is one important thing to note: Take a look at this line:

Using configuration parameter file: /opt/oracle/product/crs/11.2.0.3/crs/install/crsconfig_params

This is the one and only configuration file you will need to adjust if setting up the stack for a cluster ( If you want to configure for a cluster rootcrs.pl will be used instead of roothas.pl, but the configuration file keeps the same ).
In our case we do not need to modify it, as we will work with a single node.

What happened here:
The script created same trace directories, the olr ( oracle local registry ), pinned the node and added a call to inittab. Can verify this with:

cat /etc/inittab | grep ohas

If you take a look at your processes now, you’ll notice that several oracle processes started up:

ps -ef | grep ora

This are the basic cluster stack processes which will manage you oracle infrastructure.

  • ohasd.bin: the process resonsible for starting up all the cluster processes
  • oraagent.bin: will spawn agents to start resources
  • evmd.bin: the event volume manager daemon
  • evmlogger.bin: spawned by evmd to log events

To make a life a bit easier for us, lets define some aliases and environment variables for the grid user:

su - grid
echo "ORACLE_HOME=/opt/oracle/product/crs/11.2.0.3
ORACLE_BASE=/opt/oracle/base
ORACLE_SID=+ASM
PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
PS1='\[33[1;34m\]${ORACLE_SID}\[33[1;33m\]@\[33[1;32m\]`uname -n`\[33[0m\] $LOGNAME:$PWD $ '
export ORACLE_HOME ORACLE_BASE ORACLE_SID PATH LD_LIBRARY_PATH PS1
alias crsstat='crsctl status resource -t'" >> ~/.bash_profile

It is a good idea to reboot your Virtual Machine now and to check if the cluster stack comes up again.

su -
reboot

Once the Virtual Machine is up and running again ( notice that it will take some time for the oracle processes to come up ), verify if you can interact with the stack ( we will use the alias defined above for this ):

su - grid
crsstat

If everything is fine, the output should like this:

--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ons
OFFLINE OFFLINE oracleplayground
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 OFFLINE OFFLINE
ora.diskmon
1 OFFLINE OFFLINE
ora.evmd
1 ONLINE ONLINE oracleplayground

To summarize: We installed the Grid Infrastructure software without doing any configuration initially and executed the root scripts for setting up permissions, the oracle inventory and the grid infrastructure software. roothas.pl did the configuration of the cluster stack, added an entry to the inittab and generated the oracle local registry. We did a reboot to check if everything comes up again and defined some environment variables and aliases to make life a bit easier for us.

If you’ll ask yourself what the crsctl is for: We will come back to all the commands in next posts and introduce them when appropriate.

In the next post we will apply the first patch to the grid infrastructure and will learn about the oracle patch utility opatch.

Again, remember to take a snapshot of your Virtual Machine if you want to save your work or if you want to revert to this point. Delete the source files if you do not want to become your Virtual Machine too big before:

su - grid
cd /opt/oracle/stage/
rm -rf grid/ p10404530_112030_Linux-x86-64_3of7.zip

On your workstation create the snapshot:

vboxmanage snapshot oracleplayground take "after gi installation and configuration"

 

 

Advertisements

No Comments

Be the first to start the conversation!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s