原文:http://docs.oracle.com/cd/B19306_01/server.102/b14237/statviews_2094.htm
ALL_TAB_COLUMNS
ALL_TAB_COLUMNS describes the columns of the tables, views, and clusters accessible to the current user. To gather statistics for this view, use theANALYZE SQL statement or the DBMS_STATS package.
-
DBA_TAB_COLUMNSdescribes the columns of all tables, views, and clusters in the database. -
USER_TAB_COLUMNSdescribes the columns of the tables, views, and clusters owned by the current user. This view does not display theOWNERcolumn.
| Column | Datatype | NULL | Description |
|---|---|---|---|
OWNER | VARCHAR2(30) | NOT NULL | Owner of the table, view, or cluster |
TABLE_NAME | VARCHAR2(30) | NOT NULL | Name of the table, view, or cluster |
COLUMN_NAME | VARCHAR2(30) | NOT NULL | Column name |
DATA_TYPE | VARCHAR2(106) | Datatype of the column | |
DATA_TYPE_MOD | VARCHAR2(3) | Datatype modifier of the column | |
DATA_TYPE_OWNER | VARCHAR2(30) | Owner of the datatype of the column | |
DATA_LENGTH | NUMBER | NOT NULL | Length of the column (in bytes) |
DATA_PRECISION | NUMBER | Decimal precision for NUMBERdatatype; binary precision forFLOAT datatype, null for all other datatypes | |
DATA_SCALE | NUMBER | Digits to right of decimal point in a number | |
NULLABLE | VARCHAR2(1) | Specifies whether a column allows NULLs. Value is N if there is a NOT NULL constraint on the column or if the column is part of a PRIMARY KEY. The constraint should be in an ENABLE VALIDATE state. | |
COLUMN_ID | NUMBER | Sequence number of the column as created | |
DEFAULT_LENGTH | NUMBER | Length of default value for the column | |
DATA_DEFAULT | LONG | Default value for the column | |
NUM_DISTINCT | NUMBER | Number of distinct values in the columnFoot 1 | |
LOW_VALUE | RAW(32) | Low value in the columnFootref 1 | |
HIGH_VALUE | RAW(32) | High value in the columnFootref 1 | |
DENSITY | NUMBER | Density of the columnFootref 1 | |
NUM_NULLS | NUMBER | Number of nulls in the column | |
NUM_BUCKETS | NUMBER | Number of buckets in the histogram for the column Note: The number of buckets in a histogram is specified in the | |
LAST_ANALYZED | DATE | Date on which this column was most recently analyzed | |
SAMPLE_SIZE | NUMBER | Sample size used in analyzing this column | |
CHARACTER_SET_NAME | VARCHAR2(44) | Name of the character set:CHAR_CS or NCHAR_CS | |
CHAR_COL_DECL_LENGTH | NUMBER | Length | |
GLOBAL_STATS | VARCHAR2(3) | For partitioned tables, indicates whether column statistics were collected for the table as a whole (YES) or were estimated from statistics on underlying partitions and subpartitions (NO) | |
USER_STATS | VARCHAR2(3) | Indicates whether statistics were entered directly by the user (YES) or not (NO) | |
AVG_COL_LEN | NUMBER | Average length of the column (in bytes) | |
CHAR_LENGTH | NUMBER | Displays the length of the column in characters. This value only applies to the following datatypes:
| |
CHAR_USED | VARCHAR2(1) | B | C. B indicates that the column uses BYTE length semantics. Cindicates that the column usesCHAR length semantics. NULLindicates the datatype is not any of the following:
| |
V80_FMT_IMAGE | VARCHAR2(3) | Indicates whether the column data is in release 8.0 image format (YES) or not (NO) | |
DATA_UPGRADED | VARCHAR2(3) | Indicates whether the column data has been upgraded to the latest type version format (YES) or not (NO) | |
HISTOGRAM | VARCHAR2(15) | Indicates existence/type of histogram:
|

本文详细介绍了 Oracle 数据库中的 ALL_TAB_COLUMNS 视图,该视图提供了当前用户可访问的所有表、视图及簇的列信息。通过使用 ANALYZE SQL 语句或 DBMS_STATS 包可以收集此视图的统计信息。本文还对比了 USER_TAB_COLUMNS 和 DBA_TAB_COLUMNS 的用途,并列举了 ALL_TAB_COLUMNS 视图中各列的数据类型和描述。
1983

被折叠的 条评论
为什么被折叠?



