All_dependencies

If I want to know mytable is used in a select or insert everywhere across the database,
I do not have access to dba_dependencies, Is the below correct ?
I just need to know the dependent objects for mytable
select name||'-->'||owner||'-->'||type||'-->'||REFERENCED_NAME||'-->'||REFERENCED_TYPE||
'-->'||REFERENCED_OWNER
from all_dependencies
where lower(NAME) like LOWER('%mytable%')
and owner not in ('SYS','SYSTEM')
order by name

>
If I want to know mytable is used in a select or insert everywhere across the database,
I do not have access to dba_dependencies, Is the below correct ?
I just need to know the dependent objects for mytable
select name||'-->'||owner||'-->'||type||'-->'||REFERENCED_NAME||'-->'||REFERENCED_TYPE||
'-->'||REFERENCED_OWNER
from all_dependencies
where lower(NAME) like LOWER('%mytable%')
and owner not in ('SYS','SYSTEM')
order by name
>
Add a predicate 'and type = 'TABLE' if you only care about a table.
And I suggest you start by just querying the view itself until you know you are getting the data you want. Then you can start concatenating everything together if you need to.
Your query produces such a jumbled set of data it's hard to tell if it has the info you need. Start with
select * from all_dependencies
where lower(NAME) like LOWER('%employees%')
and owner not in ('SYS','SYSTEM')
and type = 'TABLE'
order by name

Similar Messages

  • ALL_DEPENDENCIES isn't updated well

    Hi all,
    may be i found an oracle error.
    SQL> select * from ALL_DEPENDENCIES  where name = 'EMP';
    OWNER  NAME TYPE    REFERENCED_OWNER               REFERENC REFERENCE REFERENC DEPENDEN
    PUBLIC EMP  SYNONYM HR                             EMP_PKG  PACKAGE            HARDso this tell me that the type is a SYNONYM, while the following
    SQL> select object_name,object_type from user_objects where object_name='EMP';
    OBJECT_NAME OBJECT_TYPE
    EMP         TABLEtell me that this is a table and that is true, is this an oracle bug?
    Thanks so much
    Francesco

    unfortunately there is no any reference in the pkg EMP_PKG
    CREATE OR REPLACE PACKAGE BODY EMP_PKG IS
      TYPE BOOL_TABTYPE IS TABLE OF BOOLEAN INDEX BY BINARY_INTEGER;
      VALID_DEPARTMENTS BOOL_TABTYPE;
      EMP_TABLE         EMP_TABTYPE;
      FUNCTION VALID_DEPTID(DEPTID IN DEPARTMENTS.DEPARTMENT_ID%TYPE) RETURN BOOLEAN IS
        DUMMY PLS_INTEGER;
      BEGIN
        SELECT 1
        INTO   DUMMY
        FROM   DEPARTMENTS
        WHERE  DEPARTMENT_ID = DEPTID;
        RETURN TRUE;
      EXCEPTION
        WHEN NO_DATA_FOUND THEN
          RETURN FALSE;
      END VALID_DEPTID;
      PROCEDURE ADD_EMPLOYEE(FIRST_NAME EMPLOYEES.FIRST_NAME%TYPE
                            ,LAST_NAME  EMPLOYEES.LAST_NAME%TYPE
                            ,EMAIL      EMPLOYEES.EMAIL%TYPE
                            ,JOB        EMPLOYEES.JOB_ID%TYPE DEFAULT 'SA_REP'
                            ,MGR        EMPLOYEES.MANAGER_ID%TYPE DEFAULT 145
                            ,SAL        EMPLOYEES.SALARY%TYPE DEFAULT 1000
                            ,COMM       EMPLOYEES.COMMISSION_PCT%TYPE DEFAULT 0
                            ,DEPTID     EMPLOYEES.DEPARTMENT_ID%TYPE DEFAULT 30) IS
        PROCEDURE AUDIT_NEWEMP IS
          PRAGMA AUTONOMOUS_TRANSACTION;
          USER_ID VARCHAR2(30) := USER;
        BEGIN
          INSERT INTO LOG_NEWEMP
            (ENTRY_ID
            ,USER_ID
            ,LOG_TIME
            ,NAME)
          VALUES
            (LOG_NEWEMP_SEQ.NEXTVAL
            ,USER_ID
            ,SYSDATE
            ,FIRST_NAME || ' ' || LAST_NAME);
          COMMIT;
        END;
      BEGIN
        IF VALID_DEPTID(DEPTID) THEN
          AUDIT_NEWEMP;
          INSERT INTO EMPLOYEES
            (EMPLOYEE_ID
            ,FIRST_NAME
            ,LAST_NAME
            ,EMAIL
            ,JOB_ID
            ,MANAGER_ID
            ,HIRE_DATE
            ,SALARY
            ,COMMISSION_PCT
            ,DEPARTMENT_ID)
          VALUES
            (EMPLOYEES_SEQ.NEXTVAL
            ,FIRST_NAME
            ,LAST_NAME
            ,EMAIL
            ,JOB
            ,MGR
            ,TRUNC(SYSDATE)
            ,SAL
            ,COMM
            ,DEPTID);
        ELSE
          RAISE_APPLICATION_ERROR(-20204, 'Invalid department id, try again ');
        END IF;
      END ADD_EMPLOYEE;
      PROCEDURE GET_EMPLOYEE(EMPID IN EMPLOYEES.EMPLOYEE_ID%TYPE
                            ,SAL   OUT EMPLOYEES.SALARY%TYPE
                            ,JOB   OUT EMPLOYEES.JOB_ID%TYPE) IS
      BEGIN
        SELECT SALARY
              ,JOB_ID
        INTO   SAL
              ,JOB
        FROM   EMPLOYEES
        WHERE  EMPLOYEE_ID = EMPID;
      END;
      PROCEDURE ADD_EMPLOYEE(FIRST_NAME EMPLOYEES.FIRST_NAME%TYPE
                            ,LAST_NAME  EMPLOYEES.LAST_NAME%TYPE
                            ,DEPTID     EMPLOYEES.DEPARTMENT_ID%TYPE DEFAULT 30) IS
        EMAIL EMPLOYEES.EMAIL%TYPE;
      BEGIN
        EMAIL := UPPER(SUBSTR(FIRST_NAME, 1, 1) || SUBSTR(LAST_NAME, 1, 7));
        ADD_EMPLOYEE(FIRST_NAME, LAST_NAME, EMAIL, DEPTID => DEPTID);
      END;
      PROCEDURE INIT_DEPARTMENS IS
      BEGIN
        FOR REC IN (SELECT DEPARTMENT_ID
                    FROM   DEPARTMENTS)
        LOOP
          VALID_DEPARTMENTS(REC.DEPARTMENT_ID) := TRUE;
        END LOOP;
      END;
      PROCEDURE PRINT_EMPLOYEES(EMPREC EMPLOYEES%ROWTYPE) IS
      BEGIN
        DBMS_OUTPUT.PUT_LINE(EMPREC.DEPARTMENT_ID || ' ' || EMPREC.EMPLOYEE_ID || ' ' || EMPREC.LAST_NAME);
      END;
      PROCEDURE GET_EMPLOYEE(DEPTID IN EMPLOYEES.DEPARTMENT_ID%TYPE) IS
      BEGIN
        SELECT * BULK COLLECT
        INTO   EMP_TABLE
        FROM   EMPLOYEES
        WHERE  DEPARTMENT_ID = DEPTID;
      END GET_EMPLOYEE;
      PROCEDURE SHOW_EMPLOYEES IS
        I NUMBER;
      BEGIN
        FOR I IN EMP_TABLE.FIRST .. EMP_TABLE.LAST
        LOOP
          PRINT_EMPLOYEES(EMP_TABLE(I));
        END LOOP;
         I := EMP_TABLE.COUNT;
         WHILE I IS NOT NULL
         LOOP
           PRINT_EMPLOYEES(EMP_TABLE(I));
           I := EMP_TABLE.NEXT(I);
         END LOOP;
      END;
      PROCEDURE SET_SALARY(ID_JOB         VARCHAR2
                          ,NEW_MIN_SALARY NUMBER) IS
      BEGIN
        UPDATE EMPLOYEES
        SET    SALARY = NEW_MIN_SALARY
        WHERE  JOB_ID = ID_JOB;
      END;
    BEGIN
      INIT_DEPARTMENS;
    END EMP_PKG;

  • How to get the List of Database Objects (Table/View) for a given APEX Page.

    Hi,
    I have an application and that consist of pages like page1,2,3,.....
    *1.* I want a report which can give me the list of all the Pages1,2,3,....
    I am using the following query to acheive this.... THIS IS FINE..
    select a.workspace, a.owner, a.application_name, b.page_id, b.page_name
      from apex_applications a,
           apex_application_pages b
    where a.workspace = b.workspace
       and a.application_id = b.application_id*2. Now, I want for each individual page*, the list all the database objects (tables/views), which that page is using.
    I am using ALL_DEPENDENCIES , but I am not getting the result.
    So, want to know if there any view/table, where I can get the Application Pages & there database object list...
    Thanks,
    Deepak

    Hari,
    Thanks for the response.
    The view APEX_APPLICATION_PAGE_DB_ITEMS will only give me the table name related to any Page Items defined to that page..It will not give me all the database objects..
    suppose we have a Page, having a report based on multiple tables and there is no Page items defined on that page, we will not have any value in this ....DB_ITEMS table. same thing if we have define some PL|SQL(using some table/view) in a Process, that will not be populated in .....DB_ITEMS table. I want some thing like all the database objects (table/views/function/procedure/.....) for a particular Page ID.
    Thanks,
    Deepak

  • Question on Synonyms and Implicit Cursor

    Hi,
    I've two doubts.
    Question1:
    Why Oracle is allowing me to create a synonym even base object does not exist in database.
    For example in below example user ABC and object def doesnt exist in my database. Why I didnt get any error while creating a synonym.
    Connected to Oracle Database 11g Express Edition Release 11.2.0.2.0
    Connected as hr
    SQL> CREATE SYNONYM test_syn FOR ABC.def;
    Synonym created
    SQL> Question2:
    In PL/SQL after closing the cursor if we use any cursor attribute it will throw exception like invalid cursor. Why it is not happening in case of implicit cursor.
    Or
    Does Oracle close implicit cursor(SQL) ?
    declare
    begin
      UPDATE emp
      SET ename = 'SURI';
    COMMIT;
    dbms_output.put_line(SQL%rowcount);
    end;Many thanks for all your help.
    Cheers,
    Suri

    Suri wrote:
    Hi,
    I've two doubts.
    Question1:
    Why Oracle is allowing me to create a synonym even base object does not exist in database.
    For example in below example user ABC and object def doesnt exist in my database. Why I didnt get any error while creating a synonym.If you look in the all_dependencies view you will see that it's created as "NON-EXISTENT", so oracle knows it's non existent, it just doesn't treat it as an error.
    As it says in the documentation:
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_7001.htm#SQLRF01401
    A dependency is created and if the target object is changed or dropped etc. the synonym becomes invalid... but that doesn't mean it cannot exist.
    Question2:
    In PL/SQL after closing the cursor if we use any cursor attribute it will throw exception like invalid cursor. Why it is not happening in case of implicit cursor.Would you care to demonstrate what you mean with some code.

  • How to find out the Referenced objects ?

    Hi all,
    I want to find out the referenced objects
    Example : Table Name is Customer
    I want to know what are the procedures,functions,packages used that customer table. Please provide that sql Query.
    Thanks and Regards

    If this is not what you want, please give us a test case with input and expected output:
    SQL>
    SQL> drop table cust;
    Table dropped.
    SQL> drop procedure proc1;
    Procedure dropped.
    SQL> drop procedure proc2;
    Procedure dropped.
    SQL> drop procedure proc3;
    Procedure dropped.
    SQL>
    SQL> create table cust(x int);
    Table created.
    SQL>
    SQL> create procedure proc1
      2  is
      3  begin
      4  update cust set x = x + 1;
      5  end;
      6  /
    Procedure created.
    SQL> show errors
    No errors.
    SQL>
    SQL> create procedure proc2
      2  is
      3  begin
      4  delete cust;
      5  end;
      6  /
    Procedure created.
    SQL> show errors
    No errors.
    SQL>
    SQL> create procedure proc3
      2  is
      3  begin
      4  insert into cust values(0);
      5  end;
      6  /
    Procedure created.
    SQL> show errors
    No errors.
    SQL>
    SQL> select name, type
      2  from all_dependencies
      3  where
      4  type ='PROCEDURE'
      5  and referenced_name = 'CUST'
      6  and referenced_type = 'TABLE';
    NAME                           TYPE                                            
    PROC1                          PROCEDURE                                       
    PROC2                          PROCEDURE                                       
    PROC3                          PROCEDURE                                       
    SQL> exit

  • Table used in view

    Hi all,
    How can i get tables uses uinformation in view as hiererchy order.
    example.
    Table name : Employee
    I want to know in which view this table is using and also other view name which is using earlier view too.
    Example
    1. view A is created on table Employee
    2. View B is created on view A
    3. View C is created on View B .
    output should be
    view affected for employee table
    A
    B
    C
    Thanks in advance
    Tnaks & regards
    Deb

    debasishghosh wrote:
    Can you please send me the querySELECT [column list] FROM ALL_DEPENDENCIES;
    What to put in [column list] is left as an exercise for the student. Clues can be found be reading the very good description of ALL_DEPENDENCIES in the fine Reference Manual.
    =================================================
    I don't want to be flippant or rude, but if people want to be professionals in ANY field, the first knowledge they need to acquire is how to locate AND USE+ the fundamental reference materials for that profession. And the most important trait, the one for which they are really hired, is the ability to do independent research, and having a modicum of curiosity that would drive one to do that research. We don't mind helping newbies, and even the most experienced person on this board will run into something they are not familiar with, or occasionally just require a second set of eyes to look at something. But a professional+ needs, above all, a willingness and capability to check the docs. A professional isn't necessarily someone who has all the answers at their fingertips or has a full understanding about every arcane subject in their field. It certainly isn't someone who has an encyclopedia full of memorized answers but little understanding of how it all fits together. It's someone who knows where to find the answers when needed, how to recognize them when he sees them. It's less about knowing than it is about attitude. Everything you asked can be answered in the Oracle Concepts Manual at tahiti.oracle.com. You should bookmark that site. You were told the name of the view that has the information you seek. It is not an unreasonable assumption that anyone who comes to this forum knows how to write simple SQL. It is also NOT unreasonable to expect a a professional to be able to take a clue like that and use it. A professional does NOT expect to be spoon-fed everything.
    =================================================
    Learning how to look things up in the documentation is time well spent investing in your career. To that end, you should drop everything else you are doing and do the following:
    Go to tahiti.oracle.com.
    Drill down to your product and version.
    <b><i><u>BOOKMARK THAT LOCATION</u></i></b>
    Spend a few minutes just getting familiar with what is available here. Take special note of the "books" and "search" tabs. Under the "books" tab you will find the complete documentation library.
    Spend a few minutes just getting familiar with what <b><i><u>kind</u></i></b> of documentation is available there by simply browsing the titles under the "Books" tab.
    Open the Reference Manual and spend a few minutes looking through the table of contents to get familiar with what <b><i><u>kind</u></i></b> of information is available there.
    Do the same with the SQL Reference Manual.
    Do the same with the Utilities manual.
    You don't have to read the above in depth. They are <b><i><u>reference</b></i></u> manuals. Just get familiar with <b><i><u>what</b></i></u> is there to <b><i><u>be</b></i></u> referenced. Ninety percent of the questions asked on this forum can be answered in less than 5 minutes by simply searching one of the above manuals.
    Then set yourself a plan to dig deeper.
    - Read a chapter a day from the Concepts Manual.
    - Take a look in your alert log. One of the first things listed at startup is the initialization parms with non-default values. Read up on each one of them (listed in your alert log) in the Reference Manual.
    - Take a look at your listener.ora, tnsnames.ora, and sqlnet.ora files. Go to the Network Administrators manual and read up on everything you see in those files.
    - When you have finished reading the Concepts Manual, do it again.
    Give a man a fish and he eats for a day. Teach a man to fish and he eats for a lifetime.
    =================================

  • How to find out what is populating a table

    I have a table in oracle 10g, I checked the dba_source to find out if a procedure or package is population this table, however, I couldn't find it. How can I get the name of a form or other source that can populate the table. Oracle is on window Xp.
    Thanks

    There is nothing in Oracle that would directly tell you what can populate a particualr table. You can look at the dba|user|all_dependencies views to see if there are stored procedures that have a dependency to the table, but that does not neccessarily mean that they populate the table. Anything external to the database (e.g. an external aplpication with embedded sql statements, a sqlplus session, TOAD, etc.) would not show up anywhere in the database.
    John

  • Need to get the list of all procedures called in an object

    Hi,
    I am trying to find the list of all proceudres called in an object. I can get the list of packages and individual procedures/functions using dba_dependencies, all_dependencies or user_dependencies. However this would not give me the list of procedures of a package that are used in my object.
    How to find the procedures of a package (and not just the package name) being called in another object?
    Thanks in advance
    Upendra

    You can take the package name from user_depencies and query the USER_SOURCE table for the object name where the package name exists.
    Eg code, here PKemp is the package name.
    SELECT SUBSTR(TEXT,INSTR(TEXT,'PKEMP'))
    FROM USER_SOURCE
    WHERE NAME = 'PROCEMP'
    AND INSTR(TEXT,'PKEMP') >=1
    SUBSTR(TEXT,INSTR(TEXT,'PKEMP'))
    PKEMP.SALUP;

  • Reg: Check View/MView query -

    Hi Experts,
    I'm trying to search for all references of a Table (in ALL_SOURCE). But not able to check into the query of VIEWs and MVIEWs.
    ALL_VIEWS and ALL_MVIEWS have LONG columns called TEXT and QUERY respectively.
    Any pointers how can I search into these columns?
    Help much appreciated!
    Ranit B.

    You can use all_dependencies
    SELECT *
      FROM all_dependencies
    WHERE type = 'VIEW'
       AND referenced_owner = 'TABLE_OWNER'
       AND referenced_name = 'YOUR_TABLE';Or you can have a look at Long to Varchar2 conversion....

  • How to search for a new line character in sql

    hi..i am using oracle 10g.
    basically i am looking for usage of columns.I want to see which all columns are used in
    joins.
    this is the quey i have written.
    but
    if there a new line between WHERE ,AND those scenarios are ignored.how to take care of these new line characters?
    SELECT DISTINCT s.TYPE, s.NAME, s.owner, table_name, column_name --,line,text
    FROM all_source s, cols c, all_dependencies d
    WHERE s.NAME = d.NAME
    AND d.referenced_name = c.table_name
    AND c.table_name = 'WSF_EDUCATION_ORGUNIT'
    AND column_name ='ORGUNIT_TYPECODE_OID'
    AND d.TYPE = s.TYPE
    AND d.TYPE <> 'PACKAGE'
    AND d.owner = s.owner ---FOR OVERLOADED OBJECTS
    AND ( (UPPER (text) LIKE
    '%' || 'AND' || '%' || column_name || ' ' || '=%'
    OR (UPPER (text) LIKE
    '%' || 'AND' || '%=' || ' ' || '%' || column_name
    || '%'
    UNION ---if there is where
    SELECT DISTINCT s.TYPE, s.NAME, s.owner, table_name,
    column_name ----,line,text
    FROM all_source s, cols c, all_dependencies d
    WHERE s.NAME = d.NAME
    AND d.referenced_name = c.table_name
    AND c.table_name = 'WSF_EDUCATION_ORGUNIT'
    AND column_name ='ORGUNIT_TYPECODE_OID'
    AND d.TYPE = s.TYPE
    AND d.TYPE <> 'PACKAGE'
    AND d.owner = s.owner ---FOR OVERLOADED OBJECTS
    AND ( (UPPER (text) LIKE
    '%' || 'WHERE' || '%' || column_name || ' ' || '=%'
    OR (UPPER (text) LIKE
    '%' || 'WHERE' || '%=' || ' ' || '%' || column_name
    || '%'
    )

    Hi,
    Not sure if I get it, but you can look for characters using the ascii and chr functions.
    You can change them using replace:
    A new line:
    SQL> select ascii('
      2  ') from dual;
    ASCII('')
            10(Just press enter between the quotes)
    Example how to replace it with a space:
    SQL> with t as ( -- generating test string:
      2  select 'this string has
      3  a new line' str from dual
      4  )
      5  --
      6  -- actual query:
      7  --
      8  select str
      9  ,      replace(str, chr(10), chr(32))
    10  from   t;
    STR                        REPLACE(STR,CHR(10),CHR(32
    this string has            this string has a new line
    a new lineIf that isn't clear of when I'm missing the point then please post some narrowes down examples of what you get now and your desired output. Remember to put the tag around any code example you're posting.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Chain of calls from the procdure

    Is it possible to see the chain of calls made from one procedure to other
    for e.g. proc1--has a call to proc2 in turn proc2 is calling proc3 so on..
    I am using oracle 10g and Oracle SQL Developer tool

    You could query the all_dependencies view to look it up:
    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
    Connected as FSITJA
    SQL>
    SQL> create or replace procedure proc1 as
      2  begin
      3    dbms_output.put_line('PROC1');
      4  end;
      5  /
    Procedure created
    SQL> create or replace procedure proc2 as
      2  begin
      3    proc1;
      4    dbms_output.put_line('PROC2');
      5  end;
      6  /
    Procedure created
    SQL> create or replace procedure proc3 as
      2  begin
      3    proc2;
      4    dbms_output.put_line('PROC3');
      5  end;
      6  /
    Procedure created
    SQL> set serveroutput on
    SQL> exec proc3
    PROC1
    PROC2
    PROC3
    PL/SQL procedure successfully completed
    SQL> select *
      2    from all_dependencies d
      3   where d.REFERENCED_TYPE = 'PROCEDURE';
    NAME                           TYPE              REFERENCED_OWNER               REFERENCED_NAME                                                  REFERENCED_TYPE   REFERENCED_LINK_NAME                                                               SCHEMAID DEPENDENCY_TYPE
    PROC2                          PROCEDURE         FSITJA                             PROC1                                                            PROCEDURE                                                                                                1647 HARD
    PROC3                          PROCEDURE         FSITJA                             PROC2                                                            PROCEDURE                                                                                                1647 HARD
    SQL>

  • In which Oracle version is that possibile?

    I've tried to create these procedure that I've found.
    CREATE OR REPLACE PROCEDURE genlookup (tab IN VARCHAR2, col IN VARCHAR2)
    IS
    BEGIN
    pl ('CREATE OR REPLACE FUNCTION ' || l_ltab || '_row_for (');
    pl (' ' || l_lcol || '_in IN ' || l_ltab || '.' || l_lcol || '%TYPE)');
    pl ('/');
    END;
    but I get a compilation error:
    PLS-00201: identifier 'PL' must be declared
    In which version is the PL istruction available?
    I've got Oracle 8i.
    My target is to write a procedure that having in Input N tables is able to autogenerate coding of a "select from where" putting in join the N tables by using ALL_DEPENDENCIES table so as to create queries automatically.
    The site where I've found the above create procedure, let see that by giving after comlipation "exec genlookup" you get the CREATE OR REPLACE FUNCTION well formed, but as in my case 'pl' istrucion doesn't work, should I create one row of code a time and put it in a varrray and make dbms_out.put_line reporting the whole select or you have any smart way to do it?
    Thanks!

    PL (Feuerstein) en P (Kyte) procedures are usually wrappers around dbms_output, in order to save you from typing dbms_output.put_line constantly.
    See:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1288401763279 for an example of P. Just copy ity and call it PL instead of P

  • How to find level of dependencies for oracle objects....

    Hi,
    in oracle if we have to find the dependencies we use "all_dependencies", how ever if
    we have to find level of dependencies then how should we go about it,
    example as shown below;
    master object : tablel1
    view 1:            v_test using table1
    view 2:            v_test2 using v_test
    view 3:            v_test3 using v_test2:
    so in this case
    the master table1 is having level of dependency 0
    v_test is having level of dependency 1
    v_test2 is having level of dependency 2
    v_test3 is having level of dependency 3
    and so on....
    i hope i am clear in my question,
    plz assist,
    regards
    uvEdited by: Nicloei W on Oct 7, 2008 7:53 PM

    You can use a hierarchical query on the USER_/ ALL_/ DBA_DEPENDENCIES table, i.e.
    select level, a.*
      from dba_dependencies a
    start with referenced_name = 'DEPT'
            and owner = 'SCOTT'
    connect by nocycle prior owner = referenced_owner
                   and prior name = referenced_name
    order siblings by nameJustin

  • How get list of tables/functions/other objects used in a mapping?

    Hi,
    I would like to know list of objects such as tables, views, functions, procedures and table functions of all mappings in a module.
    Could any one please explain me, how can I do this using OMB+ scripting.
    Thank you,
    Regards,
    Gowtham Sen.

    OMBRETRIEVE MAPPING 'MAP_NAME' GET TABLE OPERATORS
    OMBRETRIEVE MAPPING 'MAP_NAME' GET VIEW OPERATORS
    OMBRETRIEVE MAPPING 'MAP_NAME' GET TRANSFORMATION OPERATORS
    OMBRETRIEVE MAPPING 'MAP_NAME' GET TABLE_FUNCTION OPERATORS
    Alternative variant (and maybe more simple) - use dictionary view DBA_DEPENDENCIES (or all_dependencies):
    select * from dba_dependencies where owner='MAP_OWNER' and type in ('PACKAGE','PACKAGE_BODY') and name='MAP_NAME'
    Oleg

  • Confused ... ALL_DEPENDECIES view does not contain indexes?

    I try to generate a installation sequence for all my objects, for this I experimented with the all_dependecies view
    1st generate a table with all objects:
    <pre>
    drop table rank_sources;
    create table rank_sources as
    select rownum as rn, object_name, object_type, owner from all_objects
    where owner = 'SYS';
    commit;
    select * from rank_sources;
    </pre>
    afterwards fire a pl/sql
    <pre>
    set serveroutput on
    declare
    cursor l_cursor is select * from rank_sources for update;
    l_found boolean := false;
    begin
    for src in l_cursor loop
    l_found := false;
    for dep in (
    select level, referenced_name, referenced_type
    from DBA_DEPENDENCIES
    where owner = src.owner
    and referenced_owner = src.owner
    start with name = src.object_name and type = src.object_type
    connect by name = prior referenced_name and type = prior referenced_type
    loop
    l_found := true;
    update rank_sources
    set rn = src.rn - dep.level
    where object_name = dep.referenced_name
    and object_type = dep.referenced_type;
    end loop;
    if not l_found then
    update rank_sources
    set rn = -9999999999 where CURRENT OF l_cursor;
    end if;
    end loop;
    commit;
    end;
    </pre>
    As you can see, there are potentially indexes with a lower rank than their table. When you do a
    <pre>select * from all_dependencies where type like '%INDEX%'</pre>
    the result is NULL - I am really confused why indexes are not referencing to their tables?? So in case of Index I have to query seperatly all_indexes.
    But when you look at the all_dependecies view definition you can see, index as an expected type - is this a bug? I use Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    <pre>
    SET DEFINE OFF;
    DROP VIEW SYS.ALL_DEPENDENCIES
    /* Formatted on 20.10.2010 12:31:15 (QP5 v5.149.1003.31008) */
    CREATE OR REPLACE FORCE VIEW SYS.ALL_DEPENDENCIES
    OWNER,
    NAME,
    TYPE,
    REFERENCED_OWNER,
    REFERENCED_NAME,
    REFERENCED_TYPE,
    REFERENCED_LINK_NAME,
    DEPENDENCY_TYPE
    AS
    SELECT u.name,
    o.name,
    DECODE (o.type#,
    0, 'NEXT OBJECT',
    1, 'INDEX',
    2, 'TABLE',
    3, 'CLUSTER',
    4, 'VIEW',
    </pre>
    Thanks
    Chris

    Ok, so what I have done so far - to get a solution for my requirement - I created a sys view like this:
    <pre>
    create or replace
    view REALLY_ALL_DEPENDENCIES as
    select *
    from ALL_DEPENDENCIES
    union
    select owner, index_name, 'INDEX', table_owner, table_name, table_type, null, null
    from all_indexes
    union
    select p.owner, p.table_name, 'TABLE', f.owner, f.table_name, 'TABLE', null, null
    from all_constraints p
    join all_constraints f
    on F.R_CONSTRAINT_NAME = P.CONSTRAINT_NAME
    and F.CONSTRAINT_TYPE = 'R'
    and p.constraint_type='P'
    </pre>
    Since union is checking for duplicates, it should be harmless to use this view from now on :-) ... ok, performance is not really good, but I do not use the view every minute - maybe once a day.
    Thanks and cheers
    Chris

Maybe you are looking for

  • Variable Transport binding - SOAP Sender Adapter

    Hi All have a scenarion where Sender System is sending Custom SOAP Header as below into P through SOAP Sender ChannelI. And the requirement is to access the values coming in Header fields, example within Message Mapping need to Map Headername1 value

  • Removed from forum

    All of my previous pleas for help have been removed from this forum as a punishment for trying to get help. I have escalated the failures of this forum, and the Corporate Service team are now trying to make some sense of it all. If you want help surf

  • Force Safari to be like Firefox - Color Management

    Hello all, I recently upgraded to Mountain Lion and Safari 6 is by far my favorite browser... until I noticed it's still "color-impaired" when it comes to using my wide gamut display. I've been forced to stick with Firefox (about:config hack for disp

  • Why does HZ_PARTIES table get outofsync when deleting futuredated HR record

    I checked HZ_PARTIES table for existing HR person It shows: First Name Joseph Last Name Summerford Then I went into HR application: UK HRMS Manager responsibility > People > Enter and Maintain Find Person above Date Tracked to future date eg. 01-JAN-

  • Anywhere i can buy an i/o plate?

    I am wanting an i/o (backplate) for an P4N Diamond.Is there anywhere i can purchase one? Thanks