Oracle SQL Developer-导出DDL-仅创建表SQL [英] Oracle sql developer - export DDL - only create table sql
问题描述
我想通过在Oracle数据库中生成的HSQLDB中的所有表生成单元测试。
I want to run unit tests by generating all tables in HSQLDB, present in my oracle database.
为此,我想从oracle中导出所有DDL create table语句
For that I want to export all DDL create table statements from oracle tables.
我尝试导出数据库,但是与创建表sql一起,我得到了很多其他SQL,例如
I tried export database, but along with create table sql I am getting lot other SQLs like,
按范围划分( CREATION_DATE)等。
" PARTITION BY RANGE ("CREATION_DATE") " etc.
如何将所有oracle表(模式)导出到HSQLDB?有什么更好的方法吗?
How do I export all oracle tables(schema) to HSQLDB? is there any better way?
推荐答案
您可以使用 DBMS_METADATA.GET_DDL()
函数来获取表定义,并修改 SET_TRANSFORM_PARAM()选项,在这种情况下尤其是 PARTITIONING
参数。
You can use the DBMS_METADATA.GET_DDL()
function to get the table definition, and modify what is included with the SET_TRANSFORM_PARAM() options, specifically in this case the PARTITIONING
parameter.
有很多示例可供您搜索,但此处显示的是简化的DDL 具有类似的转换。
There are lots of examples for you to search for, but here's one that shows the DDL being simplified with similar transformations.
这篇关于Oracle SQL Developer-导出DDL-仅创建表SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!