Попался тут код для вытаскивания PACKAGE_BODY, писал не я - коллега, просто, чтобы не потерять...
SQL код:
SPOOL result/package_body.sql
SET LONG 120000 LONGCHUNKSIZE 120000 PAGESIZE 0 LINESIZE 1000 FEEDBACK OFF VERIFY OFF TRIMSPOOL ON
BEGIN
DBMS_METADATA.set_transform_param (DBMS_METADATA.session_transform, 'SQLTERMINATOR', true);
DBMS_METADATA.set_transform_param (DBMS_METADATA.session_transform, 'PRETTY', true);
DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'STORAGE',false);
dbms_metadata.set_transform_param(dbms_metadata.session_transform,'SEGMENT_ATTRIBUTES',false);
dbms_metadata.set_transform_param(dbms_metadata.session_transform,'TABLESPACE',false);
dbms_metadata.set_transform_param(dbms_metadata.session_transform,'CONSTRAINTS',false);
dbms_metadata.set_transform_param(dbms_metadata.session_transform,'REF_CONSTRAINTS',false);
dbms_output.enable();
END;
/
SELECT REPLACE(REPLACE(dbms_metadata.get_ddl('PACKAGE_BODY', object_name, owner), '"PKG_OWNER".'), '"')
FROM (SELECT object_type,
object_name,
owner
FROM dba_objects
WHERE object_type = 'PACKAGE BODY'
AND owner IN ('PKG_OWNER')
--These objects are included with other object types.
)
ORDER BY owner,
object_type,
object_name;
BEGIN
dbms_output.disable();
end;
/
SET PAGESIZE 14 LINESIZE 100 FEEDBACK ON VERIFY ON
spool off
/