Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3212362
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T14:49:50+00:00 2026-05-17T14:49:50+00:00

Consider the following scenerio…. I have a master user MASTER. I have a test

  • 0

Consider the following scenerio….

I have a master user MASTER.

I have a test user TEST.

For both users the table structure are same. Both user can be on different oracle servers.

then I create a database link as master_link by logging in as test user to sql plus using the following command

CREATE DATABASE LINK master_link CONNECT TO MASTER IDENTIFIED BY password USING (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST =192.168.9.139)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = orcl)))

By loggin in as test user and using the database link name i can modify the tables in master user. for example

update table1@master_link set display_title = ‘PONDS’ ;

This query updates the table table1 of master user.

My requirement is i want to give read only permission to database link (master_link) so that test user can’t modify or insert into any table in master user by using database link.

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T14:49:51+00:00Added an answer on May 17, 2026 at 2:49 pm

    On whatever database the MASTER schema resides, you would need to create a new user (i.e. MASTER_READ_ONLY). Grant the MASTER_READ_ONLY user SELECT access on all of MASTER’s tables (most likely via a role). Optionally, create either public synonyms or private synonyms in the MASTER_READ_ONLY schema that reference the objects in MASTER. Then, when you create the database link, use the MASTER_READ_ONLY account rather than the MASTER account.

    Something like

    As a 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;
    

    As 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;
    

    As 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;
    

    On the database where the TEST user has been 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)))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider following scenario: I have RESTful URL /articles that returns list of articles user
Consider the following scenario. I have a table (a stupid_table ) in a schema
Let's consider the following scenario: I've a master table with a detail table. The
Consider the following scenario . I have an array of numbers: [ 1,2,3,4 ]
Let's consider the following scenario: a function which can generate code colors from white
From couple of days i am thinking of a following scenario Consider I have
Consider the following scenario: class A<T> {} class B extends A<Integer> {} How can
Consider the following scenario. We have a C++ function with a static local variable:
Let's consider the following scenario. I have the following page where all rendered elements
consider the following scenario: I have a storyboard-based app. I add a ViewController object

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.