Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CREATE TABLE reverse engineering in Oracle

Tags:

sql

oracle

In Oracle SQL Developer, there's a "SQL" tab for each table. This tab contains most of the SQL code (CREATE TABLE, CREATE TRIGGER, etc) that's needed to recreate the table.

Is this information available programatically from the database system, or is this an application feature of SQL Developer? If the former, what commands/statements would I need to run to retrieve this information? If the later, are there any clever ways to get SQL Developer to export these statements?

like image 758
Alan Storm Avatar asked Dec 23 '22 10:12

Alan Storm


1 Answers

If you are using Oracle 9i+ then you are looking for the DBMS_METADATA package. http://download.oracle.com/docs/cd/B10500_01/appdev.920/a96612/d_metada.htm. It will allow you to extract whatever DDL you want.

If you are looking for more specific information there is a whole host of views you can access for specific data elements similar to the ones given by @Quassnoi.

like image 83
David Avatar answered Jan 02 '23 06:01

David