Eu uso esse aqui:
set linesize 2000;
set pagesize 1000;
set long 9999999;
set TRIMS on;
set ECHO off;
set FEED off;
set HEAD off;
COLUMN DDL FORMAT a9999;
exec dbms_metadata.set_transform_param(dbms_metadata.session_transform,'SQLTERMINATOR',true);
prompt
prompt *************************************************
prompt Script para Coletar codigo DDL de Objetos
prompt
prompt Atencao: Os dados abaixo nao sao CASE-SENSITIVE
prompt
prompt *************************************************
prompt
accept object_type prompt 'Qual tipo de Objeto ? '
accept object_name prompt 'Qual Nome do Objeto ? '
accept owner prompt 'Qual nome do SCHEMA ? '
SELECT DBMS_METADATA.GET_DDL(upper('&object_type'), upper('&object_name'),upper('&owner')) "DDL" FROM dual;
att