Sunday, November 29, 2009

Tracing a User Seeion in Oracle - DBMS_SUPPORT

Many a times we need to trace a user session.

For this oracle has supplied a package called DBMS_TRACE.

To Trace a user session we can start Sql Tracing by using -

exec dbms_support.start_trace_in_session(sid,serial#,binds=>true,waits=>true);

Since we are setting waits=> true this will capture wait information of Sqls.

And Binds=> true will capture bind values.

To stop tracing -

exec dbms_support.stop_trace_in_session(sid,serial#)

Saturday, November 28, 2009

Oracle RAC with Veritas (SFRAC)

In one of the projects that we are handling, we have SFRAC. This is the first time i am workin on any setup that has Veritas Storage foundation for RAC implemented. I was much excited to work on something new , and after reading for sometime and going through veritas docs, i am somewhat comfortable in handling issues.
Will update this post more, in some time.

Friday, November 27, 2009

CRS Commands

CRS is cluster ready services. CRS controls oracle clusterware and services controlled by oracle cluster. For this there are CRS deamons that run continuously on both the nodes and monitor the operation of cluster.
In this post i will tell few basic commands to stop and start CRS.

To check whether crs deamons are running or not we use-

crsctl check crs

And if you have to check all services controlled by cluster, then use the command -

crs_stat -t

This will give you status of all services , In ideal conditions status is ONLINE and if service is down it will post the status as OFFLINE

Suppose i want to stop crs , in this case i will use -

crsctl stop crs

sometimes a service may get down due to some error , this can be started by using -

crs_start servicename

Thursday, November 26, 2009

Some More RAC Commands

Today i will share how to shutdown single instance in an RAC cluster, We Will again be using SRVCTL for this..

To shutdown a single instance or one node of RAC cluster we use the command -

srvctl stop instance -d databasename -i instancename


To start instance -

srvctl start instance -d databasename -i instancename

This is pretty much useful. Sometimes your system team may ask to to shutdown the database on one node, for some maintenance activity. At that time these commands are very handy.

Sometimes SRVCTL may not work , and may give error. This can happen if GSD is down or because of some cluster ware error. In this case we can use the conventional method of shutting down the instance . Just export ORACLE_SID=MYSID and use shutdown command.

Wednesday, November 25, 2009

srvctl utility to start and stop Oracle RAC Database

To Manage an RAC Database , srvctl command line tool is utilized. It is the easiest way to start and stop database instances in an RAC Cluster. Much can be performed with srvctl command line utility.

I will just post down some examples -

1. To check the status of Database -

srvctl status database -d MYSID

2.To Start entire database (Both the instances of cluster) -

srvctl start database -d MYSID

3. To stop Entire database (Both the instances of cluster) -

srvctl stop database -d MYSID

I will update this with some more commands soon!!

If you are new to RAC you may initially find it hard to remember these commands, so the easiest way is simply put them in shell script.
This is the way i used to do it when for the first time i had worked on an RAC Database.

Just create scripts like start.sh, stop.sh and put your commands in these shell scripts. So that every time you just need to run the shell scripts. :-)

Tuesday, November 24, 2009

New To Oracle RAC??

Oracle RAC, this is an Awesome offering of Oracle. In my DBA Experience most of the experience is On RAC, u may say i got lucky from the starting. For those who really want to have a feel of this , should try Implementing this On Vmware. It Really works well!! You can try all the stuff like adding nodes,deleting nodes, patching etc..just do a google search..but the best document is by vincent chan, i hope its still available on Oracle Website..

Hi

Hey I have finally joined blogger....:-)