Please see my other blog for Oracle EBusiness Suite Posts - EBMentors

Search This Blog

Note: All the posts are based on practical approach avoiding lengthy theory. All have been tested on some development servers. Please don’t test any post on production servers until you are sure.

Monday, December 06, 2010

SRVCTL Utility (10gR2)

We can do the following (but not limited to) by srvctl.
  • Database Configuration tasks such as:
    1.  Adding, modifying and deleting Cluster Database configuration.
    2.  Adding/or Deleting an instance or a service to/from the configuration of a Cluster Database.
    3.  Moving instances and services in a cluster database configuration and modifying service configurations.
    4.  Setting and unsetting the environment for an instance or service in a clustered database configuration.
    5.  Setting and unsetting the environment for an entire cluster database in a clustered database configuration.
  • Cluster Database Administration Tasks such as:
    1.  Starting and stopping cluster databases.
    2.  Starting and stopping cluster database instances.
    3.  Starting, stopping, and transfering cluster database services.
    4.  Getting statuses of cluster databases, cluster database instances, or cluster database services; this last one is interesting as having taken all the pains of setting the RAC, we will indeed be curious of their status.
  • Node Level Tasks such as:
    1.  Adding and deleting node level applications
    2.  Setting and unsetting the environment for node-level applications.
    3.  Managing node applications.
    4.  Managing ASM instances.
    5.  Starting and stopping a group of programs that includes virtual IP addresses, Listeners, Oracle Notification Services, and Oracle Enterprise Manager agents (for maintenance purposes).

    Getting on to SRVCTL

    C:\Documents and Settings\inam>srvctl -h  -- provides (long) list of commands
    Usage: srvctl [-V]
    Usage: srvctl add database -d -o [-m ] [-p ] [-A /netmask] [-r {PRIMA
    Usage: srvctl add instance -d -i -n
    Usage: srvctl add service -d -s -r "" [-a 
     C:\Documents and Settings\inam>srvctl config database 

    Querying the nodes for all running services

     C:\Documents and Settings\inam>srvctl config nodeapps -n DB1 -a -g -s -l
    VIP exists.: /
    GSD exists.
    ONS daemon exists.
    Listener exists.

    Querying the nodes for ASM Configurations

    C:\Documents and Settings\inam> srvctl config asm -n DB1
    +ASM2 D:\oracle\product\10.2.0\db_1

    Getting the Status of Various Services

    C:\Documents and Settings\inam>srvctl status database -d HOME -f -v
    Instance HOME1 is running on node db1
    Instance HOME2 is running on node db2

    C:\Documents and Settings\inam>srvctl status asm -n DB1
    ASM instance +ASM2 is running on node DB2.

    C:\Documents and Settings\inam>srvctl status database -d HOME -f -v -S HOME
    #@=info: operation={status} config={full} ver={}
    #@=stage[0]: abbrev={inst} desc={Instance}
    #@=inst[0]: name={HOME1} node={db1} oh={D:\oracle\product\10.2.0\db_1}
    #@=inst[1]: name={HOME2} node={db2} oh={D:\oracle\product\10.2.0\db_1}

    Instance HOME1 is running on node db1
    Instance HOME2 is running on node db2
    #@=done: status={0}

    Note: -S is for service, -v for verbose, -f Include disabled applications also

    C:\Documents and Settings\inam>srvctl -V
    srvctl version:

    To Stop the service 
    srvctl stop service -d HOME -s HOME

    Starting Up and Shutting Down with SRVCTL 

    srvctl start instance -d mydb -i "myinstance_list" [-o start_options] [-c connect_str | -q]

    To stop, do the following:
    srvctl stop instance -d mydb -i " myinstance_list" [-o stop_options] [-c connect_str | -q]
    To start and stop the entire RAC cluster database, meaning all of the instances, you will do the following from your SRVCTL in the command line:
    srvctl start database -d mydb [-o start_options] [-c connect_str | -q]
    srvctl stop database -d mydb [-o stop_options] [-c connect_str | -q]
    Stop all application processes.[root@racnode1 ~]# srvctl stop database -d racdb
    [root@racnode1 ~]# srvctl stop asm -n racnode1
    [root@racnode1 ~]# srvctl stop asm -n racnode2
    [root@racnode1 ~]# srvctl stop nodeapps -n racnode1
    [root@racnode1 ~]# srvctl stop nodeapps -n racnode2


    D:\app\11.2.0\grid\BIN>srvctl status diskgroup -g dbflash -n -or-11
    Disk Group dbflash is running on or-11 



No comments: