title: Granting access to tables from a database link to a local database
body: <p>I'm currently in the middle of a project that requires me to write a SQL script for creating a local database. In my code, I've created a database link to our development database I've created the users needed. In order for me to pass all unit test, I need to provide access to the specific tables needed from my database link. When I run all unit test, the only errors being thrown are 'ORA-00942: table or view does not exist'. How can I grant access to these tables for the user xxltbpg from the local database link?</p>
  
  <p>Here's the code that I have written so far:</p>
  
  <pre><code>--Drop Database--
  drop database link DEV_LINK;
  
  --Create database link--
  
  create database link DEV_LINK
    connect to user
    identified by pass
    using '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = usnodev) (PORT = 1531))(CONNECT_DATA = (SID = DEV))) '; 
  
  --Create Users for LWS-
  
  CREATE USER xxlt IDENTIFIED BY user;
  
  --Create Users for BPG--
  
  CREATE USER xxltbpg IDENTIFIED BY user;
  GRANT CREATE SESSION TO xxltbpg;
  --Grant access to tables from local database--
  </code></pre>