I need to query data from one oracle database table and insert into another table in a different database, In the sense assume there are two databases called A and B. A has a_table and B has b_table. I need to query some records from a_table and insert into b_table. Is there any way to done in oracle db with out any third party script or program. Also this should be run automatically (may be twice a hour or if some data inserted into a_table)
1 Answer
You can create a Database Link between two Oracle Databases, which will allow you to do what you're describing.
For example if you have a database link called "qa_link" you could do something like this:
insert into test_table@qa_link
(select column_names from local_table);
This database link could also be referenced in a trigger on the table with the data you want to copy, so it could happen in real time if you would prefer that to batching every couple of hours.