ITPub博客

首页 > 数据库 > Oracle > Oracle 获取ddl语句

Oracle 获取ddl语句

原创 Oracle 作者:j04212 时间:2014-02-13 11:05:26 0 删除 编辑


--得到所有表空间的ddl语句

SELECT DBMS_METADATA.GET_DDL('TABLESPACE', TS.tablespace_name)
FROM DBA_TABLESPACES TS;


--得到所有创建用户的ddl语句
SELECT DBMS_METADATA.GET_DDL('USER',U.username)
FROM DBA_USERS U;

--所支持的45个OBJECT TYPE:

  Type Name Meaning
  ------------------------------ ------------------------------
  AUDIT_OBJ audits of schema objects
  AUDIT audits of SQL statements
  ASSOCIATION associate statistics
  CLUSTER clusters
  COMMENT comments
  CONSTRAINT constraints
  CONTEXT application contexts
  DB_LINK database links
  DEFAULT_ROLE default roles
  DIMENSION dimensions
  DIRECTORY directories
  FUNCTION stored functions
  INDEX indexes
  INDEXTYPE indextypes
  JAVA_SOURCE Java sources
  LIBRARY external procedure libraries
  MATERIALIZED_VIEW materialized views
  MATERIALIZED_VIEW_LOG materialized view logs
  OBJECT_GRANT object grants
  OPERATOR operators
  OUTLINE stored outlines
  PACKAGE stored packages
  PACKAGE_SPEC package specifications
  PACKAGE_BODY package bodies
  PROCEDURE stored procedures
  PROFILE profiles
  PROXY proxy authentications
  REF_CONSTRAINT referential constraint
  ROLE roles
  ROLE_GRANT role grants
  ROLLBACK_SEGMENT rollback segments
  SEQUENCE sequences
  SYNONYM synonyms
  SYSTEM_GRANT system privilege grants
  TABLE tables
  TABLESPACE tablespaces
  TABLESPACE_QUOTA tablespace quotas
  TRIGGER triggers
  TRUSTED_DB_LINK trusted links
  TYPE user-defined types
  TYPE_SPEC type specifications
  TYPE_BODY type bodies
  USER users
  VIEW views
  XMLSCHEMA XML schema

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27633655/viewspace-1080658/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-10-23

  • 博文量
    94
  • 访问量
    249166