简体   繁体   中英

Copying data of one database to another in Oracle

I am using Oracle database but open to use other database so tagging all of them.

I am designing one system in which I have to inject all the data of existing database table into new database and whatever changes happens in existing database should reflect in new database on daily basis. My approach is.

I will copy all the data of existing database to new database . Then I will create a trigger which will record all the changes in the table and store in another table(all the DML operations) .

Once in a day my API will read the data generated by trigger and copy into new system. I don't need live data so I will schedule job only once in a day to copy data into new database

is this the proper approach? any suggestions?

Common practice would be to back up your primary instance and restore it on the secondary once a day.

You could schedule the backup and restore in sequence as a daily jobs.

If your copy database is Sql server, then I suggested you use LinkedServer . Based on the documentation:

Linked servers enable you to implement distributed databases that can fetch and update data in other databases. They are a good solution in the scenarios where you need to implement database sharding without need to create a custom application code or directly load from remote data sources. Linked servers offer the following advantages:

The ability to access data from outside of SQL Server.

The ability to issue distributed queries, updates, commands, and transactions on heterogeneous data sources across the enterprise.

The ability to address diverse data sources similarly.

You can find more information based on the documentation.

Visit https://docs.microsoft.com/en-us/sql/relational-databases/linked-servers/linked-servers-database-engine?view=sql-server-ver15

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM