Home » SQL & PL/SQL » SQL & PL/SQL » check status of database via dblink?
check status of database via dblink? [message #211588] Fri, 29 December 2006 13:37 Go to next message
lotusdeva
Messages: 198
Registered: March 2005
Senior Member
Hello, is there any way to check if the database is up via a dblink, say in a pl/sql procedure? Thank you!
Re: check status of database via dblink? [message #211589 is a reply to message #211588] Fri, 29 December 2006 13:39 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
If the remote database is down, your sql using the DBLINK will fail. What else are you expecting?
Re: check status of database via dblink? [message #211593 is a reply to message #211589] Fri, 29 December 2006 14:05 Go to previous messageGo to next message
lotusdeva
Messages: 198
Registered: March 2005
Senior Member
so I can be like -

select 'X' from dual@my_db_link;

what if this is within a pl/sql block. is there an ORA-Something that can be catched that indicates that db is down? or how can u differentiate between an invalid db link error and db actaully be down or is it the same? thank you!
Re: check status of database via dblink? [message #211594 is a reply to message #211593] Fri, 29 December 2006 14:19 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Did you even bother to try ?
--
-- a legitimate dblink
--
dbadmin@xxx > select 'x' from dual@lawd;

'
-
x
--
-- a bogus one
--
dbadmin@xxx > select 'x' from dual@nosuchdblink;
select 'x' from dual@nosuchdblink
                     *
ERROR at line 1:
ORA-02019: connection description for remote database not found
--
-- a legitimate dblink but the remote database is not available.
--
dbadmin@xxx > select 'x' from dual@rmandb;
select 'x' from dual@rmandb
                     *
ERROR at line 1:
ORA-02068: following severe error from RMANDB
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
SVR4 Error: 2: No such file or directory
Re: check status of database via dblink? [message #211661 is a reply to message #211588] Sat, 30 December 2006 15:49 Go to previous message
lotusdeva
Messages: 198
Registered: March 2005
Senior Member
thank you, you are so nice!
Previous Topic: Is it possible top create a database-wide Table Column Alias?
Next Topic: Rollback segment problem during delete
Goto Forum:
  


Current Time: Sat Dec 10 01:05:56 CST 2016

Total time taken to generate the page: 0.16291 seconds