Saturday, March 17, 2012

Again A Time To Celebrate !!!!!!!

Today , my blog visitor's hits crossed 50,000 and offcourse a time to celebrate this moment . I am blogging from last year (i.e, march 2011)  and almost taken one year to acheive this . This month is very special to me as ever. There are lots of thing to celebrate in this month . Holi one of my favourite festival , My Birthday and this time my Blog Hits and others .

This blogs helps to find some  good friends whom i have never met and they are very kind and helpful to me. Whenever I am publishing any post on my blog, it boost up my confidence and motivate me to post  further . Every comment by you all is helping me to go more deep . Kindly free feel to comment and ask your doubt and i will try my best to give  solution .

I need  your support and wishes  to continue posting in future .  

Cheers  !!!!!!!

Wednesday, March 14, 2012

Automatically Starting/Stopping Oracle on Redhat Linux

Oracle recommends that we should configure our system to automatically start  Database when the system starts up, and to automatically shut it down when the system shuts down. Automating database startup and shutdown guards against incorrect database shutdown .

To automate database startup and shutdown, oracle use the dbstart and dbshut scripts, which are located in the $ORACLE_HOME/bin  directory. Let's have Look on the above scripts .

1.) Dbstart :  This script is used to start ORACLE  from /etc/rc(.local). It should ONLY be executed as part of the system boot procedure.This script will start all databases listed in the oratab file  whose third field is a "Y".  If the third field is set to "Y" and there is no ORACLE_SID for an entry (the first field is a *), then this script will ignore that entry.

2.) Dbshut :  This script is used to shutdown ORACLE from /etc/rc(.local). It should ONLY be executed as part of the system boot procedure.This script will shutdown all databases listed in the oratab file whose third field is a "Y".  If the third field is set to "Y" and there is no ORACLE_SID for an entry (the first field is a *), then this script will ignore that entry.

We need to create the script which will run dbshut and dbstart scripts in the /etc/init.d directory ,whenever the machine is shutdown or start . Whenever machine boots it runs the scripts beginning with Snnname in /etc/rc3.d ,where the nn indicates the order in which the scripts will run . Similarly in case of shutdown scripts are named as Knnnames which runs from rc0.d .If we want that Oracle is the last program that is automatically started, and it is the first to be shutdown then we will name the startup and shutdown scripts on OS like /etc/rc3.d/S99oracle and /etc/rc0.d/K01oracle respectively.

Let's have a demo of Automate Startup/Shutdown on Linux :

Step 1 : Edit the oratab file : 
Oratab file  is created by and updated by the Database Configuration Assistant when creating a database. The first and second fields are the system identifier and home directory of the database respectively.  The third filed indicates  to the dbstart utility that the database should , "Y", or should not, "N", be brought up at system boot time .In my case it is comcast:/home/oracle/product/10.2.0/db_1:N
So it edit as
Where my database name is comcast and ORACLE_HOME is  "/home/oracle/product/10.2.0/db_1"

Step 2 : Create a file called dbora and add the below lines 
[root@tech ~]# cd /etc/init.d
[root@tech init.d]# vi  dbora
add the following line

#! /bin/sh  -x
# Change the value of ORACLE_HOME to specify the correct Oracle home
# directory for your installation.
# Change the value of ORACLE to the login name of the
# oracle owner at your site.
if [ ! "$2" = "ORA_DB" ] ; then
   if [ "$PLATFORM" = "HP-UX" ] ; then
      remsh $HOST -l $ORACLE -n "$0 $1 ORA_DB"
      rsh $HOST -l $ORACLE  $0 $1 ORA_DB
case $1 in
        if [ "$PLATFORM" = "Linux" ] ; then
          touch /var/lock/subsys/dbora
        $ORACLE_HOME/bin/dbstart $ORACLE_HOME &
        $ORACLE_HOME/bin/dbshut $ORACLE_HOME &
        echo "usage: $0 {start|stop}"

Step 3 : Change the group of the dbora file and set the permission 
[root@tech init.d]# chgrp dba dbora
[root@tech init.d]# chmod 750 dbora

Step 4 : Create symbolic links to the dbora 
Create symbolic links to the dbora script in the appropriate run-level script directories as follows.We need to add the appropriate symbolic links to cause the script to be executed when the system goes down, or comes up.

[root@tech init.d]# ln -s /etc/init.d/dbora /etc/rc.d/rc0.d/K01dbora
[root@tech init.d]# ln -s /etc/init.d/dbora /etc/rc.d/rc3.d/S99dbora
[root@tech init.d]# ln -s /etc/init.d/dbora /etc/rc.d/rc5.d/S99dbora

Step 5 :  Test the scripts 
We can check the script by restarting the machine . Other alternative method  is

[root@tech init.d]#  /etc/init.d/dbora start (for startup)
[root@tech init.d]#  /etc/init.d/dbora stop  (for shutdown)

Above command will work same as we start the services in Window .

Enjoy      :-) 

Monday, March 12, 2012

Happy Birthday To Me

Today is my birthday , 13th March .  I will wish myself  a Very Very Happy Birthday To Me and may god fulfill  my wishes and dreams .
I am honor to say it was my year of Joy, Happiness great turn around and l thank God for all . He has in place for me in many years to come,am just so happy another new year is added to my new sweet life, Glory to God for everthing . He has done and more to do.

Here is a nice Poem which is dedicated to myself .    :)

I'm not afraid of counting years;
Each year is a new myth exploded.
I'm not afraid of wrinkles and gray hair;
This body is how I navigate through the cosmos, so I try to love it and be
I'm not afraid of death; It is only the final myth to unravel. I'm not even afraid of the devil,
because it is our adversary who gives us life's most precious gifts. I'm
ftwenty years old and lost things are coming back:
Emails from long vanished friends
Bits of shattered faith discovered in between the cracks of the couch and
under the edges of the carpet that I'm piecing together into a mosaic New things
arrive every day too:
New poems
New stories spinning out of my brain
A new sense of my place in the old story
New meaning in the ancient struggle for justice Each year is a new crossroads.
    Happy birthday to me!!!!

Wednesday, March 7, 2012

          Celebrating the colors  of our beautiful relationship, 
                         I wish you and your family all 
                            the bright hues of life.
                             Have a colourful holi !

         May God gift you all the colors of life ;  colors of joy, 
      colors of happiness ,   colors of friendship ,  colors of love
   and  all  the  other  colors ,  you  want  to paint your life with.

                         Happy Holi To You.

 Enjoy   :-) 

Monday, March 5, 2012

Difference between Dataguard and Active Dataguard

I  found  people are bit confused between Dataguard and Active Data guard . They assume that Active dataguard is having different configuration or properties .  Here, i have tried to cover the Active dataguard .

Active Data Guard is a new option for Oracle Database 11g Enterprise Edition . Oracle Active Data Guard enables read-only access to a physical standby database . Active Data Guard is the possibility to query  our Physical Standby Database while it is constantly actualized to reflect the state of the Primary Database . It is additional to 11g Data Guard and comes with an extra charge .

Oracle Active Data Guard enhances the Quality of Service (QoS) for production databases by off-loading resource-intensive operations to one or more standby databases, which are synchronized copies of the production database. With Oracle Active Data Guard, a physical standby database can be used for real-time reporting, with minimal latency between reporting and production data. Compared with traditional replication methods, Active Data Guard is very simple to use, transparently supports all datatypes, and offers very high performance. Oracle Active Data Guard also allows backup operations to be off-loaded to the standby database, and be done very fast using intelligent incremental backups. Oracle Active Data Guard thus is a very effective way to insulate interactive users and critical business tasks on the production system from the impact of such long-running operations. Oracle Active Data Guard provides the additional benefit of high availability and disaster protection by quickly failing over to the standby database in the event of a planned or an unplanned outage at the production site.

The Active Data Guard  contains the following features :

  • Physical Standby with Real-time Query
  • Fast Incremental Backup on Physical Standby
  • Automatic Block Repair

If a physical standby database in a Data Guard configuration has any of the above features enabled, then the Active Data Guard option must be licensed for every such physical standby, and also for the primary database.

Conversion from Physical standby to Active Data Guard :
We can convert the physical standby  into active Data Guard standby . Below are the steps

1.) Stop Apply Services
SQL> alter database recover managed standby database cancel ;

2.) Shut the database and open in mount stage
SQL> shut immediate
SQL> startup mount
SQL> alter database recover managed standby database using current logfile disconnect ;
SQL> alter database open ;
It enables us to have a physical standby read only open, while redo apply is still done in the background .

How to Check if Active Data Guard is  Enabled  or Not 
Use the following query to confirm that Data Guard is in active mode:

SQL> select  'Using Active Data Guard' ADG   from v$managed_standby m,v$database d where m.process like 'MRP%'  ;
Using Active Data Guard

or from standby datbase

SQL> select open_mode,controlfile_type from v$database;
OPEN_MODE                              CONTROLFILE
--------------------                        ------------------

If the query does not return the above result, and instead returns : no rows selected, then Active Data Guard is not enabled.

Enjoy     :-)