set  wrap off
set linesize 100
set  feedback off
set  pagesize 0
set  verify off
set TERMOUT off

SPOOL ytmpy.sql
SELECT cmd FROM (
SELECT 1 AS ord, 'alter table '||table_name||' disable constraint '||CONSTRAINT_name||';' AS cmd FROM user_constraints
WHERE constraint_type = 'R'
UNION
SELECT 2 , 'alter table '||table_name||' disable constraint '||CONSTRAINT_name||';'FROM user_constraints
WHERE constraint_type  = 'P'
)
ORDER BY ord;

spool off
set termout on
@ytmpy.sql
exit