生成oracle中dblink创建语句:
SELECT to_char(dbms_metadata.get_ddl('DB_LINK', 'DB_LINK_NAME', 'SCHEMAS')) FROM dual;
生成job创建语句:
SELECT 'declare job number; dbms_job.submit(job => job,what => ''' || what || ''',next_date => to_date(''' ||to_char(next_date, 'dd-mm-yyyy hh24:mi:ss') || ''', ''dd-mm-yyyy hh24:mi:ss''),interval => ''' || REPLACE(INTERVAL, '''', '''''') || '''); commit; end;'
FROM user_jobs;