views:

47

answers:

2

Or are there any oracle data dictionary to tell me which tables are being referenced in (materalised) views?

I wish to find out what tables references are used in a DML. I prefer to use an oracle package as it can be self contained in the database.

But other suggestions welcome. Open source very welcome.

Here is the link to the syntax diagram of the table_reference definition: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#i2126863

Do any parsers exist?

A: 

Use the data dictionary view dba_snapshots. It has the master column in it to say what is the master table used/referenced.

Venkataramesh Kommoju
A: 

Venkataramesh's answer (dba_snapshots) only provides part of the answer when the snapshots involve multiple tables and/or views - to get the full list of objects involved you can use the USER_DEPENDENCIES view:

select name, type, referenced_name, referenced_type
from user_dependencies
where type = 'MATERIALIZED VIEW'
order by name
dpbradley
dpbradley, Can referenced_owner column show if it's owned by a user from a different database host?
JavaRocky