Home » SQL & PL/SQL » SQL & PL/SQL » find the dependencies of the table (oracle 9i and oracle 10g)
find the dependencies of the table [message #283980] Wed, 28 November 2007 09:11 Go to next message
skumar.dba
Messages: 82
Registered: October 2007
Member
Hi,

Is there anyway we can find the tables which has relation with a table.

in mysql we write the query as sp_dependent and give the the table name.but i am not sure in oracle.

Re: find the dependencies of the table [message #283988 is a reply to message #283980] Wed, 28 November 2007 09:24 Go to previous messageGo to next message
pablolee
Messages: 2836
Registered: May 2007
Location: Scotland
Senior Member
Use the USER|ALL_CONSTRAINTS and the USER|ALL_CONS_COLUMNS tables to see this info
Re: find the dependencies of the table [message #283991 is a reply to message #283980] Wed, 28 November 2007 09:27 Go to previous messageGo to next message
Mohammad Taj
Messages: 2412
Registered: September 2006
Location: Dubai, UAE
Senior Member

And if you want to know about object dependencies
SQL> select table_name from dict
  2  where table_name like '%DEPEN%';

TABLE_NAME
------------------------------
ALL_REFRESH_DEPENDENCIES
USER_DEPENDENCIES
ALL_DEPENDENCIES
DBA_DEPENDENCIES
V$OBJECT_DEPENDENCY
GV$OBJECT_DEPENDENCY

6 rows selected.

SQL> select name from v$fixed_table where name like 'V$%DEPEN%';

NAME
------------------------------
V$OBJECT_DEPENDENCY

Re: find the dependencies of the table [message #283999 is a reply to message #283991] Wed, 28 November 2007 10:02 Go to previous messageGo to next message
skumar.dba
Messages: 82
Registered: October 2007
Member
Thanks for reply.

for example let us take scott schema. here i have dept as master table. now i want to find what are all the tables related to "dept".

form which table i can query the data.
Re: find the dependencies of the table [message #284000 is a reply to message #283999] Wed, 28 November 2007 10:04 Go to previous message
pablolee
Messages: 2836
Registered: May 2007
Location: Scotland
Senior Member
This has already been answered.
Previous Topic: Putting Various Logic in a Query.
Next Topic: Sorting UNION results
Goto Forum:
  


Current Time: Sat Dec 10 12:40:18 CST 2016

Total time taken to generate the page: 0.07736 seconds