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

本站中文解释

ALL_ASSOCIATIONS视图是在Oracle中,系统会维护的一个视图,用于存储外键关联表的信息。对外键进行管理,可以用这个视图来查询,比如查看两个表之间的关联关系,查看某个字段的外键关联情况等。

要使用ALL_ASSOCIATIONS视图,需要通过select语句来查询指定的表或者字段信息,例如可以查询某个表中所有的外键关联信息:

SELECT * FROM ALL_ASSOCIATIONS WHERE TABLE_NAME = ‘表名’;

此外,还可以查看某个列的关联信息:

SELECT * FROM ALL_ASSOCIATIONS WHERE TABLE_NAME = ‘表名’ AND COLUMN_NAME=’列名’;

官方英文解释

ALL_ASSOCIATIONS describes user-defined statistics associated with objects accessible to the current user.

Related Views

  • DBA_ASSOCIATIONS describes all user-defined statistics in the database.

  • USER_ASSOCIATIONS describes user-defined statistics associated with objects owned by the current user.

Column Datatype NULL Description

OBJECT_OWNER

VARCHAR2(128)

NOT NULL

Owner of the object for which the association is being defined

OBJECT_NAME

VARCHAR2(128)

NOT NULL

Name of the object for which the association is being defined

COLUMN_NAME

VARCHAR2(128)

Column name in the object for which the association is being defined

OBJECT_TYPE

VARCHAR2(9)

Kind of object with which statistics are being associated: column, type, package or function, indextype, or domain index.

STATSTYPE_SCHEMA

VARCHAR2(128)

Owner of the statistics type

STATSTYPE_NAME

VARCHAR2(128)

Name of statistics type that contains the cost, selectivity or statistics functions

DEF_SELECTIVITY

NUMBER

Default selectivity of the object, if any

DEF_CPU_COST

NUMBER

Default CPU cost of the object, if any

DEF_IO_COST

NUMBER

Default I/O cost of the object, if any

DEF_NET_COST

NUMBER

Default networking cost of the object, if any

INTERFACE_VERSION

NUMBER

Identifies the version number of the ODCIStats interface. Value is 1 for statistics type implementing Oracle8i 8.1; 0 for types implementing Oracle9i 9.0.0.

MAINTENANCE_TYPE

VARCHAR2(14)

Specifies whether the object is system-managed or user-managed

See Also:

  • “DBA_ASSOCIATIONS”

  • “USER_ASSOCIATIONS”


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