Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.1
-
None
-
None
-
None
Description
Hi,
I have recently downloaded DDLUtils and tried to export schema and data for large database.
Case 1: It shown exported schema successfully, but there was missing some constraint and explorting all table's create query.
Case 2: Could not exported data of table.
<?xml version="1.0"?>
<project name="test" default="writeDDLToXML" basedir=".">
<!--<path id="runtime-classpath">
<fileset dir="../dist">
<include name="*/.jar"/>
<include name="*/.zip"/>
</fileset>
<fileset dir="../lib">
<include name="*/.jar"/>
<include name="*/.zip"/>
</fileset>
</path>-->
<path id="runtime-classpath">
<fileset dir="./lib">
<include name="*/.jar"/>
</fileset> </path>
<!-- This will output all the object in the database 'test' and output the schema definition
to a file 'db-schema1.xml'. This will also extract the data and output this to 'data.xml'
-->
<target name="writeDDLToXML" description="Dumps the database structure">
<taskdef name="databaseToDdl"
classname="org.apache.ddlutils.task.DatabaseToDdlTask">
<classpath refid="runtime-classpath"/>
</taskdef>
<databaseToDdl verbosity="debug">
<database url="jdbc:postgresql://localhost/APEOM"
driverClassName="org.postgresql.Driver"
username="postgres"
password="password"/>
<writeSchemaToFile outputFile="db-schema_myExportData.xml" failonerror="false" />
<!-- Comment line below if the source DB is too big -->
<writeDataToFile outputFile="schema_myExportData.xml"/>
</databaseToDdl>
</target>
<target name="writeDDLToSQL" description="Dumps the database structure" depends="writeDDLToXML">
<taskdef name="databaseToDdl"
classname="org.apache.ddlutils.task.DatabaseToDdlTask">
<classpath refid="runtime-classpath"/>
</taskdef>
<databaseToDdl verbosity="debug">
<database url="jdbc:postgresql://localhost/APEOM"
driverClassName="org.postgresql.Driver"
username="postgres"
password="password"/>
<writeSchemaSqlToFile outputFile="db-schema_myExportData.sql" dodrops="true" failonerror="false" alterdatabase="false"/>
</databaseToDdl>
</target>
</project>