Thursday, February 19, 2009

How to know dependent objects/which objects are dependent under an objects

From dba_dependencies/user_dependencies/all_dependencies view you can know about dependencies between procedures, packages, functions, package bodies, and triggers.
You can know the dependent objects of a procedure ERROR_CODE by following query.
On which objects an object depends
SQL> col OBJECT_NAME for a30
SQL> SELECT object_name, object_type, owner, status, last_ddl_time FROM
dba_objects WHERE ( object_name, object_type ) IN ( SELECT
referenced_name, referenced_type FROM dba_dependencies WHERE name =
'ERROR_CODE' );

OBJECT_NAME OBJECT_TYPE OWNER STATUS LAST_DDL_
------------------------------ ------------------- ------------------------------ ------- ---------
DUAL SYNONYM PUBLIC VALID 14-OCT-07
STANDARD PACKAGE SYS VALID 14-OCT-07
SYS_STUB_FOR_PURITY_ANALYSIS PACKAGE SYS VALID 14-OCT-07
DBMS_OUTPUT SYNONYM PUBLIC VALID 14-OCT-07
REGISTERED_PHONES TABLE MAXIM VALID 15-FEB-09
SUBSCRIBERS TABLE MAXIM VALID 20-JAN-09
FIRST_LEG_SQ SEQUENCE MAXIM VALID 20-JAN-09
ACCESS_NUMBER TABLE MAXIM VALID 20-JAN-09
BLACKLIST_CALLER TABLE MAXIM VALID 20-JAN-09
DO_NOT_DIAL TABLE MAXIM VALID 20-JAN-09
HISTORY TABLE MAXIM VALID 20-JAN-09
RATE_PLAN_M TABLE MAXIM VALID 08-FEB-09
CHECK_ABILITY FUNCTION MAXIM VALID 20-JAN-09
SIGNUP FUNCTION MAXIM VALID 20-JAN-09
FIRST_LEG_ACC TABLE MAXIM VALID 25-JAN-09

15 rows selected.

Which Objects are Dependent on an object
Also, you can know the which objects are dependent on an object by using,
SQL> SELECT object_name, object_type, owner, status, last_ddl_time FROM
dba_objects WHERE ( object_name,object_type) in(SELECT name, type from
dba_dependencies
WHERE referenced_name='SUBSCRIBERS');

OBJECT_NAME OBJECT_TYPE OWNER STATUS LAST_DDL_
------------------------------ ------------------- ------------------------------ ------- ---------
AUTH_ERROR_CODE FUNCTION MAXIM VALID 25-JAN-09
CALRATE FUNCTION MAXIM VALID 01-FEB-09
CALRATEDUMMY FUNCTION MAXIM VALID 20-JAN-09
CALRATEDUMMY_800 FUNCTION MAXIM VALID 20-JAN-09
CALRATE_800 FUNCTION MAXIM VALID 20-JAN-09
CHECK_ABILITY FUNCTION MAXIM VALID 20-JAN-09
CHECK_ABILITY_800 FUNCTION MAXIM VALID 20-JAN-09
CREDIT_AMT_OR_TIME FUNCTION MAXIM VALID 20-JAN-09
GETCOUNTRYNAME FUNCTION MAXIM VALID 20-JAN-09
SIGNUP FUNCTION MAXIM VALID 20-JAN-09
SIGNUP_800 FUNCTION MAXIM VALID 08-FEB-09
MAP_TO_SPEEDDIAL PROCEDURE MAXIM VALID 20-JAN-09
UPDATE_USER_STATUS TRIGGER MAXIM VALID 19-FEB-09
UPDATE_HISTORY_FOR_REFUND TRIGGER MAXIM VALID 20-JAN-09
INSERT_HISTORY_DETAIL TRIGGER MAXIM VALID 20-JAN-09
DELETE_SUBSCRIBERS TRIGGER MAXIM VALID 20-JAN-09

16 rows selected.
Related Documents
http://arjudba.blogspot.com/2009/12/oracle-object-type-exercises-varray.html
http://arjudba.blogspot.com/2009/12/practice-oracle-joins-examples.html
http://arjudba.blogspot.com/2009/12/oracle-security-practices.html
http://arjudba.blogspot.com/2009/12/exercises-with-oracle-create-table-add.html
http://arjudba.blogspot.com/2009/12/oracle-database-creation-exercises.html
http://arjudba.blogspot.com/2009/12/basic-oracle-sql-exercise.html
http://arjudba.blogspot.com/2009/08/format-model-modifiers-fx-and-fm.html
http://arjudba.blogspot.com/2009/08/number-format-models-in-oracle.html
http://arjudba.blogspot.com/2009/08/format-models-in-oracle.html
http://arjudba.blogspot.com/2009/07/sql-decode.html
http://arjudba.blogspot.com/2009/07/how-to-know-row-of-table-belong-to.html
http://arjudba.blogspot.com/2009/06/how-to-know-which-objects-are-being.html
http://arjudba.blogspot.com/2009/06/ddl-with-wait-option-in-11g.html
http://arjudba.blogspot.com/2009/06/ora-00939-too-many-arguments-when-case.html
http://arjudba.blogspot.com/2009/03/oracle-datatype-internal-code.html
http://arjudba.blogspot.com/2009/03/how-to-know-list-of-constraints-and.html
http://arjudba.blogspot.com/2009/02/how-to-know-dependent-objectswhich.html
http://arjudba.blogspot.com/2009/02/how-to-search-stringkey-value-from.html
http://arjudba.blogspot.com/2009/02/how-to-know-when-tableobjects-ddlcode.html
http://arjudba.blogspot.com/2009/02/ora-00920-invalid-relational-operator.html
http://arjudba.blogspot.com/2009/01/adding-default-value-to-column-on-table.html
http://arjudba.blogspot.com/2009/01/ora-12838-cannot-readmodify-object.html
http://arjudba.blogspot.com/2009/01/ora-01779-cannot-modify-column-which.html
http://arjudba.blogspot.com/2009/01/updating-table-based-on-another-table.html
http://arjudba.blogspot.com/2009/01/ora-00054-resource-busy-and-acquire.html
http://arjudba.blogspot.com/2008/12/troubleshoot-ora-02292-ora-02449-and.html

2 comments:

  1. Train yourself in specific software modules to brush up your skills & shine in your career growth with the
    best software training institute in Chennai
    , Infycle Technologies. Infycle offers the excellent Data Science training in Chennai to serve the candidate's job profile requirements, including the top job placements in the MNC's. Rather than just teaching the theories, our fundamental aim is to make you a master by giving you live hands-on training. Therefore, individuals will be asked to work on the live tasks & real-time use cases that bring out the definite coder in you! To grab all these, call 7504633633 for a free demo.

    ReplyDelete
  2. Don’t follow your role model. Be the Role model person for others. But it's so simple by getting Hadoop training in Chennai. Because it is an assurance course to bounce back from a double salary. For joining call 7502633633.

    ReplyDelete