Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Remote database
DA Morgan wrote:
> I test them with the following code:
>
> BEGIN
> SELECT table_name
> INTO i
> FROM all_tables_at_remote_database
> WHERE rownum = 1;
> EXCEPTION
> WHEN OTHERS THEN
> RAISE ...
> END;
Also remember that a valid link can give a connection error if you leave
connections open.
If while that connection is open, and the remote db is for example bounced, that connection is downed.
When you try to use that connection again, you will get an ORA error. Run that exact same SQL immediately again, and it will work the 2nd time around.
You can work in an ALTER SESSION CLOSE DBLINK into the above PL/SQL code to make sure that any existing connection for that link is closed and a brand new one is opened.
Or you can trap the ORA whatever error (connection closed?) that results in the connection no longer be available, but the link valid and working.
-- BillyReceived on Wed Feb 12 2003 - 01:15:58 CST