jayjaybigs
IS-IT--Management
Hello, I have several links in a database.
My object is to:
1)Output each link.
2)drop the link
3)re-create the link with a new password.
Here is my effort:
========================
begin
for r in (select owner,db_link,username,host from dba_db_links where owner = 'PUBLIC')
loop
dbms_output.put_line('Link: '||r.db_link||', host: '||r.host||', username: '||r.username);
execute immediate 'drop public database link '||r.db_link';
execute immedaite 'create public database link '||r.db_link' connect to '||r.username identified by
hello12 using '||r.host'
end loop;
end;
/
================
However, this is not working. Please advise.
My object is to:
1)Output each link.
2)drop the link
3)re-create the link with a new password.
Here is my effort:
========================
begin
for r in (select owner,db_link,username,host from dba_db_links where owner = 'PUBLIC')
loop
dbms_output.put_line('Link: '||r.db_link||', host: '||r.host||', username: '||r.username);
execute immediate 'drop public database link '||r.db_link';
execute immedaite 'create public database link '||r.db_link' connect to '||r.username identified by
hello12 using '||r.host'
end loop;
end;
/
================
However, this is not working. Please advise.