set head off set pages 0 set long 9999999 set lines 200 SELECT dbms_metadata.get_ddl('SYNONYM', synonym_name, owner) || '/' ddlsynonym FROM dba_synonyms where owner='SCHEMANAME' ;