How can you create an Oracle view that reads data from two schemas in two different instances?
We know how to do this with two schemas in the same instance:
CREATE VIEW MYVIEW AS
SELECT X,Y,Z FROM A.MYTABLE
UNION
SELECT X,Y,Z FROM B.MYTABLE
But what if schemas A
and B
are in different Oracle instances?
You could create a database link: http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/ds_concepts002.htm#ADMIN12092 and then do
CREATE VIEW MYVIEW AS
SELECT X,Y,Z FROM A.MYTABLE
UNION
SELECT X,Y,Z FROM B.MYTABLE@<LinkName>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With