【问题标题】:List of Oracle views using specific table name使用特定表名的 Oracle 视图列表
【发布时间】:2014-01-09 11:57:32
【问题描述】:

我希望使用提到的表名找到特定架构下所有视图的列表。

例如如果 view1 和 view2 使用 table1,使用表名“table1”,我希望找到视图名“view1”和 view2”。

请告诉我,我该怎么做。

【问题讨论】:

    标签: oracle view find names


    【解决方案1】:
    select 
        * 
    from 
        all_dependencies
    where 
        type='VIEW'
        and referenced_name like '%table_name%'
        and referenced_type = 'TABLE'
    

    【讨论】:

      【解决方案2】:

      使用这个查询:

      SELECT * 
      FROM all_dependencies 
      WHERE TYPE = 'VIEW'
          AND referenced_type = 'TABLE'
      

      【讨论】:

      • 完美 :) 为您的答案添加更多信息,以查找引用我的特定表的视图,我添加了另一个条件来检查“referenced_name”。感谢您的帮助!
      • 请记住,您可能只想查看您感兴趣的 OWNER,或者至少排除 SYS。 AND owner = 'MYSCHEMA'.
      猜你喜欢
      • 2010-10-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-24
      • 1970-01-01
      • 2015-01-04
      相关资源
      最近更新 更多