Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set up multiple tables #168

Open
efcunha opened this issue Jan 11, 2024 · 2 comments
Open

set up multiple tables #168

efcunha opened this issue Jan 11, 2024 · 2 comments

Comments

@efcunha
Copy link

efcunha commented Jan 11, 2024

Describe the bug
A clear and concise description of what the bug is, with verbose log.

To Reproduce
Steps to reproduce the behaviour:

  1. Source table DDL
  2. Sink table DDL
  3. ReplicaDB configuration options-file.

root@ip-172-30-2-231:/opt/conf# cat replicadb.conf
######################## ReplicadB General Options ########################
mode=incremental
jobs=1
fetch.size=100
verbose=true

Help us to improve by activating usage analysis through the Sentry service. Or set up your own Sentry DSN

sentry.dsn=https://400e0daa08c24a399b842048c409416f@o1002451.ingest.sentry.io/5962725
############################# Soruce Options ##############################
source.connect=jdbc:sqlserver://segware.cg120h1yldzn.us-east-1.rds.amazonaws.com:1433;database=XXXXXX
source.user=replicadb
source.password=xxxxx
source.table=dbo.CENTRAL_MONITORADA_HISTORICO
############################# Sink Options ################################
sink.connect=jdbc:sqlserver://sqlserver-web.cg120h1yldzn.us-east-1.rds.amazonaws.com:1433;database=XXXXXX
sink.user=replicadb
sink.password=xxxxx
sink.staging.schema=SEGWARE_BOTTOM
sink.staging.table=dbo.CENTRAL_MONITORADA_HISTORICO
sink.disable.truncate=true

Expected behavior
How do I configure multiple tables in fields:
source.table and sink.staging.table

Additional context
Add any other context about the problem here. Running environment (cloud, on premise, java version..), source and sink technologies (Oracle, MySQL, Postgres...)
AWS RDS SQL Server Standard Edition 2014 to AWS RDS SQL Server Web Edition 2017

@efcunha efcunha changed the title error login sqlserver set up multiple tables Jan 11, 2024
@MichalisDBA
Copy link

You can not add multiple tables yet. @osalvador said he had this on roadmap to-do.

You can use this as a workaround

#27 (comment)

@efcunha
Copy link
Author

efcunha commented Jan 15, 2024

ubuntu@ip-172-30-2-231:/opt/ReplicaDB/conf$ ./replicaDBMultipleTables.sh
Replicating dbo.MYSECURITY_PRIVACY_POLICY
2024-01-18 15:43:55,320 INFO ReplicaDB:63 Running ReplicaDB version: 0.15.1
2024-01-18 15:43:55,327 INFO ReplicaDB:66 Setting verbose mode DEBUG
2024-01-18 15:43:55,328 DEBUG ReplicaDB:67 ToolOptions{
sourceConnect='jdbc:sqlserver://segware-dev.cg120h1yldzn.us-east-1.rds.amazonaws.com:1433;database=SEGWARE_BOTTOM',
sourceUser='replicadb',
sourcePassword='',
sourceTable='dbo.MYSECURITY_PRIVACY_POLICY',
sourceColumns='null',
sourceWhere='null',
sourceQuery='null',
sinkConnect='jdbc:sqlserver://segware-web.cg120h1yldzn.us-east-1.rds.amazonaws.com:1433;database=SEGWARE_BOTTOM',
sinkUser='replicadb',
sinkPassword='
',
sinkTable='dbo.MYSECURITY_PRIVACY_POLICY',
sinkStagingTable='null',
sinkStagingSchema='dbo',
sinkStagingTableAlias='null',
sinkColumns='null',
sinkDisableEscape=false,
sinkDisableIndex=false,
sinkDisableTruncate=true,
sinkAnalyze=false,
jobs=1,
BandwidthThrottling=0,
quotedIdentifiers=false,
fetchSize=100,
help=false,
version=false,
verbose=DEBUG,
optionsFile='replicadb.conf',
mode='complete',
sentryDsn='https://400e0daa08c24a399b842048c409416f@o1002451.ingest.sentry.io/5962725',
sourceConnectionParams={},
sinkConnectionParams={},
sourceFileFormat='null',
sinkFileformat='null'}
2024-01-18 15:43:55,440 INFO Sentry:27 Sentry enabled
2024-01-18 15:43:55,497 INFO ReplicaTask:35 Starting TaskId-0
2024-01-18 15:43:56,457 INFO SqlManager:128 TaskId-0: Executing SQL statement: SELECT * FROM dbo.MYSECURITY_PRIVACY_POLICY where 0 = ?
2024-01-18 15:43:56,529 DEBUG SqlManager:133 TaskId-0: Using fetchSize for next query: 100
2024-01-18 15:43:56,550 INFO SqlManager:148 TaskId-0: With args: 0,
2024-01-18 15:43:56,620 DEBUG SQLServerManager:101 Performing BulkCopy into dbo.MYSECURITY_PRIVACY_POLICY
2024-01-18 15:43:56,628 ERROR SQLServerManager:113 Error while performing BulkCopy into dbo.MYSECURITY_PRIVACY_POLICY
com.microsoft.sqlserver.jdbc.SQLServerException: Unable to retrieve column metadata.
at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.getDestinationMetadata(SQLServerBulkCopy.java:1678) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.writeToServer(SQLServerBulkCopy.java:1573) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.writeResultSet(SQLServerBulkCopy.java:582) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.writeToServer(SQLServerBulkCopy.java:520) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at org.replicadb.manager.SQLServerManager.insertDataToTable(SQLServerManager.java:108) [ReplicaDB-0.15.1.jar:0.15.1]
at org.replicadb.ReplicaTask.call(ReplicaTask.java:65) [ReplicaDB-0.15.1.jar:0.15.1]
at org.replicadb.ReplicaTask.call(ReplicaTask.java:15) [ReplicaDB-0.15.1.jar:0.15.1]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_291]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_291]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_291]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_291]
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'dbo.MYSECURITY_PRIVACY_POLICY'.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1621) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:868) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:768) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7194) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2935) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:248) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:223) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQueryInternal(SQLServerStatement.java:700) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.getDestinationMetadata(SQLServerBulkCopy.java:1645) ~[mssql-jdbc-7.2.2.jre8.jar:?]
... 10 more
2024-01-18 15:43:56,636 ERROR ReplicaTask:69 ERROR in TaskId-0 inserting data to sink table: [Unable to retrieve column metadata., Invalid object name 'dbo.MYSECURITY_PRIVACY_POLICY'.]
2024-01-18 15:43:56,637 ERROR ReplicaDB:134 Got exception running ReplicaDB:
java.util.concurrent.ExecutionException: com.microsoft.sqlserver.jdbc.SQLServerException: Unable to retrieve column metadata.
at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_291]
at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_291]
at org.replicadb.ReplicaDB.processReplica(ReplicaDB.java:115) [ReplicaDB-0.15.1.jar:0.15.1]
at org.replicadb.ReplicaDB.main(ReplicaDB.java:47) [ReplicaDB-0.15.1.jar:0.15.1]
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Unable to retrieve column metadata.
at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.getDestinationMetadata(SQLServerBulkCopy.java:1678) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.writeToServer(SQLServerBulkCopy.java:1573) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.writeResultSet(SQLServerBulkCopy.java:582) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.writeToServer(SQLServerBulkCopy.java:520) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at org.replicadb.manager.SQLServerManager.insertDataToTable(SQLServerManager.java:108) ~[ReplicaDB-0.15.1.jar:0.15.1]
at org.replicadb.ReplicaTask.call(ReplicaTask.java:65) ~[ReplicaDB-0.15.1.jar:0.15.1]
at org.replicadb.ReplicaTask.call(ReplicaTask.java:15) ~[ReplicaDB-0.15.1.jar:0.15.1]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_291]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_291]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_291]
at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_291]
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'dbo.MYSECURITY_PRIVACY_POLICY'.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1621) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:868) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:768) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7194) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2935) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:248) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:223) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQueryInternal(SQLServerStatement.java:700) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.getDestinationMetadata(SQLServerBulkCopy.java:1645) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.writeToServer(SQLServerBulkCopy.java:1573) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.writeResultSet(SQLServerBulkCopy.java:582) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.writeToServer(SQLServerBulkCopy.java:520) ~[mssql-jdbc-7.2.2.jre8.jar:?]
at org.replicadb.manager.SQLServerManager.insertDataToTable(SQLServerManager.java:108) ~[ReplicaDB-0.15.1.jar:0.15.1]
at org.replicadb.ReplicaTask.call(ReplicaTask.java:65) ~[ReplicaDB-0.15.1.jar:0.15.1]
at org.replicadb.ReplicaTask.call(ReplicaTask.java:15) ~[ReplicaDB-0.15.1.jar:0.15.1]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_291]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_291]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_291]
at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_291]
2024-01-18 15:43:56,658 INFO ReplicaDB:54 Total process time: 1353ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants