We are migrating from 11g to 19c version. But we want to test if we can trasnfer a specific column from 11g to 19c upon insert.
Is there a possible way to connect Oracle11g and Oracle19c databases?
The scenario is Oracle11g Table1 transfer specific columns of data to Oracle19c Table2. Same column structure for both tables.
For example:
FROM
Oracle11g
PRODUCT
Product_name | product_description |
---|---|
Bolt | Metal |
Ziptie | Plastic |
SUPPLIER
Product_name | Supplier |
---|---|
Bolt | Home Depot |
Ziptie | Plastic |
TO
Oracle19c
PRODUCT WAREHOUSE
Product_name | product_description | Supplier |
---|---|---|
Bolt | metal | Home Depot |
Ziptie | plastic | Home Depot |
Yes, you can create a database link:
Documentation: https://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_5005.htm
Source: DB 11g
Target: DB 19c
So:
1 - On the source you need ro create a user to dblink connection.
2 - On the target you need to create an entry in tnsnames.ora
pointing to rhe 11g connection.
3 - On target 19c create dblink pointing to 11g database:
CREATE DATABASE LINK oracle11g_link CONNECT TO username IDENTIFIED BY password USING 'oracle11g_tns_entry';
4 - Insert Data using dblink:
CREATE TABLE test AS
SELECT *
FROM PRODUCT@oracle11g_link;
OR
You can use Datapump to export/import the data:
On source:
#If you choose export entire schema:
expdp \"/ as sysdba\" schemas=SCHEMANAME dumpfile=test.dmp
#If you choose export just one or more tables:
expdp \"/ as sysdba\" tables=SCHEMANAME.TABLENAME dumpfile=test.dmp
Wait export complete and copy the dumpfile to targer server (19c):
On Target:
impdp \"/ as sysdba\" dumpfile=test.dmp