Link to home
Create AccountLog in
Avatar of axnst2
axnst2Flag for United States of America

asked on

How can I script out an entire schema under Oracle 11g

Hi Experts,

        I have an oracle DB schema (11g) and I would like to script out all of the objects in it so that I can recreate the DB should I loose the server that it is currently running on!  I know I can export a dump but I need the create scripts for all tables, procedures, indexes, views, triggers, etc that I created!  How do I go about doing that?

I found this:

SELECT DBMS_METADATA.GET_DDL(object_type, object_name) FROM user_objects

but I don't want to have to specify every object/object type that I have!  Is there a way to do this?

Thanks!
Avatar of gatorvip
gatorvip
Flag of United States of America image

Avatar of Chakravarthi Ayyala
If you have Toad, you can choose Database-> Export -> Generate Schema script and achieve the same.
ASKER CERTIFIED SOLUTION
Avatar of MikeOM_DBA
MikeOM_DBA
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Oracle SQL Developer Data Modeler not only is FREE, but it will also generate a nice "picture" of your database (or subset thereof) you can post on your wall to impress your boss.
;)
Looking into the internet, I've found this link:
http://www.optimaldba.com/scripts/extract_schema_ddl.sql

This is a little bit old, but may work for you.

Hope this helps,
Walter.
Avatar of axnst2

ASKER

Thanks!