No question at this time
DBA Top 10
1 M. Cadot 22100
2 A. Kavsek 15500
3 M. Hidayathullah ... 11000
4 B. Vroman 7900
5 P. Wisse 6000
6 T. Boles 5400
7 J. Schnackenberg 3300
8 G. Lambregts 2200
8 P. Knibbs 2200
8 K. Pagadala 2200
About
DBA-Village
Download PLATO
The free tool for auditing and tuning your database
Version 55 now available
Sep 02, 2016
The DBA-Village forum
Forum as RSS
as RSS feed
Site Statistics
Ever registered users48016
Total active users1849
Act. users last 24h10
Act. users last hour0
Registered user hits last week306
Registered user hits last month1339
Go up

Sql script to find the count of dblink which is not accessible
Next thread: GI Ihstallation for standalone database
Prev thread: end of file communication error

Message Score Author Date
Dear friends,Like we have dblink d1, d2, Oracle s...... Prasathi Ji Aug 03, 2017, 09:25
As a starter: <pre>create or replace function c...... Score: 400 PtsScore: 400 PtsScore: 400 PtsScore: 400 PtsScore: 400 Pts Michel Cadot Aug 03, 2017, 12:29
Dear Michael, Thanks for the prompt response an...... Prasathi Ji Aug 03, 2017, 15:10

Follow up by mail Click here


Subject: Sql script to find the count of dblink which is not accessible
Author: Prasathi Ji, India
Date: Aug 03, 2017, 09:25, 13 days ago
Os info: Rhel 6
Oracle info: Oracle 11g
Message: Dear friends,Like we have dblink d1, d2, Oracle scripts vd3, d4. If d4 dblink is down and user is not able to connect using d4 dblink then it will show the count 1.
This will show the count of dblink if any dblink connectivity is fail.
Goto: Reply - Top of page 
If you think this item violates copyrights, please click here

Subject: Re: Sql script to find the count of dblink which is not accessible
Author: Michel Cadot, France
Date: Aug 03, 2017, 12:29, 13 days ago
Score:   Score: 400 PtsScore: 400 PtsScore: 400 PtsScore: 400 PtsScore: 400 Pts
Message:
As a starter:
create or replace function check_bad_links return integer as

cnt pls_integer := 0;
dum varchar2(1);
begin
for dblink in (select db_link from user_db_links) loop
begin
execute immediate 'select dummy from dual@'||dblink.db_link into dum;
exception when others then cnt := cnt+1;
end;
end loop;
return cnt;
end;
/

SQL> select check_bad_links from dual;
CHECK_BAD_LINKS
---------------
2

1 row selected.


Regards
Michel
Your rating?: This reply is Good Excellent
Goto: Reply - Top of page 
If you think this item violates copyrights, please click here

Subject: Re: Sql script to find the count of dblink which is not accessible
Author: Prasathi Ji, India
Date: Aug 03, 2017, 15:10, 13 days ago
Message: Dear Michael,

Thanks for the prompt response and wonderful solution.

Best Regards
Prasathi
Your rating?: This reply is Good Excellent
Goto: Reply - Top of page 
If you think this item violates copyrights, please click here