Oracle 9i easy access to table and indexed DDL statements _oracle

Source: Internet
Author: User
The Oracle tutorial you are looking at is: Oracle 9i easy access to table and index DDL statements. We all know that before 9i, it would be a hassle to get the statements to build tables and indexes. Our usual practice is to come through the export with Rows=no, but its output is not directly available because of the format problem. Another approach is to write complex scripts to query the data dictionary, but this is not available for a slightly more complex object, such as IoT and nested tables.

It is often used to obtain DDL statements from the data dictionary, especially when upgrading/rebuilding the system. In Oracle 9i, we can investigate DDL statements from the data dictionary directly by executing dbms_metadata. Using this powerful tool, we can get a single object or DDL statement for the entire schema. The best thing is because it's easy to use.

1. Obtain a single table and index DDL statement methods:


Here is the output. All we have to do is take the table/index statement out and add a semicolon to the back to run it directly.


2, to obtain the entire Schema DDL statement method:


It is to be noted that when there is an external health (referential constraint) in our table, we need to identify the order between the reference tables to ensure that the reconstruction is done in a reasonable order. You can query dba_constraints and dba_cons_columns to determine the order between the tables, no longer detailed.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.