Oracle 视图 V$OBJECT_DEPENDENCY 官方解释,作用,如何使用详细说明

本站中文解释

Oracle视图V$OBJECT_DEPENDENCY用于查询某对象之间的依赖关系。该视图仅用于数据库版本 10.2.0.367.0 及更高版本,出现在 Oracle 数据库中的性能诊断和视图 v$object_dependency 中。它可以把单一对象的依赖关系全部显示出来,更加明晰的展示出某一对象,例如存储过程、函数、索引,它们之间的依赖关系。

使用方法:

1. 执行 select * from V$OBJECT_DEPENEDENCY; 来查看某个对象的依赖。

2. 执行 SELECT DEPENDENCY_TYPE, REFERENCED_NAME FROM V$OBJECT_DEPENDENCY WHERE NAME = ‘存储过程名’; 来查看某个存储过程的依赖关系。例如,结果中DEPENDENCY_TYPE表示依赖类型,REFERENCED_NAME表示依从对象名称。

3. 执行 SELECT REFERENCED_TYPE, REFERENCED_NAME FROM V$OBJECT_DEPENDENCY WHERE NAME = ‘索引名’; 来查看某个索引的依赖关系。结果中REFERENCED_TYPE表示依赖的对象类型,REFERENCED_NAME表示依赖的对象名字。

官方英文解释

V$OBJECT_DEPENDENCY displays the objects depended on by a package, procedure, or cursor that is currently loaded in the shared pool. For example, together with V$SESSION and V$SQL, this view can be used to determine which tables are used in the SQL statement that a user is currently executing.

See Also:

“V$SESSION” and “V$SQL”

Column Datatype Description

FROM_ADDRESS

RAW(4 | 8)

Address of a procedure, package, or cursor that is currently loaded in the shared pool

FROM_HASH

NUMBER

Hash value of a procedure, package, or cursor that is currently loaded in the shared pool

TO_OWNER

VARCHAR2(64)

Owner of the object that is depended on

TO_NAME

VARCHAR2(1000)

Name of the object that is depended on

TO_ADDRESS

RAW(4 | 8)

Address of the object that is depended on. These can be used to look up more information on the object in V$DB_OBJECT_CACHE.

TO_HASH

NUMBER

Hash value of the object that is depended on. These can be used to look up more information on the object in V$DB_OBJECT_CACHE.

TO_TYPE

NUMBER

Type of the object that is depended on

CON_ID

NUMBER

The ID of the container to which the data pertains. Possible values include:

  • 0: This value is used for rows containing data that pertain to the entire CDB. This value is also used for rows in non-CDBs.

  • 1: This value is used for rows containing data that pertain to only the root

  • n: Where n is the applicable container ID for the rows containing data


数据运维技术 » Oracle 视图 V$OBJECT_DEPENDENCY 官方解释,作用,如何使用详细说明