Solved

Broken DBLinks in Oracle after network outage or remote DB shutdown

Posted on 2014-09-29
5
571 Views
Last Modified: 2014-10-03
We have two enterprise apps each with their own Oracle 11g database.  App2 has a dblink to App1.  When App1 is taken offline for scheduled maintenance, and then restored - our dblink is broken.  Users run a report and will receive ORA-03114.  The error only occurs once because when the user runs the report again there are no issues.

We are positive the issue is caused when App1 goes offline during a reboot or network outage.

Is there a way to restore the dblink once App1 is brought online after maintenance?
0
Comment
Question by:bmsande
  • 3
  • 2
5 Comments
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 40350539
running a query with table@dblink should recreate the dblink session

you could do this after app1 starts
0
 

Author Comment

by:bmsande
ID: 40350556
any suggestions on automating this?
0
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 500 total points
ID: 40350627
yes... use scheduled job at db start with a delay
and run procedure from app1 across a dblink to app2 ... :)

and vice versa for the other

or if you use a startup script for the database, add a script for such a query on the other database

example on windows: start.cmd
net start OracleServiceAPP1
set oracle_sid=APP1
sqlplus "/ as sysdba" @startup.sql

sqlplus user/pass@APP2 @checkdblink.sql

startup.sql:
 startup open
exit

checkdblink.sql
select * from table@dblink
where 1 = 0;
exit;

Open in new window

0
 

Author Comment

by:bmsande
ID: 40350891
Thanks for the additional info.  Is the behavior we receive with the ORA error expected when the remote db is shutdown or restarted?  Is this common with db links?
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 40360506
dblinks are not very stable

they sometimes just fail and then you have to find the session on the remote db and kill them to fix the problem
the db will automatically make new dblink session after they were killed
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MULTIPLE DATE QUERY 15 77
Retreiving column names in Windows but not in Unix 11 44
ESX 6.0 Best Practices for datastore size 5 76
Help on model clause 5 31
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question