select dbms_metadata.get_granted_ddl('TABLESPACE_QUOTA', dtq.username) AS DDL_SCRIPT from dba_ts_quotas dtq where dtq.username = 'TYPE_USER_NAME' and rownum = 1 union all select dbms_metadata.get_granted_ddl('ROLE_GRANT', drp.grantee) AS DDL_SCRIPT from dba_role_privs drp where drp....
在Oracle中,我们获取对象的DDL语句,可以使用 DBMS_METADATA.GET_DDL()函数。 语法结构: DBMS_METADATA.GET_DDL ( object_type IN VARCHAR2, name IN VARCHAR2, schema IN VARCHAR2 DEFAULT NULL, version IN VARCHAR2 DEFAULT 'COMPATIBLE', model IN VARCHAR2 DEFAULT 'ORACLE', transform IN VARCHAR2 DEFAULT...
FUNCTIONGET_DDL(object_typeVARCHAR,nameVARCHAR,ob_schemaVARCHARDEFAULTNULL,versionVARCHARDEFAULT'COMPATIBLE',modelVARCHARDEFAULT'ORACLE',transformVARCHARDEFAULT'DDL')RETURNCLOB; 参数解释 参数解释 object_type要检索的对象的类型。对象类型的属性必须是一个已命名对象。当前支持的对象类型包括TABLE、VIEW、INDEX、PROCE...
where U.OBJECT_TYPE IN ('TABLE','INDEX','PROCEDURE'); 3.得到所有表空间的ddl语句 SET SERVEROUTPUT ON SET LINESIZE 1000 SET FEEDBACK OFF set long 999999---显示不完整 SET PAGESIZE 1000---分页 ---去除storage等多余参数 SELECT DBMS_METADATA.GET_DDL('TABLESPACE', TS.tablespace_name) FROM DB...
[Oracle]dbms_metadata.get_ddl的使⽤⽅法总结dbms_metadata.get_ddl()⽤于获取对象的DDL,其具体⽤法如下。复制代码代码如下:set line 200 set pagesize 0 set long 99999 set feedback off set echo off 复制代码代码如下:select dbms_metadata.get_ddl('TABLE','TABLE_NAME','TABLE_OWNER') from ...
_METADATA.GET_DDL('TABLE','DEPT','SCOTT')FROMDUAL;-- 查看所需表的索引selectINDEX_NAME,INDEX_TYPE,TABLE_NAMEfromuser_indexesWHEREtable_name='EMP';--查看当前用户索引的SQLselectdbms_metadata.get_ddl('INDEX','PK_DEPT')fromdual;-- 查看其他用户索引的SQLselectdbms_metadata.get_ddl('INDEX','...
dbms_metadata包中的get_ddl函数定义FUNCTION get_ddl ( object_type IN VARCHAR2,name IN VARCHAR2,schema IN VARCHAR2 DEFAULT NULL,version IN VARCHAR2 DEFAULT 'COMPATIBLE',model IN VARCHAR2 DEFAULT 'ORACLE',transform. IN VARCHAR2 DEFAULT 'DDL') RETURN CLOB; ...
dbms_metadata包中的get_ddl函数定义: FUNCTION get_ddl ( object_type IN VARCHAR2, name IN VARCHAR2, schema IN VARCHAR2 DEFAULT NULL, version IN VARCHAR2 DEFAULT ‘COMPATIBLE’, model IN VARCHAR2 DEFAULT ‘ORACLE’, transform. IN VARCHAR2 DEFAULT ‘DDL’) RETURN CLOB; ...
DBMSMETADATA.GETDDL包可以得到数据库的对象的ddl脚本。如下SQLPLUS中执行:1.得到一个表的ddl语句:SET SERVEROUTPUT ONSET LINESIZE 1000SET FEEDBACK OFFset
Oracle Database Backup Service - Version N/A and later Information in this document applies to any platform. Symptoms If you are using DBMS_METADATA and when you try to generate the DDL for a user using GET_DDL, you will notice the hashed password value is missing, for example, even when...