We help IT Professionals succeed at work.

How to script out a table definition in Oracle Sql developer

brgdotnet asked
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?
Watch Question

Most Valuable Expert 2012
Distinguished Expert 2019

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


If you want the SQL Developer way:
Oracle dba
Top Expert 2009
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


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