How to determine whether a resource is online in a cluster from a script

Hello All,
Environment:
Solaris 9
SC3.1/U4 and SC3.2
RG name:
dw-rg
Resources:
dw-vip - Logical hostname RS
dw-stor - HA storage RS
dw-ora - HA Oracle RS
dw-lis - HA Oracle listiner RS
Hostnames:
dwn1
dwn2
We have a situation where we are trying to backup an oracle DB's on our clusters. We are performing both hot and cold backups. During a cold backup, we take the database completely down and the other where we put the DB into hot backup mode.
In the coldbackup case, we simply take the oracle RS offline and in the hotbackup case, the oracle RS in still online. The scripts are ran from cron on each cluster node.
In the coldbackup case, As a consistency/error check I would like to first check the status of the oracle rs and see if it is online somewhere in the cluster.
in the hot backup case, I need to run the script from the cluster node that RG/RS is running on.
Since I am checking status and return codes, I don't want to use scstat and grep to get this information if I can avoid it, but, I would either write a C program or script to do this.
Any ideas or sugguestions would be greatly appreciated
Thanks in advance
George

You can use the Sun Cluster library functions, have a look at the manpage for scha_calls(3ha).
In your specific case you could have a cronjob running on each node. The first thing it would do is to check if the resource you are interested is online on the node, like
RS_STATUS=`/usr/cluster/bin/scha_resource_get -G dw-rg -R dw-ora -O RESOURCE_STATE`
if [ "$RS_STATUS" != ONLINE ] ; then
        exit 0
else
        <do what you need to do>
fiGreets
Thorsten

Similar Messages

  • How to determine whether a recordset is Empty or not ?

    Please see my snippet code below :
    <%     
         String sql="";
         String username="CDS";
         try
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                Connection con = DriverManager.getConnection("jdbc:odbc:Employees","","");
                Statement stmt = con.createStatement();
                ResultSet rs=null;
                   sql = "Select * from Employee where code='" + username + "'";
                   rs = stmt.executeQuery(sql);
                   rs.next();
                   if (rs==null)
                   %>
                        <jsp:forward page="Login.jsp?msg=Username not recognized"></jsp:forward>     
                   <%     
                else
                   %>
                        <jsp:forward page="Login.jsp?msg=Halo"></jsp:forward>
                   <%
              catch(ClassNotFoundException e)
                   out.println("Driver not found");
                    catch(SQLException e2)
                            out.println(e2.getMessage());
                            out.println("<BR>");
                            out.println("Wrong SQL Statement");
                            out.println("<BR>");
                            out.println(sql);
                            out.println("<BR>");
         %>How to determine whether a recordset has no result ?
    From the above code, i use if (rs==null) and that's not worked.
    Help me, guys.

    ResultSet rs = stmt.executeQuery(sql);
    if (rs.next()) {
    %>
        <jsp:forward page="Login.jsp?msg=Halo"/>
    <%
    } else {
    %>
        <jsp:forward page="Login.jsp?msg=Username not > recognized"/>
    <%
    }

  • How to determine whether process Chain is active or Not

    Hello Experts,
    How to determine whether process Chain is active or Not, because i have large number of PC to activate.

    Hi,
    Please check this program in SE38---- /SSA/BWT
    This program will give you information regarding all your process chains which are active and running based on there timings.
    Hope it helps.
    Regards,
    AL

  • How to determine whether a file doesn't exist or doesn't have enough perms

    Hello everone,
    I am stuck in determining whether a file does not exist or does not have enough permissions so that access to this file is denied?". I am using
    java.io.File.exists() or java.io.File.canRead() methods to check this but both of them just return false in both above mentioned cases.
              In the documentation however its mentioned that these method throw SecurityException - If a security manager exists and its SecurityManager.checkRead(java.lang.String) method denies read access to the file. But then problem is to write a security manager which denies
    read access if the file does not have permissions so that exception can the thrown.
    Any suggestions or pointers will be highly appreciated.
    Thank You.
    Regards,
    Vikash Kumar

    Some platforms will let you rename or remove an open
    file.Unless those platforms support file locking, and the file has a lock on it.

  • How to Determine Whether Columns Exist in a Table

    Greetings,
    Because of customizations to our product, certain database table structures vary between different client installations. Hence, in the code, I need to determine whether two columns exist in a certain table, in order to apply some business logic.
    Please suggest a way for me to determine whether two named columns appear in a specific table. In other words, for example, I need to discover whether both columns SAL_GRADE and BONUS appear in the EMP table, or not. Only if both columns are defined, can I apply my business logic.
    Thanks,
    Avi.

    Avi,
    Like this ?
    SQL> declare
      2    l_count number;
      3  begin
      4    select count(*)
      5      into l_count
      6      from user_tab_columns
      7     where table_name = 'EMP'
      8       and column_name in ('SALGRADE','BONUS')
      9    ;
    10    if l_count = 2
    11    then
    12      dbms_output.put_line('Both columns exist, so apply business logic');
    13    else
    14      dbms_output.put_line('One or both columns are missing, so don''t apply business logic');
    15    end if;
    16  end;
    17  /
    One or both columns are missing, so don't apply business logic
    PL/SQL-procedure is geslaagd.Regards,
    Rob.

  • How to determine prices in Resource Related Billing(RRB)

    Dear Experts,
    I am working for service related client.in this SD,PS,HR and CO are integrated.
    from SD i have to create resource related billing.here while running DP91 how the system determines the resources related pricing.
    My doubts are:
    1.Whether prices are determined automatically or we will maintain manually?
    2.If prices are automatically:how and where we maintain?
    3.If prices are manually:how and when to maintain?
    I heard that to determine prices automatically by system i have to create Z table.
    Z table because,prices are differ from projects,and position of the employee.
    Thanks for helping,
    Ravikumar.R

    Yes, price determination is automatic
    If you have worked on DIP profile, there you might have come across term called Source.
    Based on the source system determines the pricing data.
    And SAP provide 9 different sources for different process like:
    1.
    Actual costs - Line items (most popular)
    2.
    Actual costs - Totals records
    3.
    Statistical indicators - Line items
    4.
    Statistical indicators - Totals record
    5.
    Funds - Line items
    6.
    Funds - Totals records
    7.
    Planned Statistical indicators - Totals records
    8.
    Planned costs - Totals records
    9.
    Easy Cost Planning (Generally used with PS Project)
    Details of source each can be learnt from SAP Help.
    Regards
    JP

  • How to determine whether one depth pixel belong to one user?

    Like PlayerIndex for 0 to 7 in SDKv1,while in SDKv2 how to judge one pixel belong to users or background?
    Thanks!

    Now you have BodyIndex frame source.
    Have a look at the Body Index Basics sample in the SDK browser to learn how it works.

  • How to determine hostname or IP addr. of server we loaded from?

    Hi All,
    Does anyone know of a reliable way of determining the IP
    addr. or hostname of the server that the Flex app. was launched
    from? My application needs to make a connection back to the server,
    but the server could be at various IP addresses / host names.
    Thanks,
    Fred

    Thanks for my response, but my situation is that I develop my
    apps on one machine and run the back end services on that same
    machine in a testing environment. So when testing I want to connect
    to localhost for debugging. But when deployed on the real server
    the Flex app. should connect to servername, the real hostname of
    the server it's deployed at. I can't yet figure out how to have
    Flex determine the name of the host from which it was
    launched.

  • How to Print form using SAP Smart Forms which is migrated from SAP Script?

    Hello every one,
         i have a problem in printing form using smart form which is migrate from the SAP Script...so what method i have to use...if any one know the solution for this than plz reply me as soon as possible...

    hi
    when ever u want to migrate the script to smartform u have to chage the driver program also..
    refere this link to convert script to smartform
    convert sapscript to smartform
    c_formname = u r smartform name...
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname           = c_formname
      IMPORTING
        fm_name            = v_fm_name
      EXCEPTIONS
        no_form            = 1
        no_function_module = 2
        OTHERS             = 3.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ...........................CALL SMARTFORM............................
    CALL FUNCTION v_fm_name
      EXPORTING
        control_parameters   = st_control_parameters
        output_options       = st_output_options
      IMPORTING
        document_output_info = st_document_output_info
        job_output_info      = st_job_output_info
        job_output_options   = st_job_output_options
      EXCEPTIONS
        formatting_error     = 1
        internal_error       = 2
        send_error           = 3
        user_canceled        = 4
        OTHERS               = 5.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.

  • How to determine the chief position?

    Hi all,
    How to determine whether the position is chief or non-chief?
    Thanks.
    Best Regards,
    Yamin

    Check if the position has any 012 relationship with any orgunit.
    If so then it is cheif. You can check hrp1001 table with 012 relationship you will have an idea.
    You will see that if for a given position otype = S
    objid = position no is there any relat = 012 in the current period in table hrp1001.
    Regards,
    Divya
    Reward if helpful

  • How to Determine Text File Encoding is UNICODE

    Hi Gurus,
    How to determine whether the file is a UNICODE format or not?
    I have the file stored as a BLOB column in a table
    Thanks,
    Sombit

    That's a rather hard problem. You would, realistically, either have to make a bunch of simplifying assumptions based on the data or you would want to buy a commercial tool that does character set detection.
    There are a number of different ways to encode Unicode (UTF-8, UTF-16, UTF-32, USC-2, etc.) and a number of different versions of the Unicode standard. UTF-8 is one of the more common ways to encode Unicode. But it is popular precisely because the first 127 characters (which is the majority of what you'd find in English text) are encoded identically to 7-bit ASCII. Depending on the size and contents of the document, it may not be possible to determine whether the data is encoded in 7-bit ASCII, UTF-8, or one of the various single-byte character sets that are built off of 7-bit ASCII (ISO 8859-15, Windows-1252, ISO 8859-1, etc).
    Depending on how many different character sets you are trying to distinguish between, you'd have to look for binary values that are valid in one character set and not in another.
    Justin

  • How to determine I have 32-bit or 64-bit 2008 R2 edition?

    I have SQL Server 2008 R2 installed. How to determine whether it is a 64-bit installation or a 32-bit.
    In case it is a 32-bit edition, can I upgrade it to a 64-bit edition? If one PC has 32-bit installed and the Server has 64-bit installed, is it possible to work with database files irrespective of whichever bit edition it is?

     
    Hello,
    Please run the following command on SQL Server Management Studio:
    SELECT
    @@version
    on the results you will find the answer.
    Microsoft SQL Server 2008 R2 (RTM) - 10.50.1765.0
    (X64)
    Feb  2 2011 17:33:22
    Copyright (c) Microsoft Corporation
    Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)
    (1 row(s) affected)
    About migrating from one platform to another, yes you can do that with a side-by-side upgrade because SQL Server setup does not allow cross-platform upgrade.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • How to determine if font supports language

    The language of my application is russian.
    when trying to put all the GraphicsEnvironment.getAllFonts() into the JComboBox to let the user specify the application font, ALL available fonts(along with system ones and the ones that doesnt support russian)
    Please help - how to determine whether i can use the font!
    Thanks in advance!
    Boris.

    sorry, forum mismatch.... closing topic :)
    Boris.

  • How do I determine whether I have PCI Express v1.1 or v2.0?

    This article in Mac Fixit states that computers with PCI Express v1.1 slots will NOT be able to take full advantage of OpenCL in Snow Leopard:
    http://www.macfixit.com/article.php?story=20090612121357227
    ... In terms of PCI Express, My Mac Pro is on the cusp. PCI 2.0 was announced in January 2007 and presumably made it's way onto the assembly line a few months after that. I bought my refurbished Mac Pro in June 2007. I can't determine in the System Profiler if I have PCIv1.1 or v2.0. Does anyone know how to find out? MacTracker and machistory.com haven't answered the question. It seems some of the MacPro1,1 models shipped with v1.1 and some with v2.0. How do I determine what I have? Thanks for your help!
    SPECS FROM MY SYSTEM PROFILER (SERIAL RM727......)
    GRAPHICS/DISPLAYS
    NVIDIA GeForce 7300 GT
    Chipset Model: NVIDIA GeForce 7300 GT
    Type: Display
    Bus: PCIe
    Slot: Slot-1
    PCIe Lane Width: x16
    VRAM (Total): 256 MB
    Vendor: NVIDIA (0x10de)
    Device ID: 0x0393
    Revision ID: 0x00a1
    ROM Revision: 3008
    PCI CARDS
    NVIDIA GeForce 7300 GT
    Name: NVDA,Display-B
    Type: display
    Bus: PCI
    Slot: Slot-1
    Vendor ID: 0x10de
    Device ID: 0x0393
    Subsystem Vendor ID: 0x0000
    Subsystem ID: 0x0010
    ROM Revision: 3008
    Revision ID: 0x00a1
    Link Width: x16

    How do I determine whether I have PCI Express v1.1 or v2.0?
    Hi,
    Open Apple System Profiler (About this Mac:More info) and look at the Hardware: Model Identifier. If it says Mac Pro 1,1 or Mac Pro 2,1 you have PCIe v1.1 slots.
    http://www.amug.org/amug-web/html/amug/reviews/articles/intel/macpro/
    If it says Mac Pro 3,1 you have PCIe v1.1 in slots 3 and 4 and PCIe v2.0 in slots 1 and 2.
    http://www.amug.org/amug-web/html/amug/reviews/articles/intel/macpro-2008/
    If it says Mac Pro 4,1 you have PCIe v2.0 in all four slots.
    http://www.amug.org/amug-web/html/amug/reviews/articles/intel/macpro-2009/
    Hope that helps!

  • How to determine the source to where my saved photo (not taken by my iPhone camera) on whether what application or website did i got that photo? need to go to the source again, please help

    how to determine the source to where my saved photo (not taken by my iPhone camera) on whether what application or website did i got that photo? need to go to the source again, please help

    There is no way to trace the source of a saved photo.
    You might have some luck if you search through the Safari web site history available via the Bookmark icon.

Maybe you are looking for

  • Slow performance when running Multiple programs at once

     When I try to run 2 or 3 programs at once like converting some video and watching something on I tunes My A205-S6808 throws a Fit any Ideas I have already upgraded the memory to 4gigs 

  • Flash/Java/Quicktime?/Safari Problem

    Alright, I have this pretty large problem in my case. I just updated to QT 7.3 and iTunes 7.5, restarted my computer because of the update. & went on normally, then when trying to load a site like youtube.com (with its flash videos and other things)

  • Number of threads used in default

    default execution threads in bea are 25, but when looking through Windows Task Manager we see there are 120 threads being used. How do we account for this number? is it for JDBC connections ? where are the other threads comming into picture? can anyo

  • Sql error 12705  performing CON (Upgrade on Oracle10.2.0.2)

    Hello, I'm following the Oracle Upgrade Guide_211 for Oracle upgrade to 10.2.0.2 of our test system. It's SAP R/3 4.6C with 4.6D_EXT supp. pack 2271, HP-UX 11.11 and Oracle 9.2.0.5 I'm almost done with the upgrade (just startup of SAP instance) Now I

  • Information about IPhone developer registration process and other license i

    Hi All, I am an iPhone Developer since 6 moths, I have developed many application on iPhone SDK, but I still don't have apple certificate for development and don't know how to register for that too. I am using iDeneb 10.5.4 and 10.5.6 for development