简体   繁体   中英

Oracle foreign data wrapper

I have master-slave architecture. On the slave I have an Oracle database with two schemas, eg TEST1 and TEST2 .

I have all objects (eg EMPLOYEES ) stored in schema TEST1 , and user TEST1 (or admin) has given read only privileges on TEST1.EMPLOYEES to TEST2 , so when I use TEST1.EMPLOYEES in a query on the Oracle database I can access its data.

How can I implement the same using Oracle foreign data wrapper in postgres 9.5 because I have credentials for TEST2 and not TEST1 ? When I try to access the foreign table it give an error saying that TEST2.EMPLOYEES does not exist.

如果您使用用户TEST2的凭据定义用户映射,并使用schema选项定义外部表,则可以轻松做到这一点,即

CREATE FOREIGN TABLE ... OPTIONS (schema 'TEST1', table 'EMPLOYEES');

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