oracle| Object | Statement oracle9i new attribute-Get Object DDL statement using Dbms_metadata Package Author: eygle Source: http://blog.eygle.com Date: December 22, 2004
«oracle integration of the difficulties of the Benevolence division | Blog Home
Starting with Oracle9i Oracle provides a new system package dbms_metadata that can be used to extract DDL statements from object creation.
This package function is extremely powerful, let's look at how it is used.
1. Get the creation statement for the table.
sql> desc dbms_metadatafunction add_transform RETURNS number ... FUNCTION get_ddl RETURNS CLOB Argument Name Type in/out Default? -------------------------------------------------------------------object_type VARCHAR2 in NAME VARCHAR2 in SCHEMA VA RCHAR2 in default VERSION VARCHAR2 in default MODEL VARCHAR2 in default TRANSFORM VARCHAR2 in default ....
Sql> Set Long 2000
Sql> Select Dbms_metadata.get_ddl (' TABLE ', ' TEST ') from dual;
Dbms_metadata. GET_DDL (' TABLE ', ' TEST ')
--------------------------------------------------------------------------------
2. Further, more comprehensive DDL statements can be obtained through dbms_metadata
Oracle provides a comprehensive example:
$ORACLE _home/rdbms/demo/mddemo.sql
All DDL statements, including indexes, authorizations, triggers, and so on, can be extracted.
Interested can refer to the document, follow the example of demo test.
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.