nuodb / migration-tools

Migration tools for NuoDB
http://nuodb.github.com/migration-tools/
BSD 3-Clause "New" or "Revised" License
27 stars 10 forks source link

Migrator seems to generate proper SQL from SQL Server schema, and nuosql loads it fine, but direct migration from SQL Server to NuoDB fails. #21

Closed rbuck closed 10 years ago

rbuck commented 11 years ago

I see this issue:

nuodb-migrator schema --source.driver=net.sourceforge.jtds.jdbc.Driver --source.url=jdbc:jtds:sqlserver://192.168.237.166:1433/InvQA --source.username=funk --source.password=funk --target.url=jdbc:com.nuodb://localhost/test --target.username=cloud --target.password=user --target.schema=test

28-05-2013 12:35:34 (ERROR) (com.nuodb.migrator.jdbc.metadata.generator.CountingScriptExporter.exportScripts(CountingScriptExporter.java:65)) - Failed exporting script #2 of #1632 CREATE SEQUENCE "SEQ_AdvanceFilter_AdvanceFilterID" START WITH 16 May 28, 2013 12:35:34 PM com.nuodb.migrator.bootstrap.Bootstrap main SEVERE: Execution failed com.nuodb.migrator.cli.run.CliRunException: java.sql.SQLException: Unable to create sequence "SEQ_AdvanceFilter_AdvanceFilterID", no schema is specified at com.nuodb.migrator.cli.run.CliRunJob.run(CliRunJob.java:63) at com.nuodb.migrator.cli.run.CliRunJob.run(CliRunJob.java:50) at com.nuodb.migrator.cli.CliHandler.handleRun(CliHandler.java:200) at com.nuodb.migrator.cli.CliHandler.handleOptionSet(CliHandler.java:148) at com.nuodb.migrator.cli.CliHandler.boot(CliHandler.java:74) at com.nuodb.migrator.bootstrap.Bootstrap.boot(Bootstrap.java:74) at com.nuodb.migrator.bootstrap.Bootstrap.main(Bootstrap.java:109) Caused by: java.sql.SQLException: Unable to create sequence "SEQ_AdvanceFilter_AdvanceFilterID", no schema is specified at com.nuodb.jdbc.RemConnection.sendAndReceive(RemConnection.java:837) at com.nuodb.jdbc.RemStatement.executeUpdate(RemStatement.java:270) at com.nuodb.jdbc.RemStatement.executeUpdate(RemStatement.java:260) at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228) at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.nuodb.migrator.utils.ReflectionUtils.invokeMethod(ReflectionUtils.java:111) at com.nuodb.migrator.jdbc.connection.ConnectionProxyProvider$TargetHandler.invokeTarget(ConnectionProxyProvider.java:103) at com.nuodb.migrator.jdbc.connection.StatementLoggingConnectionProvider$StatementHandler.invokeExecute(StatementLoggingConnectionProvider.java:224) at com.nuodb.migrator.jdbc.connection.StatementLoggingConnectionProvider.invokeExecute(StatementLoggingConnectionProvider.java:149) at com.nuodb.migrator.jdbc.connection.StatementLoggingConnectionProvider$StatementHandler.invoke(StatementLoggingConnectionProvider.java:216) at com.sun.proxy.$Proxy3.executeUpdate(Unknown Source) at com.nuodb.migrator.jdbc.metadata.generator.ConnectionScriptExporter.exportScript(ConnectionScriptExporter.java:67) at com.nuodb.migrator.jdbc.metadata.generator.CountingScriptExporter.exportScripts(CountingScriptExporter.java:61) at com.nuodb.migrator.jdbc.metadata.generator.CompositeScriptExporter.exportScripts(CompositeScriptExporter.java:71) at com.nuodb.migrator.schema.SchemaJob.doExecute(SchemaJob.java:82) at com.nuodb.migrator.schema.SchemaJob.doExecute(SchemaJob.java:49) at com.nuodb.migrator.job.decorate.DecoratingJobBase.execute(DecoratingJobBase.java:50) at com.nuodb.migrator.job.SimpleJobExecutor.execute(SimpleJobExecutor.java:105) at com.nuodb.migrator.cli.run.CliRunJob.run(CliRunJob.java:57) ... 6 more

But if I do NOT specify a target and allow the schema to get dumped to a file, the resulting file is easily imported via NuoSQL.

Is there something I am missing?

jgetto commented 11 years ago

Could this be a result of foreign key issues?

The extra flags from the sample import might help: --meta.data.foreign.key=false --meta.data.check.constraint=false --identifier.normalizer=standard

If that is the case we should probably improve the error message.

rbuck commented 11 years ago

I sent you an email with a path to the database schema and data dump. Seeing there are multiple issues with migrating SQL Server state to NuoDB, I think engineering should take it from here.

tazija commented 11 years ago

Sequence name was not qualified with its enclosing schema name in final DDL. I fixed the issue in 2ae11feb5b1837ea969b337a4eb76958afa4aff9 commit.