CSS keepalive script for SQLnet with SELECT query

Unanswered Question
Jul 30th, 2007
User Badges:


Title says it alls : has anybody developed a keepalive script which

checks availability of an Oracle DB

server by connecting and checking

the reply to a specific SQL select

query (the latter enables to determine

whether the server is active or standby

in a Oracle Data Guard set up).

I am also interested in advise about

how difficult/feasible it would be to

write a script for SQLnet myself.



  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 2.5 (2 ratings)

The script is used as a keepalive to test the responsiveness of the CDM or CR to returning redirects for client HTTP requests. The arguments are the device's address, the webpage to test for, and a timeout (in milliseconds). If no timeout is given, 5000 is used as default. The webpage needs to be a page that will remain on the CDM. Look at the CE_Play URL for the page in the Previewer.


patrick.demuynck Mon, 08/06/2007 - 07:08
User Badges:

Thanks but I am looking for a script

which runs an SQL select (port 1521),

not an HTTP get (port 80).


veriton Tue, 08/07/2007 - 06:30
User Badges:

Hi Patrick

It sounds as though you're trying to use a CSS in front of the Oracle listener to direct all client calls.

Your keep-alive would presumably do something like SELECT 1 FROM DUAL. However in doing that it would also create a new Oracle session each time which is a relatively expensive process - if you were doing this every few seconds you would add a non-trivial additional load to your database server.

Can I suggest that you don't use the CSS but use the load balancing/failover facilities within the SQLnet layer? This is designed to handle failover from active to standby sites along with fancier things like fast connection failover within Real Application Cluster databases. You also need to consider how the application tier (Oracle Application Server or whatever) fails over since it is normally in the same data centre as the database - this is where the CSS comes in useful.


patrick.demuynck Wed, 08/08/2007 - 04:22
User Badges:

Thanks for your advice Simon.

About the load balancing/failover facilities within the SQLnet layer : yes the Oracle development guys over here are looking into this. Note that the application tier normally should use the RAC cluster in site 1, and fall back to an isolated DB server in site 2 (only if site 1 is not available).

Since this appears to be a non-trivial matter, I was also looking at a CSS based solution. And even without the "SQL select" keepalive scripts, I can still implement a manual failover scenario site 1 -> site 2 :-)

veriton Wed, 08/08/2007 - 08:12
User Badges:

Actually it's pretty standard in Oracle terms - RAC at a primary site with a single instance standby database is common.

Personally I'd rather not put a CSS in the way - that's not to say it won't work, just that it might have unexpected side effects (e.g. for failover within the RAC cluster). Plus it won't be a configuration that Oracle has tested.

I suggest you bounce it back to the Oracle DBAs and get them to work it out ;)

Of course if you've got Application Server in there too you'll probably want a CSS (perhaps two/four geographically dispersed) between them and your end users.



This Discussion