I have configured SQL Replication between two our two IBM DB2 databases ( database A and database B). The replication is working fine and all the data changes in one database are being replicated to the other database.
The issue I am facing is that if I add a new table in database A, then I have to manually add this table in Capture Control Server and Apply Control Server.
Even If I add a new column in a table for whom SQL Replication is already configured, I have to register that column in Capture Control Server and Apply Control Server.
Is there any way of replicating the schema changes automatically from one database to the other so that we don't have to manually add the new tables and columns in Capture Control Server and Apply Control Server for SQL Replication?
Regards,
Babar Hussain
Related
I have several postgres databases which need to be replicated as-is to a single aws redshift.
We have currently set up DMS services to the same. However, we keep encountering issues such as source database full, large column issues and most importantly the issue in DMS when new columns with defaults are added on postgres databases(This does not replicate with ongoing replication)
So, are there any other ways that we can set up this ongoing replication?
I have two DB instances with postgresql 10.
First instance working with wal_level = logical, have ALL TABLE publisher. Second - have subscription to the publisher, described above.
All data from the Master DB tables are successfully sending to the replica.
There is only one issue for me - when my App add a new table on Master - I need to add the same table to the replica (and run REFRESH PUBLICATION).
My question - is there a way for replica DB to create new tables automatically?
Schema changes aren't replicated. You can see that in the documentation, at Postgresql 10 Logical Replication: Subscription
The way I handle this is to make all schema changes through a script, and to write the script so that it executes the change commands twice: once on the primary database, and once on the replica.
I am trying to setup a CDC in Talend on an Oracle database. I am following the steps as listed here: https://www.talendforge.org/tutorials/tutorial.php?language=english&idTuto=42
However, when i try to establish the CDC in the main DB conneciton, i get a message saying "Database information must be filled to use the cdc!" and the Create Subscriber button is disabled.
What could I be doing differently? I have created two connections pointing to the same database, and have also retrieved the table schema in my main connection.
I have two databases on Amazon RDS, both Postgres. Database 1 and 2
I need to restore an instance from a snapshot of Database 1 for my Staging environment. (Database 2 is my current Staging DB).
However, I want the data from a few of the tables in Database 2 to overwrite the tables in the newly restored snapshot. What is the best way to do this?
When restoring RDS from a Snapshot, a new database instance is created. If you only wish to copy a portion of the snapshot:
Restore the snapshot to a new (temporary) database
Connect to the new database and dump the desired tables using pg_dump
Connect to your staging server and restore the tables using pg_restore (most probably deleting any matching existing tables first)
Delete the temporary database
pg_dump actually outputs SQL commands that are then used to recreate tables and restore data. Look at the content of a dump to understand how the restore process actually works.
I hope this still works for someone else.
With my team we faced a similar issue. We also had 2 Postgres databases and we also just needed to backup some tables from db1 to db2.
What we did is to use a lambda function using Python (from AWS lambda ofc) that connected to both databases and validates if db1.table1 has the same data as db2.table1, if not, then the lambda function should write the missing data from db1.table1 into db2.table1. The approach of using lambda was because we wanted to automate the process due to the main db (let's say db1) is constantly being updated. In addition, it allowed us to only backup our desired tables (let's say 3 tables out of 10), instead of backing up the whole database.
Note: Maybe you want to do these writes using temporary tables to avoid issues with any constraints you have in your tables.
How do I create control tables in DB2 UDB for setting up new replication
The DB2 Replication Center has a GUI that will guide you through the process. You can use it to define every aspect of your replication scenario and generate the appropriate DDL scripts for your control tables. Here is a brief description: http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.swg.im.iis.db.repl.intro.doc/topics/iiyrcintraidp.html