How to choose between the sequences on the different DB links when a DB is out of service

Hello!
I'm under Oracle 11.1.0.7.0 on HP - UX v3 in a replicated data flow environment.

One of the applications will connect to two DBs consistency through locally defined sequences.
We cannot use odd/even approach in sequence so that I thought we could take the more valuable of the two sequences (one on each node).

The SQL will look like this:

Select largest (by the user. SEQ_NUMBER.nextval@DB_B, the user. SEQ_NUMBER.nextval@DB_A) twice;

It works very well, but only in a sunny day scenario, i.e. when the two nodes are running. A problem with one of the DBs, I would get:

ERROR on line 1:
ORA-12541: TNS:no listener

Is it possible to intercept this error and take the value from the local database?

Thank you

Mike

Hi Mike,.

Perhaps something like that might help you:

  1  create or replace function f1 return number as
  2  lv_stmt varchar2(128);
  3  lv_ret  number;
  4  begin
  5   lv_stmt := 'select 1 from dual@dummy_dblnk';
  6   execute immediate lv_stmt into lv_ret;
  7  exception
  8   when others then
  9    if sqlcode = -2019 then
 10      return -1;
 11    else
 12     raise;
 13    end if;
 14* end;
SQL> /

Function created.

SQL> save f1 replace
Wrote file f1.sql
SQL> SELECT f1 FROM dual;

        F1
----------
        -1

Thank you
Lukasz

Tags: Database

Similar Questions

  • How to choose between the hours in the field Date IR with the functionality of the search bar?

    Hello

    I have an IR with a Date field (point) and when you use the features of the default IR search bar, it is possible to search for dates between 2 dates (date time), but I can't find a way to be able to allow the user to search between the hours of the date (s). I am interested in using the operator betwenn as I would like to provide to the user the possibility to choose for a period of time in the dates.

    How can I get this feature?

    TIA

    Hello

    Change the Date Format of application at: HH24:MI:SS JJ/MM/AAAA

    Sorry - I actually had this setting in my application (which is not often the case!)

    Andy

  • How can I prevent the Satellite to sleep when the lid is closed?

    Hello

    I connected my Toshiba with an external HDMI monitor.
    The problem is that when I close the lid (I chose the monitors in dual options) instead of sending output to the screen external, portable sleeps.

    How can I stop the laptop to sleep when the lid is closed?

    Thank you for your time.

    Hello

    Go to control panel-> power options control
    Now on the left you will see the option called choose the closing cover

    Here you choose do nothing

    Concerning

  • How can I see the full target URL when I hover over a link? Not a short URL.

    How can I see the full target URL when I hover over a link? I don't want to see short URL. Is there a way to customize this?

    Full target URL allowing me to easily see how visitors reached my site via Google, Bing, Yahoo Research, etc. With the short URL I don't see what they entered into the search field.

    You can use this extension to restore the characteristics of loss of status bar and customize settings such as displaying the URL of a link to the overview.

  • How can I stop the last post showing when I want to send this person a new Imessage.  I have an Iphone 5s

    How can I stop the last post showing when I want to send this person a new Imessage.  I don't want an old conversation appears constantly when I am a Messenger contact.  I have an Iphone 5s

    I don't know, but let me see if I understand what you're asking. You do not want to see the thread you have with a particular contact when you go to send them another message? The only way to do this is to remove the previous message thread. If you send a message to someone that you already have a thread of conversation with, it will continue to post in this thread. There is no such thing as having multiple threads with the same person. All conversations with the same person would remain in the same thread, unless you remove the previous discussions. If you delete your previous conversation, when you go to start a new conversation, he won't have any of the other answers.

  • How can I get the taskbar to show when I want to use?

    In many programs, the taskbar disappears from the bottom of the screen.  Sometimes I need to use an icon that sits on the bar spots.  How can I get the taskbar to show when I want to use an icon on this subject?

    What are 'many programs' to make it happen?  If you are using "full screen", you must leave this mode, usually by pressing F11 or ESC key.

    Unless you are referring to a mode "full screen" programs...

    • The taskbar should appear if you move the mouse to the bottom of the screen.

    OR

    • Right-click on an empty part of the taskbar, and then select Properties
      Uncheck the box "auto-hide the taskbar."
      Click OK
  • How can I prevent the access denied message when you use the shutdown command?

    I use shutdown /m \\computername/s

    I have "Access denied (5)" as an answer.
    I am admin on all my computers. Same username and password on each of them.
    How can I get this shutdown command to work remotely, so I can't access every computer command prompt via Remote Desktop?
    How can I prevent the access denied message when you use the shutdown command?

    Hello

    I suggest you to report this issue in TechNet Forums for Windows 7 networks: http://social.technet.microsoft.com/Forums/en-US/w7itpronetworking/threads

    Thank you.

  • How can I fix the problem of 'linked file' when opening file on other computers?

    How can I fix the problem of 'linked file' when opening file on other computers?

    The links must travel with the illustrator file. In other words, you can't send someone your page layout and not send them all the assets placed in the layout. However, you can embed links, but their incorporation will make your file much more available.

    Use the links Panel to incorporate images. Click on the small icon in the upper right corner of the control panel link drop-down list. I've included a screenshot.

  • Acrobat 9 installed on the old laptop. How to transfer to the new laptop? When I enter the key on the new laptop 9 standered is say invalid key

    Acrobat 9 installed on the old laptop. How to transfer to the new laptop? When I enter the key on the new laptop 9 standard is say invalid key. Help, please

    Hi bijals3520936,

    Check the serial key find the serial number of your product Adobe quickly

    Also check for compatibility before installing the software Adobe Acrobat required configuration.

    Kind regards
    Nicos

  • What is the difference between the different photo editing programs?

    What is the difference between the different photo editing programs? Photos and lightroom

    Hikristip19200817,

    Greetings.

    Concerning

    Rohit

  • How to turn off the tone car audio when playing at more fast speed CC14?

    I'm interested in disabling the audio pitch corrected during playback to higher than normal speed using he'S or LLL on the keyboard.   He does not have my workflow and causes a slow down due to the incompatible CTI skip when the playback speed changes.

    Yet once how can I disable the automatic pitch correction when reading timeline or clips to higher than normal speed?

    I like that Adobe did all the updates major at a high speed and all, but I find more UI bugs because of that and it would be nice to have more freedom in preferences to turn some of these new things that could be causing problems.

    Hey, Cliff,

    Check out the preferences > Audio > maintain during rewinding.

    Thank you

    Kevin

  • How can I install the adobe flash player when it is not supported by my laptop galaxy?

    How can I install the adobe flash player when it is not supported by my notebook to samsung Galaxy?

    Please see this page for a list of all certified devices:

    Flash Player certified devices

    If your device is supported, this FAQ will guide you through the process of manually installing the plugin:

    How to manually install Flash Player on my Android device?

  • How can I stop the ColdFusion 9 auto when I boot 10.6.8?

    Hi all

    Q: How can I stop the ColdFusion 9 auto when I boot 10.6.8?

    Where is the file auto-start for cf9 stored in snow leopard?

    Look in/Library/StartupItems.

    Dave Watts, CTO, Fig Leaf Software

  • How do you allow the popup to move when inside a < s:SkinnablePopUpContainer >

    How do you allow the popup to move when you open like that

    <? XML version = "1.0" encoding = "utf-8"? >

    " < = xmlns:fx s:Application ' http://ns.Adobe.com/MXML/2009 "

    xmlns:s = "library://ns.adobe.com/flex/spark".

    xmlns:MX = "library://ns.adobe.com/flex/mx" >

    < fx:Declarations >

    < fx:Component className = "MyAlert" >

    < s:SkinnablePopUpContainer >

    < s:TitleWindow title = "launch of Domination of the world...." "close ="close ()">

    < s:VGroup horizontalAlign = "center" width = "100%" >

    < s:Label text = "dominate the world has failed. Sorry! "/ >

    < s:Button label = "OK, nevermind" click = "close ()" / >

    < / s:VGroup >

    < / s:TitleWindow >

    < / s:SkinnablePopUpContainer >

    < / fx:Component >

    < / fx:Declarations >

    < s:Button label = click 'Launch the World Domination' = "(new_MyAlert()).open (Thi, false)" / >

    < / s:Application >

    A TitleWindow in a SkinnablePopUpContainer is a pop-up * in a ToolTip. I'm guessing that this is not what you were going. See http://help.adobe.com/en_US/flex/using/WS6c678f7b363d5da52e8f1ca1124a0430dcf-8000.html for usage of TitleWindow.

    If you want something skinnable and moves, just skin TitleWindow.

    If you want something that is skinnable and effects of opening and closing (but not moveArea integrated), use SkinnablePopUpContainer.

    If you want to combine the two, well, I'm not sure it would work the way you want it. Because you use a TitleWindow as a pop-up, he gets laid out as a presentation of the SkinnablePopUpContainer Panel. I guess you tried the code posted you, and it does not work?

    For me, I try just using a TitleWindow as documented, and then specify see the and hide effects on the TitleWindow ().

    Hope that helps.

    * It's actually a sign in a pop-up window

    Jason San Jose

    Software engineer, Flex

  • "Connection error. Check the Internet connection. "When you try to enable Web Services on HP 1606dn

    Error message "connection error. Check the Internet connection. " When you try to enable Web Services on HP Laserjet 1606dn.

    Operating system: Windows 7

    Thanks for the help,

    Howard

    Last UPDATED 21/07/13: after upgrading the firmware to the latest version, I could enable web services. Great help has this video: http://www.youtube.com/watch?v=Q5gpIGZXDXw

    Thanks for trying to help.

    In my case, it did not help.

    I followed the instructions on this video: http://www.youtube.com/watch?v=Q5gpIGZXDXw.

    The key was the update of the firmware, I think.

    Walter

Maybe you are looking for