Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: tables with no synonyms

RE: tables with no synonyms

From: Jacques Kilchoer <Jacques.Kilchoer_at_quest.com>
Date: Wed, 7 Feb 2007 14:17:31 -0800
Message-ID: <22EC50E60931494FA666A8CF8260C45B5D9C08@ALVMBXW05.prod.quest.corp>


Along with the several good answers to this thread, I'll point out a couple of "gotchas": The subject of the e-mail says "tables" but the original query was linking to DBA objects. The first question is: you are looking for missing synonyms for which object types? Synonyms for views, tables, sequences, procedures, functions, packages, materialized views? Second question is: are the synonyms supposed to have the same names as the objects they are pointing to?  

See the comment lines in this query:  

column object_name format a30
select

   a.owner, a.object_name, a.object_type  from
   dba_objects a
 where
   a.owner = '&BASE_OBJECT_SCHEMA'

De : oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] De la part de Nigel Thomas Envoyé : mercredi, 7. février 2007 12:56 À : oracle-l
Objet : Fw: tables with no synonyms

>How can this query to find objects ( owned by User A) that have no
>private synonyms (for User B) be improved upon
 

Joe  

Assuming I've understood the question correctly, you can just take the objects (including program units) that are owned by user A, and subtract (MINUS) the synonyms owned by B that reference those objects in A.  

select object_name, owner from dba_objects where owner = 'A' minus
select table_name,table_owner from dba_synonyms where owner = 'B' /  

Regards Nigel  

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Feb 07 2007 - 16:17:31 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US