title: Same DBLink name used in Different Schemas of same Database - Invalidates the Procs
body: <p>I have "PROD-1" db which contains 2 schemas "Schema-1", "Schema-2"
  I created the private dblink "DBLINK-1" in both the schemas &amp; they are pointing to different targets.
  here is my configuration</p>
  
  <p>DB Name -> Source Schema -> Target DB -> Target Schema  -> Dblink Name <br></p>
  
  <p>PROD-1    ->   Schema-1   ->    TPRD-1   ->    TSchema-1  ->      DBLINK-1 <br></p>
  
  <p>PROD-1    ->   Schema-2   ->    TPRD-2   ->    TSchema-2   ->     DBLINK-1 <br></p>
  
  <p>I am using this dblink in procedure and deployed in both Schema-1 &amp; Schema-2
  when I compile the proc in Schema-1 it is invalidating Schema-2 proc &amp; vice versa. 
  here is the sample proc</p>
  
  <pre><code>CREATE OR REPLACE procedure test_dblink
  </code></pre>
  
  <p><code>is</code>
     <code>v_cnt number;</code></p>
  
  <pre><code>begin
     select count(*) into v_cnt from DUAL@DBLINK-1;
  </code></pre>
  
  <p><code>end;</code>   </p>
  
  <p>as per my understanding, DBLINK-1 is a private dblink for the Schema-1 &amp; Schema-2; therefore it should not conflict with each other. however, when I executed the procedures at the same time in both schemas, one procedure exectued successfully &amp; other one was waiting for first one to complete then complete. <br></p>
  
  <p>this is what may be happening <br></p>
  
  <ol>
  <li>Schema-1 proc started first and Proc status is Valid. Schema-2 proc was waiting</li>
  <li>Schema-1 proc completed now. Schema-2 proc came out of wait mode &amp; invalidated the DBLink-1 in Schema-1. therefore Schema-1 proc is now Invalid status</li>
  <li>Schema-2 proc run and complete. Schema-2 proc is Valid now</li>
  </ol>
  
  <p>My question is, how can I manage the same DBLink in two different schema of same DB without this conflict?</p>
  
  <p>Appreciate you help</p>