Search This Blog

Monday, 10 November 2025

extract DDL for database links with passwords -

 follow the link


https://forums.oracle.com/ords/apexds/post/how-to-extract-ddl-for-all-database-links-7664


set lines 200
set pages 0
set feed off
set heading off
spool get_ddl/get_dblink_ddl.run.sql

SELECT 'CREATE OR REPLACE PROCEDURE '||DECODE(U.NAME,'PUBLIC','SYSTEM',U.NAME)||'.dba$sp_create_dblink_tmp AS '||CHR(10)||'BEGIN'||CHR(10)||
'EXECUTE IMMEDIATE '||''''||
'create '||DECODE(U.NAME,'PUBLIC','public ',' ')||'database link '||L.name
||' connect to ' || L.USERID || ' identified by values '
||''''||''''||L.PASSWORDX||''''||''''||' using '||''''||''''|| L.host ||''''||''''||''''||';'|| CHR(10)||'END dba$sp_create_dblink_tmp; '
||CHR(10)||'/'||CHR(10)||
'EXECUTE '||DECODE(U.NAME,'PUBLIC','SYSTEM',U.NAME)||'.dba$sp_create_dblink_tmp;'||CHR(10)||
'DROP PROCEDURE '||DECODE(U.NAME,'PUBLIC','SYSTEM',U.NAME)||'.dba$sp_create_dblink_tmp;'||CHR(10)
||CHR(10)
TEXT
FROM sys.link$ L, sys.user$ U
WHERE L.OWNER# = U.USER#
;

spool off

No comments:

Oracle ERP R12.2 cloned environment by EBS cloud manager - users facing "an invalid redirect has been blocked" while opening forms

 Run the following query and check if the source values are still there, if source values are there, then update with the cloned environment...