How to script out a table definition in Oracle Sql developer

In Oracle Sql developer, how do you script out a table definition, so that when you want to create the table in another database, you don't have to create the table manually?
LVL 2
brgdotnetcontractorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
I would probably do it with straight SQL:
select dbms_metadata.get_ddl('TABLE','YOUR_TABLE_NAME') from dual;

https://docs.oracle.com/database/122/ARPLS/DBMS_METADATA.htm#GUID-A4683EEE-6F54-4081-B7BF-1496096675FA

If you want the SQL Developer way:
http://www.oracle.com/technetwork/developer-tools/sql-developer/export-intro-1-161239.html
1
Geert GOracle dbaCommented:
there is also the change management solutions
where you only work on the test database and then move items to production via such a change management solution

https://www.red-gate.com/simple-talk/blogs/how-mature-is-your-database-change-management-process/

look for change management on google

all depends how far you need this to go
if you have an audit department which completely forbids IT to go on production, then you have a big shop which will have to go like the solution above
smaller shops usually go the scripting direction

it helps to have a secondary "QAS" (or quality or upgrade) database on which the scripts can be tested.

for bigger scripts i activate flashback database on a qas database
this allows us to return the qas database into a "before the script screwed up" runs state and this process is repeated until the devs are satisfied and they have gotten their flawless go-live script
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.