web analytics

Oracle: recreate database links

SELECT
 'create '
 ||DECODE(U.NAME,'PUBLIC','public ')
 ||'database link '||CHR(10)
 ||DECODE(U.NAME,'PUBLIC',NULL, U.NAME||'.')
 || L.NAME||CHR(10)
 ||'connect to ' || L.USERID || ' identified by '''
 ||L.PASSWORD||''' using ''' || L.host || ''''
 ||CHR(10)||';' TEXT
FROM  
 sys.LINK$ L,
 sys.USER$ U
WHERE L.OWNER# = U.USER# ;

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

Categories

A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.