Oracle 视图 DBA_TAB_COLS 官方解释,作用,如何使用详细说明
本站中文解释
DBA_TAB_COLS 是 Oracle 中的一个基础查询视图。它的目的是提供关于数据库中所有表、各列的元数据信息。
DBA_TAB_COLS 视图提供了以下信息:
*表名
*表所在的用户
*列(字段)名
*表列拥有的数据类型(包括字符串长度和列宽)
*列的注释
*默认值
*表空间
*是否可为 null
*列 ID
使用者可以使用DBA_TAB_COLS视图读取一张表中所有列的元数据信息。它可帮助数据库管理员分析服务中究竟存在什么表,以及这些表的结构。
使用方法:
例如,查询一张表的所有列的元数据信息,可使用下面的 SQL 语句:
SELECT * FROM DBA_TAB_COLS WHERE table_name=’table_name’;
其中,table_name应替换成实际的表名。
官方英文解释
DBA_TAB_COLS
describes the columns of all tables, views, and clusters in the database.
Its columns (except for SENSITIVE_COLUMN
) are the same as those in ALL_TAB_COLS
.
To gather statistics for this view, use the DBMS_STATS
package.
This view differs from DBA_TAB_COLUMNS
in that system-generated hidden columns are not filtered out.
Columns marked with an asterisk (*) in the table below remain for backward compatibility with Oracle7. This information is now in the [TAB|PART]_COL_STATISTICS
views.
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
|
Owner of the table, view, or cluster |
|
|
|
Name of the table, view, or cluster |
|
|
|
Column name |
|
|
Data type of the column |
|
|
|
Data type modifier of the column |
|
|
|
Owner of the data type of the column |
|
|
|
|
Length of the column (in bytes) |
|
|
Decimal precision for |
|
|
|
Digits to the right of the decimal point in a number |
|
|
|
Indicates whether a column allows NULLs. The value is |
|
|
|
Sequence number of the column as created |
|
|
|
Length of the default value for the column |
|
|
|
Default value for the column |
|
|
|
Number of distinct values in the column |
|
|
|
Low value in the column |
|
|
|
High value in the column |
|
|
|
If a histogram is available on If a histogram is not available on |
|
|
|
Number of NULLs in the column |
|
|
|
Number of buckets in the histogram for the column Note: The number of buckets in a histogram is specified in the |
|
|
|
Date on which this column was most recently analyzed |
|
|
|
Sample size used in analyzing this column |
|
|
|
Name of the character set:
|
|
|
|
Declaration length of the character type column |
|
|
|
|
|
|
|
Indicates whether statistics were entered directly by the user ( |
|
|
|
Average length of the column (in bytes) |
|
|
|
Displays the length of the column in characters. This value only applies to the following data types:
|
|
|
|
Indicates that the column uses
|
|
|
|
Indicates whether the column data is in release 8.0 image format ( |
|
|
|
Indicates whether the column data has been upgraded to the latest type version format ( |
|
|
|
Indicates whether the column is a hidden column ( |
|
|
|
Indicates whether the column is a virtual column ( |
|
|
|
Sequence number of the column in the segment |
|
|
|
|
Internal sequence number of the column |
|
|
Indicates existence/type of histogram:
|
|
|
|
Qualified column name |
|
|
|
Indicates whether the column is a user-generated column ( |
|
|
|
Indicates whether the column has DEFAULT ON NULL semantics ( |
|
|
|
Indicates whether this is an identity column ( |
|
|
|
Indicates whether this is a sensitive column ( |
|
|
|
Name of the edition in which editioned objects referenced in an expression column are resolved |
|
|
|
Name of the oldest edition in which the index may be used as part of a query plan |
|
|
|
Name of the edition for which the index may not be used as part of a query plan in this edition or any of its descendants |
|
|
|
Collation for the column. Only applies to columns with character data types. |
|
|
|
Internal sequence number of a column, for which this virtual column generates a collation key |
See Also:
- “ALL_TAB_COLS”
-
“DBA_TAB_COLUMNS”
-
Oracle Database PL/SQL
Packages and Types Reference for more information about theDBMS_STATS
package