ORACLE DATABASE SYNCING - database

I have a local and remote oracle database table. The remote table is updated whenever new user(s) is registered. Now I am using a java scheduler to query the remote database every 30 minutes and updating the newly added values in my local table. It will be really good if both these tables are in sync that is, if a new entry is added to the remote table then it should be reflected in my local table also. Can anyone suggest a efficient way to achieve this ?

Try:
to create a database link between the local and the remote database
to create a materialized view to replicate the remote table to the local table.
See https://oracle-base.com/articles/misc/materialized-views

Related

New tables broke postgres replication + schema is not copying when subscribing to master DB

I followed digital ocean guide to make my server as master database and my local as secondary databse.
There two problems I see
I can not subscribe to master database if same schema is not present in my local database
For temporary purpose I cloned the schema then subscription worked!!
I got all data and even updating any column reflects in local db as well.
I created new table in master database it stopped replication, not new table copied and new updates to existing data is also not working
I need help in these two issues.

SQL Server table daily sync of records from table A to table B

I want to create a daily process where I reload all rows from table A into table B. Over time table A rows will change due to changes in source system and also because of aging/deletion of records in the origin table. Table A gets truncated/reloaded daily in step 1. Table B is the master table that just gets new/updated rows.
From a historical point of view, I want to keep track of ALL the rows in table B and be able to do a point in time comparison for analytics purposes.
So I need to do two things, Daily insert rows from table A to table B if they don't exist and then also create a new record in Table B if the record already exists but ANY of the columns have changed. At one point I attempted to use temporal tables but I had too many false/positives on 'real' changes, basically certain columns were throwing off things because a date/time column was updated(only real change in row).
I'm using a Azure SQL Server Managed Instance database (Microsoft SQL Azure (RTM) - 12.0.2000.8).
At my disposal I have SSMS, SQL Server and also Azure Data Factory.
Any suggestions on the best way to do this or tools to help with this?
There are 2 concepts out of which you can implement any one.
Temporal table
Capture Data Change (CDC)
As CDC is the commonly used approach in which you can create an Azure data factory with a pipeline that loads delta data based on change data capture (CDC) information in the source Azure SQL Managed Instance database to an Azure blob storage.
To implement the CDC, you can you can follow this simple Microsoft tutorial Incrementally load data from Azure SQL Managed Instance to Azure Storage using change data capture (CDC)
Note: You also need to Create a storage account which is required but not given in above tutorial.

best way to syncronize 2 databases

I have 1 database sql on the Microsoft CRM and 1 remote local database sql. They have different schemas.
I must maintain both syncronized (2-way sync).
They can't communicate directly. So in the middle there is a rest service and a temporary database.
So, everytime there is an insert or an update on one of the database, the insert or the update is propagated to temporary database and from temporary database to the destination db.
I don't know how to manage conflicts. For example, in both db I have the table PERSON. In a database I update the name, in the other I update the birthday. How can I sync both db without lose both updates?
Thank you

Making backup from database to another server

I have a host on a server and that contains an SQL Server Database.
I have another server in another country and i want have a backup from the database every 5 minutes or after each transaction only insert new row to another database.
After some research i found out i can use linkedservers for this goal.
Is this procedure works for me for doing this operation?
I don't know what the linkedserver will do for you.
You are connected from both server via a vpn?
You are in different network (domain) probably?
If you are using a linked server, it means you will probably create trigger or stored proc. You will have to configure msdtc (for trigger).
You can use :
Replication
Log shipping
Custom replication process
I had to configure 2 times a replications to move the data from a server to another, than manage these data with trigger. It was easier to work on the data localy

Updating the local database from a remote database

I have a local database used for development and testing purpose and one remote database in the live environment. Both are in Oracle. The local database contains the same table structure and all with old data. I need to update the local database with the data from the remote database. (I tried exp/imp. But it is showing an error like Object already exists). Can anyone please help me to figure out what may be the problem or what is the best method to do this?
You'll need to drop your local tables first. exp/imp does not remove existing tables or data before importing, if I recall.

Resources