注册 登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

Oracle、MySQL资料及经验

.

 
 
 

日志

 
 

查某对象引用了哪些对象  

2013-05-06 09:17:20|  分类: 默认分类 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

查某对象引用了哪些对象
DBA_DEPENDENCIES存储了对象之间的相互依赖(或引用)关系

SQL> DESC DBA_DEPENDENCIES
Name                 Type          Nullable Default Comments                                                  
-------------------- ------------- -------- ------- ----------------------------------------------------------
OWNER                VARCHAR2(30)                   Owner of the object                                       
NAME                 VARCHAR2(30)                   Name of the object                                        
TYPE                 VARCHAR2(18)  Y                Type of the object                                        
REFERENCED_OWNER     VARCHAR2(30)  Y                Owner of referenced object (remote owner if remote object)
REFERENCED_NAME      VARCHAR2(64)  Y                Name of referenced object                                 
REFERENCED_TYPE      VARCHAR2(18)  Y                Type of referenced object                                 
REFERENCED_LINK_NAME VARCHAR2(128) Y                Name of dblink if this is a remote object                 
DEPENDENCY_TYPE      VARCHAR2(4)   Y   

 

通过DBA_DEPENDENCIES可以迅速查出一个过程引用了哪些表、视图、包等所有引用的对象。

示例:
SQL> select REFERENCED_OWNER,REFERENCED_NAME,REFERENCED_TYPE,REFERENCED_LINK_NAME from DBA_DEPENDENCIES where name='P_READ_AUDIT';
 
REFERENCED_OWNER               REFERENCED_NAME                          REFERENCED_TYPE    REFERENCED_LINK_NAME
------------------------------ ---------------------------------------- ------------------ ------------------------------
USER1                          P_TRUNCATE_FGA                           PROCEDURE          DB01
USER2                          P_DROPPART_DDL_AUDIT                     PROCEDURE          DB01
USER2                          P_DISABLE_TR_CRM_DDL                     PROCEDURE          DB01
USER2                          P_DISABLE_TR_COMPIERE_DDL                PROCEDURE          DB01
USER2                          P_COMPILE_TR_CRM_DDL                     PROCEDURE          DB01
USER2                          P_COMPILE_TR_COMPIERE_DDL                PROCEDURE          DB01
USER2                          DML_TIME                                 TABLE              DB02
USER2                          USER1                                    NON-EXISTENT       DB01
PUBLIC                         USER1                                    NON-EXISTENT       DB01
USER2                          USER_OBJECTS                             NON-EXISTENT       DB02
USER1                          USER_OBJECTS                             VIEW               DB02
PUBLIC                         USER_OBJECTS                             SYNONYM            DB02
USER2                          DDL_AUDIT                                TABLE              DB02
USER1                          USER1_STUB_FOR_PURITY_ANALYSIS           PACKAGE           
USER2                          DBA_FGA_AUDIT_TRAIL2                     NON-EXISTENT       DB02
USER1                          DBA_FGA_AUDIT_TRAIL2                     TABLE              DB02
PUBLIC                         DBA_FGA_AUDIT_TRAIL2                     SYNONYM            DB02
USER1                          STANDARD                                 PACKAGE           
PUBLIC                         USER_TAB_PARTITIONS                      SYNONYM           
LOGDB                          DML_AUDIT                                TABLE             
LOGDB                          DML_TIME                                 TABLE             
LOGDB                          P_SENDMAIL                               PROCEDURE         
LOGDB                          P_DML_AUDIT_FILTER                       PROCEDURE         
LOGDB                          P_CHECKMAIL                              PROCEDURE         
LOGDB                          DDL_AUDIT                                TABLE             
 
25 rows selected

  评论这张
 
阅读(134)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018