Skip to content

Instantly share code, notes, and snippets.

@wkoszycki
Created August 21, 2015 08:33
Show Gist options
  • Save wkoszycki/7509dd9f737833cd35bc to your computer and use it in GitHub Desktop.
Save wkoszycki/7509dd9f737833cd35bc to your computer and use it in GitHub Desktop.
SELECT dbms_metadata.get_ddl(object_type, object_name, owner) || ';' AS object_ddl
FROM DBA_OBJECTS
WHERE
OWNER = '<owner>'
AND OBJECT_TYPE IN (
'TABLE'
, 'INDEX'
, 'SEQUENCE'
, 'VIEW'
)
ORDER BY
OWNER
, OBJECT_TYPE
, OBJECT_NAME
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment