Re: remote database shutdown
From: Chuck Hamilton <chuckh_at_ix.netcom.com>
Date: 1996/02/09
Message-ID: <4ffumg$jg0_at_ixnews6.ix.netcom.com>#1/1
whenever sqlerror exit
select count(*) from user_tables_at_remote_db; rem If you get here, the server's up.
Date: 1996/02/09
Message-ID: <4ffumg$jg0_at_ixnews6.ix.netcom.com>#1/1
Ramesh B S <bsr_at_cs.clemson.edu> wrote:
>Hi,
>Iam running a script daily that truncates some tables (local) and
>copies values from remote database tables. Is there any way to tell
>(before starting the truncate, insert..select *.. sequence) if the
>remote database server is up? (and to abort the above sequence in case
>the server is down.)?
>Thank you.
Here's one suggestion. Create a database link to the server and try to select a table from it. If it fails, it fails with an SQL error which can be trapped by "WHENEVER SQLERROR EXIT".
is_it_up.sql
whenever sqlerror exit
select count(*) from user_tables_at_remote_db; rem If you get here, the server's up.
-- Chuck Hamilton chuckh_at_ix.netcom.com Never share a foxhole with anyone braver than yourself!Received on Fri Feb 09 1996 - 00:00:00 CET