Thursday, April 28, 2011

crs_stat deprecated in 11gR2

The most used to command "crs_stat -t" is gone (deprecated) on 11gR2. Instead you would use - 

crsctl status resource [the output will be status of all resources]

You can still use the "-t" option to get a tabular report though ;)

crsctl status resource -t

Specify resource name "ora.mydb.vip" to get the status of any particular resource -
crsctl status resource ora.mydb.vip

In fact, quite a few commands have been deprecated in 11gR2; For the complete list refer to http://download.oracle.com/docs/cd/E11882_01/rac.112/e16794/crsref.htm#CHDHBECE

Wednesday, April 20, 2011

Instance Caging

Many of you would already be aware of this one while I discover it now but still putting down my thoughts on this 11g new feature.
Most of the times, we end up running multiple instances on a single box for developmental effort. Or even on Production by buying a reasonably big box to save on licensing cost and also in the name of consolidation exercise :). But doing so, throws up the challenge for a DBA in terms of allocating resources to each instance. Some low priority activity on an instance eating up CPU resources and thus depriving the much needed resource to those requiring it. CPU allocation decisions such as this are made solely by the operating system; the user generally has no control over them.
Instance caging in 11gR2 is a method to cage or bound the instance to use a certain no of CPU’s instead hogging all the available CPU’s. All we have to do is set an initialization parameter to control the CPU resources an instance can use. It basically limits the no of CPU’s an instance can use e.g. I can set this parameter to “1” on a 4 CPU machine. It’s very simple (silly :)) to set it –

ALTER SYSTEM SET CPU_COUNT = 4; 

However, it works with resource manager feature so you will need to enable RM and create a resource plan first before running the above command.
Instance caging can be useful on larger box with multiple instances running – some development and a few production allowing CPU and resource allocation be done effectively. Apart from this, it can also be said that it’s Oracle’s way (alternate option) of giving CPU resource allocation control to a DBA rather than leveraging a logical/physical partitioning of a large box resorting to usage of tools/technologies such as VMware, AIX LPAR or Sun containers etc. In a nut shell, it’s the simple way to control the CPU consumption of each database instance.
Maybe sometime later, I will try to post an example. Thanks for reading and appreciate your comments / thoughts.

Wednesday, April 6, 2011

Oracle Restart - a 11g New Feature

Oracle Restart is a new feature introduced to enhance the availability of Oracle database. I wasn't aware of this till recently. It basically allows various components of Oracle to restart automatically in a stand-alone (non-clustered) installation. This functionality is similar to what Clusterware does in a RAC setup. On Windows and Linux, we were able to achieve all this via creating a service or writing a script. But now it’s not required. So in a way, it also makes the age old practice of writing scripts to restart redundant.

Oracle instances and its dependent components restart automatically after any hardware or software failures and machine reboots. The components that can be restarted are –
  • Database instance
  • Oracle Listener
  • ASM instance
  • ONS (Oracle notification service)
It continuously monitors all the Oracle services started via it and restarts any of the failing services. It ensures that the components are starts in proper order e.g. starting the ASM instance before starting the database instance. What’s important is that Oracle restart is integrated with tools like SQL*Plus, LSNRCTL, and ASMCMD; so when you shut down the database or listener with the respective utilities, Oracle Restart does not interpret it as a failure and hence does not attempt to restart.

Much like clusterware, Oracle Restart also comes with a server control utility (SRVCTL); you should start/stop the components with SRVCTL.

In my opinion, this is a pretty useful tool and option to have. Gets rid of any additional scripting that would have required in day-to-day operations. Also serves as an introduction to how to manage services in a RAC which is a good thing for junior DBA's. The only problem the tool still looks for “ORA_CRS_HOME”, which is a bit weird given that it is supposedly for single (non-RAC) instance databases.