In any database where the MASTER schema is located, you will need to create a new user (i.e. MASTER_READ_ONLY). Grant access to SELECT user MASTER_READ_ONLY on all MASTER tables (most likely through a role). If desired, create either public synonyms or private synonyms in the MASTER_READ_ONLY schema that reference objects in MASTER. Then, when you create a link to the database, use the MASTER_READ_ONLY account, not the MASTER account.
Sort of
Like dba
CREATE USER master_read_only IDENTIFIED BY password2; GRANT create session, create synonym TO master_read_only; CREATE ROLE master_ro_role; GRANT master_ro_role TO master_read_only;
Like a MASTER
BEGIN FOR x IN (SELECT * FROM user_tables) LOOP EXECUTE IMMEDIATE 'GRANT SELECT ON master.' || x.table_name || ' TO master_ro_role'; END LOOP; END;
Like MASTER_READ_ONLY
BEGIN FOR x IN (SELECT * FROM all_tables WHERE owner='MASTER') LOOP EXECUTE IMMEDIATE 'CREATE SYNONYM ' || x.table_name || ' FOR master.' || x.table_name; END LOOP; END;
In the database where the TEST user was created
CREATE DATABASE LINK master_link CONNECT TO master_read_only IDENTIFIED BY password2 USING (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST =192.168.9.139) (PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = orcl)))
source share