0

I have a few large tables in a oracle DB (lots of columns and data types) that I need to move to another oracle database (say from my DEV region to UAT region). Is there anyway I can get sql developer or sql plus to output a create table statement that is exactly the structure of the existing table?

thanks

3 Answers 3

2

If you want to get it through SQL statement then you can try the below query

SELECT dbms_metadata.get_ddl('TABLE', 'Your_Table_Name') FROM dual; 

See DBMS_METADATA for more information.

You can generate the script using Toad software as well (In case you have Toad installed)

Sign up to request clarification or add additional context in comments.

Comments

0

If you are making use of the SQL Developer you can right click the table that you want to generate a script for.

From there select Quick DDL and then click on Save To File. This will then generate the create table script to an external sql file. You can do this for multiple tables as well by selecting more than one table at a time.

Hope this helps!!

Comments

0

Another option is to create a database link between the two schemas and then do a

create table table_name AS SELECT * from table_name@original_server

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.