The Blog from the DBA Classroom

By: Joel Goodman

Archive for August, 2010

Get Started With Oracle Restart

Posted by Joel Goodman on 13/08/2010


In my previous post called “How Does Your Infrastructure Stack Up” , I discussed the Architecture of Oracle Grid Infrastructure for a cluster, and explained the concepts of the lower and upper software stacks, as well as those components managed by the two stacks.  This software, which is a combination of Oracle Clusterware and Automatic Storage Management (ASM), is required for running Oracle Databases with the Real Application Clusters (RAC) option, and may be used to provide high availability for other Oracle and third party software too.

Grid Infrastructure is also available for installation on a stand-alone server and consists of the following:

  1. A lower stack only,  managed by the Oracle High Availability Serviced daemon OHASD
  2. A set of agents to manage root-owned and non root-owned resources.
  3. A subset of the clusterware to manage resources on a standalone server
  4. A subset of the clusterware to facilitate ASM communication with Oracle Database (RDBMS) Instances

As there is only a single stack in Grid Infrastructure for a Standalone Server, OHASD is used to manage it and there is no CRSD process required. The components under control of OHASD are:

  1. CSSD – This is used for Group Services as it was in previous releases (when it was installed using “localconfig add“)
  2. ASM Instance – if Automatic Storage Management is used.
  3. ASM Disk Groups – if Automatic Storage Management is used.
  4. Listeners
  5. Database Instances
  6. Database Services
  7. ONS/EONS – Used for automatic failover of connections  using Fast Application Notification (FAN) in a Data Guard environment

Grid Infrastructure for a standalone server is a combination of a Clusterware subset known as “Oracle Restart” and ASM.  The OHASD is a daemon which starts and monitors the Oracle Restart daemons themselves. It is started by init using the /etc/init.d/ohasd script and starts the ohasd.bin executable as root. It is described in the documentation in the Administrators guide in a section called “About Oracle Restart“. No OCR exists for this stack but there is an OLR containing the local resource definitions and this is used by the ohasd daemons.

There are many benefits to using Oracle Restart:

  1. Automatic resource startup at boot time without using shell scripts or the Oracle supplied dbstart and dbshut scripts.
  2. Resources are started in the correct sequence based on dependencies in the OLR.
  3. Resources are also monitored by ohasd for availability and may be restarted in place if they fail.
  4. Role managed services for Data Guard.
  5. Consistency of command line interfaced tools using crsctl and srvctl as is done with clusters.

A list of commands used to manage the Oracle Restart stack are  listed in the documentation here.  The CRSCTL utility is used but instead of referring to CRS, the commands refer to HAS. These commands are only for use in an  Oracle Restart environment:

  1. crsctl start has – to manually start the Oracle Restart stack when running disabled or after manually stopping it
  2. crsctl stop has [-f] – to manually stop the Oracle Restart stack. The -f option
  3. crsctl enable has – to enable the stack for automatic startup at server reboot
  4. crsctl disable has – to disable the stack for automatic startup at server reboot
  5. crsctl config has – to display the configuration of Oracle Restart
  6. crsctl check has – to check the current status of Restart

Some of the crsctl commands used for clusters may also be used for Oracle Restart. A typical example follows but there are many more:

  • crsctl stat res -t – to check the status of the resources in the Oracle Restart stack managed by OHASD

Note also that “crsctl stat res -init -t” does not work for Oracle Restart as there is only one stack, and therefore no need to indicate which stack is to be displayed.

Here is a typical output of the OHASD stack for Oracle Restart with ASM, some Disk Groups, a single database instance and a service:

—————————————————————————————————————————-

NAME                   TARGET  STATE           SERVER                   STATE_DETAILS

—————————————————————————————————————————-

Local Resources

—————————————————————————————————————————–

ora.CELL_DG.dg

ONLINE  ONLINE       prutser2

ora.DATA.dg

ONLINE  ONLINE       prutser2

ora.FRA.dg

ONLINE  ONLINE       prutser2

ora.LISTENER.lsnr

ONLINE  ONLINE       prutser2

ora.asm

ONLINE  ONLINE       prutser2                     Started

—————————————————————————————————————————-

Cluster Resources

—————————————————————————————————————————-

ora.cssd

1                   ONLINE  ONLINE       prutser2

ora.diskmon

1                   ONLINE  ONLINE       prutser2

ora.ora11g.db

1                   ONLINE  ONLINE       prutser2                     Open

ora.ora11g.ora11g.svc

1                   ONLINE  ONLINE       prutser2

In addition srvctl is used to manage the resources in the various Oracle Home directories that are controlled by Oracle Restart and these are in the same section of the documentation here. The commands used are the same as for a cluster except that resources such as database instances, will be configured on only the one node.

Even if ASM is not used, Oracle Restart is a useful addition to Oracle Database and resource management. So get started!

Joel

August 2010

Posted in Oracle | 5 Comments »