Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: TNSPING from PL/SQL?

Re: TNSPING from PL/SQL?

From: Papa Piquillo <oraclejva_at_yahoo.es>
Date: 22 Dec 2005 13:16:14 -0800
Message-ID: <1135286174.401479.284850@g43g2000cwa.googlegroups.com>


I agree mr Bakker and TAF is the elegant way to solve this issue. But if you don't won't to implement it you can reinvent the wheel like this:

declare
newline char(1) := chr(10); /* Newline command */ string varchar2(1000);
l_db_link user_db_links.db_ink%type;
cursor each_c is select db_link

                  from user_db_links;

begin
open each_c;
loop
          fetch each_c into l_db_link;
          exit when each_c%NOTFOUND;
          begin
               dbms_sql.parse ( 'delete from dual@' || l_db_link ,
dbms_sql.native );
               string := 'conn hr/hr@' || l_db_link || newline || '
@c:\script1.sql;' ||
                                   newline || ' @c:\script2.sql;' ||
                                   newline || ' @c:\script3.sql;' ||
               insert into temptbl (command) values (string);
         when others
              dbms_output.put_line ( '--The databadase pointed by ' ||
l_db_link || ' is down' );
         end;

end loop;
end; Received on Thu Dec 22 2005 - 15:16:14 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US