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# ;