This browser does not support basic Web standards, preventing the display of our site's intended design. May we suggest that you upgrade your browser?
This code can be used to generate the table DDL statements for all of the tables in a schema in Oracle. It will save the DDL to a test file.
Before running this code make sure to change the file path to one that makes sense and replace SCHEMA_NAME with your actual schema name.
set pagesize 0
set feedback off
set echo off
set verify off
set heading off
set long 1000000
set trimspool on
set linesize 200
spool c:/table_ddl.sql
SELECT dbms_metadata.get_ddl('TABLE', table_name, 'SCHEMA_NAME')
FROM ALL_TABLES WHERE OWNER = 'SCHEMA_NAME';
spool off