Menu

Is dbcompare schema-aware?

Help
ldf
2016-11-10
2016-11-16
  • ldf

    ldf - 2016-11-10

    SymmetricDS version: 3.8.8
    SourceDB: MS SQL Server 2008R2
    Target DB: Postgresql 9.5

    I'm currently evaluating 3.8.8 prior to upgrading from 3.7.29 and thought that I'd give dbcompare a go. I'm not sure that I understand how to use the tool properly but it seems that it does not take into account that the target table may be in a different schema from the source.

    So, in my source database I have s_schema.my_table and in my target database (which is remote, but I've copied the engine properties file over) I have t_schema.my_table.

    When I run

    bin\dbcompare --output-sql diff.sql -s engines\sym_hub_000.properties -t tmp\sym_node_001.properties  --use-sym-config true
    

    I get the following ouput:

    [sym_node-001] - DbCompare - No target table found for table s_schema.my_table
    

    That is, it is not translating the schema name from s_schema to t_schema.

    Can you see anything that I'm doing wrong? Could this be a bug?

    Thanks!
    Lance

     
  • Mark Michalek

    Mark Michalek - 2016-11-10

    Lance,

    Thanks for trying out dbcompare. In your SymmetricDS configuration, do you configure your schema names anywhere, like in sym_trigger, sym_router, sym_transform_table? Also, when your DB user connects to your sym_node_001 database, is t_schema the default schema?

    Thanks,
    Mark

     
  • ldf

    ldf - 2016-11-10

    Thanks for your very quick response, Mark.

    In my set up I have the following:

    sym_trigger.source_schema_name = s_schema
    sym_router.target_schema_name = t_schema
    

    Neither s_schema nor t_schema are default schema. That is, table names in those schema must be schema qualified to be accessible.

    Regards
    Lance

     
  • Mark Michalek

    Mark Michalek - 2016-11-11

    Lance, thanks for the detail. I think the issue is that dbcompare doesn't consult sym_router for the schema name. I've entered a defect for that here:
    https://www.symmetricds.org/issues/view.php?id=2898

    Thanks for reporting this. As a workaround, you might be able to specify an entry in sym_transform_table (with column policy SPECIFIED) which maps the source schema name to the target schema name. If you went down that route, you would probably need to clear the schema name change on the router, or use a different on this table to test it out).

    Thanks,
    Mark

     
  • Mark Michalek

    Mark Michalek - 2016-11-16

    Lance, just a heads up that I just committed a change which should address your issue. That fix will be part of SymmetricDS 3.9.
    https://www.symmetricds.org/issues/view.php?id=2898

    Mark

     
  • ldf

    ldf - 2016-11-16

    Thanks Mark. I'm looking foward to trying it.

    Lance

     

Log in to post a comment.