How can I detect database role BEFORE mounting database?

Once a database is mounted, it is possible to query the V$database view to check the database_role IE: Primary, Physical Standby or Logical Standby.
When starting a Physical standby, the correct sequence is to:
SQL> startup nomount
SQL> alter database mount standby database
SQL> recover managed standby database nodelay disconnect
This will get it going without any errors in the alertlog (which we monitor and Email ORA- lines automatically). We Can get "ORA-01153: an incompatible media recovery is active" if the Primary is already up, but usually it wont, so Ignore this.
How can I determine the DB's role so I can issue the correct commands for startup, when the Instance is DOWN or in unmounted 'STARTED' mode?
(Unix, Solaris, 9i)
Regards, Vin.

Thank you for the reply.
I have decided that before a shutdown is done (and these stops & starts are all done from a script, middle if night when backups are done) , that it will check the 'open mode' of the database. If it isn't just STARTED, it has to be open or mounted & thus I can query the v$database view. This I will query and store in the form of a unix file named `uname -n`_SID_databaseRole IE:sunbox2_SALES_PHYSICAL.
I will look for these files before a startup and if present and less than an hour old, issue (in the case that we are starting a Physical standby) startup nomount, mount standby database, recover managed .....etc . If the database role is PRIMARY, then just issue a 'startup', same if for some reason the unix file doesn't exist or the file is more than an hour old. A plain startup on a Physical Standby can generate some messages, but it still works, and will prompt people to question why the backup took so long.
The only time this could all muck up is if we do a switchover at the same time as we shutdown for cold backups. I will make the policy that switchovers are not to be done at that time.
The only gripe I have left is that I cannot find how to STOP the Instance (message free) after doing a database dismount. A ' shutdown immediate' generates an ora 1109 message and I want to avoid prompting as many messages possible. Some messages are unavoidable and my "alertwatch" program is configured to blanket ignore them, but I want to use the correct commands to generate the least amount of messages that will be skipped for Emailing.

Similar Messages

  • How can I detect a dialog and respond?

    I'm having trouble doing something that's probably not that hard. I'm trying to "Print to PDF" a bunch of old AppleWorks documents. When you open a document created in AppleWorks v6 it opens right up, but when you open a document created in AppleWorks 5 you get a dialog box that says, "This document was created by a previous version of AppleWorks. A copy will be opened and "[v6.0]" will be added to the filename."
    Right now I open the file and then:
    tell application "AppleWorks 6"
            activate
            repeat while not (exists front document)
                    delay .2
            end repeat
    end tell
    When the dialog box pops up, there's no front document so the whole thing freezes until you hit OK. How can I detect this dialog box and dismiss it?
    Thanks
    PS
    When the box is open I ran this and got this result:
    /usr/bin/osascript -e 'tell application "System Events" to get properties of windows of application process "AppleWorks 6"'
    minimum value:missing value, orientation:missing value, position:436, 153, class:window, role description:dialog, accessibility description:missing value, focused:missing value, title:missing value, size:412, 123, value:missing value, help:missing value, enabled:missing value, maximum value:missing value, role:AXWindow, entire contents:, subrole:AXDialog, selected:missing value, name:missing value, description:dialog, minimum value:missing value, orientation:missing value, position:8, 76, class:window, role description:floating window, accessibility description:missing value, focused:missing value, title:Starting Points, size:631, 189, value:missing value, help:missing value, enabled:missing value, maximum value:missing value, role:AXWindow, entire contents:, subrole:AXFloatingWindow, selected:missing value, name:Starting Points, description:floating window, minimum value:missing value, orientation:missing value, position:4, 22, class:window, role description:floating window, accessibility description:missing value, focused:missing value, title:Button Bar, size:612, 51, value:missing value, help:missing value, enabled:missing value, maximum value:missing value, role:AXWindow, entire contents:, subrole:AXFloatingWindow, selected:missing value, name:Button Bar, description:floating window

    Hi,
    The simplest would be to set the application preferences in the script.
    Like this :
    -- *** set prefs ****
    tell application "AppleWorks 6"
          activate
          set oldPrefs to its preferences
          copy oldPrefs to tPrefs
          tell tPrefs
                set old version warning to false --doesn't show the old version warning alert  
                set converted file suffix to true -- append “[v6.0]” to documents converted from older formats
                set locked file warning to false
                set paint reduction warning to false
          end tell
          set preferences to tPrefs
    end tell
    -- *** end set prefs ****
    --**** your script, example ***
    set tfiles to choose file with multiple selections allowed
    tell application "AppleWorks 6"
          repeat with i in tfiles
                open i
                tell front document
                      -- do something
                end tell
          end repeat
    end tell
    --**** end  your script ***
    -- *** reset prefs ****
    tell application "AppleWorks 6" to set preferences to oldPrefs

  • How can I detect if I'm running a compiled versione of my application?

    In my application I have included some special functions I don't want my customer to use. Since I will distribute the application as an .exe file, instead of cutting away those functions before releasing the .exe, I want to hide them when the application is runnig as an executable, and leave them active when running in the LV environment.
    How can I detect if I'm running an executable or the LV environment? Do I have to scan the application name until I find an .exe different from labview.exe or there is another way to obtain the flag (something similar to CVI function InStandaloneExecutable() for example)?
    Roberto
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

    An application property exists:Application:Kind
    with the following values: Development System, Runtime System, Student Edition, or Embedded LabVIEW.
    greetings from the Netherlands

  • How can i create a new and tableless database using database configuration

    How can i create a new and tableless database using database configuration

    How can i create a new and tableless database using database configuration
    Just don't install the sample schemas. See the installation guide
    http://docs.oracle.com/cd/E11882_01/server.112/e10831/installation.htm
    Using the Database Configuration Assistant
    When you install Oracle Database with the Oracle Universal Installer, the sample schemas are installed by default if you select the Basic Installation option. Selecting the sample schemas option installs all five schemas (HR, OE, PM, IX, and SH) in the database. If you choose not to install the sample schemas at that time, you can add them later by following the instructions in section "Manually Installing Sample Schemas".
    Choose a custom install and don't install the sample schemas.
    All other schems/tables installed are REQUIRED by Oracle

  • How can i get my ipad to mount on my computer's desktop without activating itunes?

    how can i get my ipad to mount on my computer's desktop without activating itunes?

    You don't.
    No iOS device will mount as a hard drive.

  • How can I detect a certain text within a field within CASE using IF

    Dear all,
    for a transformation / generation of values receiving from R/3 into BW I try to
    manupulate three fields. I have a problem detecting a string in a field.
    I am using a CASE with several WHEN clauses on one field. Depending on the
    value, an IF is integrated. There I look into another field evaluating, if it contains
    a certain string. E.g. IF STRING CP 'xyz' OR 'abc'.
    System gives error for the locigal expression. I also tried CS, but same error.
    How can I detect a certain text within a field and which is the right logical
    expression.
    Many thanks in advance!!!
    Claudia

    Hi,
    Folow the blow example...
    May be it helps....
    DATA: hex1 TYPE string,
          hex2 TYPE string.
    hex1 = 'FFFF'.
    hex2 = '123FF'.
    IF hex1 CP hex2.
    ENDIF.
    Cheers,
    SImha.

  • How can i detect if my PC is not on Network..... Urgent Pls Help Soon !!!!!

    Hello Everyone,
    We all know whenever we try to connect to a PC which is not on network, we get UnKnownHostException etc..... by which we can detect that the corresponding PC is not an network(intranet/internet)
    But when i send a msg from my PC to my PC, it works fine even if the network is down. I hv provided my PC's IP address instead of using localhost or 127.0.0.1 which reduces the possibility that the msg will not be traversed thru the network.
    Any IDEA how this works.
    Is There any possible way by which i can detect that my PC is not on network or the PC to which i'm trying to connect is not on network .......
    Pls help me out, its really urgent as to be implemented in my Project
    Thanks In Advance
    Sahil Shaikh

    Hello Surtee
    I have developed a Messeging Service for the eCRM Apllication my company is developing and we r in the final stage of debugging.
    Now whenever a user sends a msg to a PC which is not on network, the messaging service automatically sends an Offline mssg to that PC. But know i want ot distinguish wheather the PC to which i'm sending the msg is not on network or am I not on network based on this i need to perform diff. actions, hence i wanted to know that how can i detect .......
    Pls see if u canhelp me out ......
    Thanks
    Sahil Shaikh

  • How can I see which roles or users have access to a table?

    How can I see which roles or users have access to a table?
    For a given table, how can I see the grants, who and what?
    Many thanks

    dba_tab_privs.
    Grantee can be a role or an user, as roles are fake users.
    Sybrand Bakker
    Senior Oracle DBA

  • On another PC I want to backup my bookmarks but my Firefox browser is not working how can I do the backup before I reinstall Firefox

    On another PC I want to backup my bookmarks but my Firefox browser is not working how can I do the backup before I reinstall Firefox.
    Firefox can't renew it's last tabs and now won't run and let me do a backup

    It is possible that there is a problem with the files sessionstore.js and sessionstore.bak in the Firefox Profile Folder.
    Delete the sessionstore.js file and possible sessionstore-##.js files with a number and sessionstore.bak in the Firefox Profile Folder.
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    Deleting sessionstore.js will cause App Tabs and Tab Groups and open and closed (undo) tabs to get lost, so you will have to create them again (make a note or bookmark them).
    See also:
    *http://kb.mozillazine.org/Session_Restore
    *http://kb.mozillazine.org/sessionstore.js
    *http://kb.mozillazine.org/Multiple_profile_files_created

  • How can I execute a statement before a VO is running

    JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660
    I use ADF BC
    how can I execute a statement before a VO is running

    thanks for the answer
    i use a logon function before I run a VO
    after a certain time will be disconnected
    and I have to call the function again
    sorry for my English
    public String logon(String username, String password){
    CallableStatement st = null;
    this.username = username;
    this.password = password;
    try {
    st = getDBTransaction().createCallableStatement("begin ep_security.LogOn(?,?); end;",0);
    st.setObject(1, username);
    st.setObject(2, password);
    st.executeUpdate();
    this.getDBTransaction().commit();
    } catch (SQLException e) {
    System.out.println("ERROR "+e.getMessage());
    this.addWarning(new JboWarning("Quote retrieved successfully"));
    System.out.println("...RETURN ERROR");
    return "error";
    } finally {
    if (st != null) {
    try {
    // 7. Close the statement
    st.close();
    } catch (SQLException e) {
    e.printStackTrace();
    }

  • How can i find statistics tables in my database?

    code{
    Upgrade Statistics Tables Created by the DBMS_STATS Package
    If you created statistics tables using the DBMS_STATS.CREATE_STAT_TABLE procedure, then upgrade these tables by executing the following procedure:
    EXECUTE DBMS_STATS.UPGRADE_STAT_TABLE('SYS','dictstattab');
    In the example, 'SYS' is the owner of the statistics table and 'dictstattab' is the name of the statistics table. Execute this procedure for each statistics table.
    the above is one of the post upgrade step for 11gR2. How can i find statistics tables in my database?

    You need to read the complete context of this manual upgrade step:
    Step 33
    Upgrade Statistics Tables Created by the DBMS_STATS Package
    If you created statistics tables using the DBMS_STATS.CREATE_STAT_TABLE procedure, then upgrade these tables by executing the following procedure:
    EXECUTE DBMS_STATS.UPGRADE_STAT_TABLE('SYS','dictstattab');
    In the example, 'SYS' is the owner of the statistics table and 'dictstattab' is the name of the statistics table. Execute this procedure for each statistics table.You need to do this step for any statistics table that you created manually with DBMS_STATS.CREATE_STAT_TABLE.
    Marcus

  • How can i know the port of my database?

    hello,
    how can i know the port of my database is working in?
    ty

    user11933068 wrote:
    I don't know how to do this, sorry
    :-(TNSNAMES.ORA is used by the client to resolve an alias to an actual server/listenr port/db service name.
    TNSNAMES.ORA is found, by defualt, on the client machine at $ORACLE_HOME/network/admin
    Here's how it works:
    Suppose I have this in my tnsnames.ora:
    fubar =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521))
        (CONNECT_DATA =
          (SERVICE_NAME = btzlkfp)
      )So, my connect string would look something like this:
    $> sqlplus scott/tiger@fubarTNS will take the name 'fubar' and look it up in the tnsnames file. In my example, it will then route the connection request to 'myhost' (using other net services to resolve that to an actual IP address), and place the request on port 1521 at that server. The listener will pick that up and see that scott wants to log on to database 'btzlkpf'.
    There's more, but at this stage I want you to understand the connection between what you enter for your connect string and the database itself.

  • How can we detect a virus on our mac?, How can we detect a virus on our mac?

    We think we may have a virus from the USPS spam email.  How can we detect a virus on our computer?

    What makes you think there is a "virus"?  Any symptoms...?
    There are other types of malware (such as trojans) that can affect Mac OS X, but no viruses.  A trojan would have to trick you into installing something (the malware) by making you think it is something else.  You would be notified (by the system) that you are running a downloaded application for the first time, AND if something will be done to update your current system, you will be asked to authenticate (with your admin user name and password).  If something like that comes up when you don't expect it, you should be suspicious (and NOT authenticate).  Just opening an email won't do anything, even if it's an email that may affects Windows PCs.
    This free utility can scan your Mac for malware. 
    http://www.clamxav.com/
    Apparently, there is a version on the Mac App Store.
    http://search.itunes.apple.com/WebObjects/MZContentLink.woa/wa/link?path=mac%2fC lamXav
    In the past, when I bothered to run it a few times a year, the only things it found were junk emails that I had not bothered to delete with embedded malware, all of it aimed at Windows PCs.

  • How can we determined what role contains a particular privilege.

    Hi All.
    How can we determined what role contains a particular privilege.???
    I have found note User Management (UMX) Security Infrastructure Reporting (Doc ID 1222663.1)
    Our implementation doesn't seem to have a "UMX_W3H_HOMEPAGE / W3H Homepage Permission Set"
    This is a R12.0.4 instance
    Thanks in advance

    How can we determined what role contains a particular privilege.???User Management Responsibility > Roles & Role Inheritance > Search for the Role > Click on Edit and you will find the list of Permissions.
    I have found note User Management (UMX) Security Infrastructure Reporting (Doc ID 1222663.1)
    Our implementation doesn't seem to have a "UMX_W3H_HOMEPAGE / W3H Homepage Permission Set"
    This is a R12.0.4 instanceAccording to (How to Assign User Management Security Reports to a User [ID 1221304.1]), it is available in 12.1.1 and above.
    Thanks,
    Hussein

  • How can i identify the environment name or database name in the PL/SQL code

    Hi,
    I am using UTL_FILE to genearate the files.,
    My problem is, I have to design the common sql file , which can be executed in 2 diffrent environments ( Say QA & DEV ) , with no parameters. It has to identify the environment and based on the environment , it has to generate the concern files.,
    The only change needs to be incorporated is , file names , which will change based on the environment.,
    can nay one tell me , how can i identify the environment name or database name in the PL/SQL code ??
    Raja

    In this case, USEC_GI_DEV.NA.XXXNET.NET is a TNS alias. That alias exists only on the client machine. There is no way to access that information on the database server.
    You would have to find something in the v$database or v$instance table that uniquely identifies the database (and you may need some help from the DBAs to do this because you need to ensure that the data element you choose is compatible with whatever refresh process(es) are used in your environment).
    Now, if you are writing a stand-alone SQL*Plus script, SQL*Plus, as a client tool, does have access to the TNS alias in later versions. But that is a client-side determination, not a server-side determination.
    Justin

Maybe you are looking for

  • Help needed with xml to flat file conversion

    Hi all, I am doing a webservice (SOAP) to file scenario. The file I get into the target directory is as below. <?xml version="1.0" encoding="UTF-8"?> <ns1:MT_Test_interface xmlns:ns1="http://test_namespace.co.uk"><fieldA>0000012345</fieldA><fieldB></

  • Company Logo does not appear in Excel and HTML, but appears in PDF and RTF

    Hi, I have a RTF template with my Company Logo Embedded. When I run the report from Standard Request Submission, and I give the output type as Excel or HTML, I dont see the Logo on my report. When I give the output type as PDF or RTF, then I see the

  • Dilemma of an OCA (SQL, PL/SQL) with 4 years work-ex

    Dear all, I am an OCA(SQL, PL/SQL) and working on a enhancement/production support project (Tech: JAVA and Oracle, Func: Insurance) in my firm. I am doing quite well here and keep updating myself using oracle documentation and application functionali

  • HT5271 "blocked plug-ins"?? Need assistance.

    Updated operating system now getting "blocked plug-ins" on everything...Help

  • Blank page In page viewer web part File sharing

    Hi, I have a Pageviewer web part and i use it show files, i have correctly configured the network path of those files and it works well when i copy paste it in the browser but somehow it shows a blank screen in Sharepoint. However the admin is able t