레이블이 Data Dictionary인 게시물을 표시합니다. 모든 게시물 표시
레이블이 Data Dictionary인 게시물을 표시합니다. 모든 게시물 표시

2009년 2월 17일 화요일

V$SQL / V$SQL_WORKAREA

V$SQL

V$SQL lists statistics on shared SQL areas without the GROUP BY clause and contains one row for each child of the original SQL text entered. Statistics displayed in V$SQL are normally updated at the end of query execution. However, for long running queries, they are updated every 5 seconds. This makes it easy to see the impact of long running SQL statements while they are still in progress.

ColumnDatatypeDescription
SQL_TEXTVARCHAR2(1000)First thousand characters of the SQL text for the current cursor
SQL_FULLTEXTCLOBFull text for the SQL statement exposed as a CLOB column. The full text of a SQL statement can be retrieved using this column instead of joining with the V$SQLTEXT dynamic performance view.
SQL_IDVARCHAR2(13)SQL identifier of the parent cursor in the library cache
SHARABLE_MEMNUMBERAmount of shared memory used by the child cursor (in bytes)
PERSISTENT_MEMNUMBERFixed amount of memory used for the lifetime of the child cursor (in bytes)
RUNTIME_MEMNUMBERFixed amount of memory required during the execution of the child cursor
SORTSNUMBERNumber of sorts that were done for the child cursor
LOADED_VERSIONSNUMBERIndicates whether the context heap is loaded (1) or not (0)
OPEN_VERSIONSNUMBERIndicates whether the child cursor is locked (1) or not (0)
USERS_OPENINGNUMBERNumber of users executing the statement
FETCHESNUMBERNumber of fetches associated with the SQL statement
EXECUTIONSNUMBERNumber of executions that took place on this object since it was brought into the library cache
PX_SERVERS_EXECUTIONSNUMBERTotal number of executions performed by parallel execution servers (0 when the statement has never been executed in parallel)
END_OF_FETCH_COUNTNUMBERNumber of times this cursor was fully executed since the cursor was brought into the library cache. The value of this statistic is not incremented when the cursor is partially executed, either because it failed during the execution or because only the first few rows produced by this cursor are fetched before the cursor is closed or re-executed. By definition, the value of the END_OF_FETCH_COUNTcolumn should be less or equal to the value of the EXECUTIONS column.
USERS_EXECUTINGNUMBERNumber of users executing the statement
LOADSNUMBERNumber of times the object was either loaded or reloaded
FIRST_LOAD_TIMEVARCHAR2(19)Timestamp of the parent creation time
INVALIDATIONSNUMBERNumber of times this child cursor has been invalidated
PARSE_CALLSNUMBERNumber of parse calls for this child cursor
DISK_READSNUMBERNumber of disk reads for this child cursor
DIRECT_WRITESNUMBERNumber of direct writes for this child cursor
BUFFER_GETSNUMBERNumber of buffer gets for this child cursor
APPLICATION_WAIT_TIMENUMBERApplication wait time (in microseconds)
CONCURRENCY_WAIT_TIMENUMBERConcurrency wait time (in microseconds)
CLUSTER_WAIT_TIMENUMBERCluster wait time (in microseconds)
USER_IO_WAIT_TIMENUMBERUser I/O Wait Time (in microseconds)
PLSQL_EXEC_TIMENUMBERPL/SQL execution time (in microseconds)
JAVA_EXEC_TIMENUMBERJava execution time (in microseconds)
ROWS_PROCESSEDNUMBERTotal number of rows the parsed SQL statement returns
COMMAND_TYPENUMBEROracle command type definition
OPTIMIZER_MODEVARCHAR2(10)Mode under which the SQL statement was executed
OPTIMIZER_COSTNUMBERCost of this query given by the optimizer
OPTIMIZER_ENVRAW(2000)Optimizer environment
OPTIMIZER_ENV_HASH_VALUENUMBERHash value for the optimizer environment
PARSING_USER_IDNUMBERUser ID of the user who originally built this child cursor
PARSING_SCHEMA_IDNUMBERSchema ID that was used to originally build this child cursor
PARSING_SCHEMA_NAMEVARCHAR2(30)Schema name that was used to originally build this child cursor
KEPT_VERSIONSNUMBERIndicates whether this child cursor has been marked to be kept pinned in the cache using theDBMS_SHARED_POOL package
ADDRESSRAW(4 | 8)Address of the handle to the parent for this cursor
TYPE_CHK_HEAPRAW(4)Descriptor of the type check heap for this child cursor
HASH_VALUENUMBERHash value of the parent statement in the library cache
OLD_HASH_VALUENUMBEROld SQL hash value
PLAN_HASH_VALUENUMBERNumeric representation of the SQL plan for this cursor. Comparing one PLAN_HASH_VALUE to another easily identifies whether or not two plans are the same (rather than comparing the two plans line by line).
CHILD_NUMBERNUMBERNumber of this child cursor
SERVICEVARCHAR2(64)Service name
SERVICE_HASHNUMBERHash value for the name listed in the SERVICEcolumn
MODULEVARCHAR2(64)Contains the name of the module that was executing at the time that the SQL statement was first parsed, which is set by calling DBMS_APPLICATION_INFO.SET_MODULE
MODULE_HASHNUMBERHash value of the module listed in the MODULE column
ACTIONVARCHAR2(64)Contains the name of the action that was executing at the time that the SQL statement was first parsed, which is set by calling DBMS_APPLICATION_INFO.SET_ACTION
ACTION_HASHNUMBERHash value of the action listed in the ACTION column
SERIALIZABLE_ABORTSNUMBERNumber of times the transaction failed to serialize, producing ORA-08177 errors, per cursor
OUTLINE_CATEGORYVARCHAR2(64)If an outline was applied during construction of the cursor, then this column displays the category of that outline. Otherwise the column is left blank.
CPU_TIMENUMBERCPU time (in microseconds) used by this cursor for parsing, executing, and fetching
ELAPSED_TIMENUMBERElapsed time (in microseconds) used by this cursor for parsing, executing, and fetching
OUTLINE_SIDNUMBEROutline session identifier
CHILD_ADDRESSRAW(4 | 8)Address of the child cursor
SQLTYPENUMBERDenotes the version of the SQL language used for this statement
REMOTEVARCHAR2(1)Indicates whether the cursor is remote mapped (Y) or not (N)
OBJECT_STATUSVARCHAR2(19)Status of the cursor:
  • VALID - Valid, authorized without errors

  • VALID_AUTH_ERROR - Valid, authorized with authorization errors

  • VALID_COMPILE_ERROR - Valid, authorized with compilation errors

  • VALID_UNAUTH - Valid, unauthorized

  • INVALID_UNAUTH - Invalid, unauthorized

  • INVALID - Invalid, unauthorized but keep the timestamp

LITERAL_HASH_VALUENUMBERHash value of the literals which are replaced with system-generated bind variables and are to be matched, when CURSOR_SHARING is used. This is not the hash value for the SQL statement. IfCURSOR_SHARING is not used, then the value is 0.
LAST_LOAD_TIMEVARCHAR2(19)Time at which the query plan was loaded into the library cache
IS_OBSOLETEVARCHAR2(1)Indicates whether the cursor has become obsolete (Y) or not (N). This can happen if the number of child cursors is too large.
IS_BIND_SENSITIVEVARCHAR2(1)Indicates whether the cursor is bind sensitive (Y) or not (N). A query is considered bind-sensitive if the optimizer peeked at one of its bind variable values when computing predicate selectivities and where a change in a bind variable value may cause the optimizer to generate a different plan.
IS_BIND_AWAREVARCHAR2(1)Indicates whether the cursor is bind aware (Y) or not (N). A query is considered bind-aware if it has been marked to use extended cursor sharing. The query would already have been marked as bind-sensitive.
IS_SHAREABLEVARCHAR2(1)Indicates whether the cursor can be shared (Y) or not (N)
CHILD_LATCHNUMBERChild latch number that is protecting the cursor. This column is obsolete and maintained for backward compatibility.
SQL_PROFILEVARCHAR2(64)SQL profile used for this statement, if any
SQL_PATCHVARCHAR2(30)SQL patch used for this statement, if any
SQL_PLAN_BASELINEVARCHAR2(30)SQL plan baseline used for this statement, if any
PROGRAM_IDNUMBERProgram identifier
PROGRAM_LINE#NUMBERProgram line number
EXACT_MATCHING_SIGNATURENUMBERSignature calculated on the normalized SQL text. The normalization includes the removal of white space and the uppercasing of all non-literal strings.
FORCE_MATCHING_SIGNATURENUMBERSignature used when the CURSOR_SHARING parameter is set to FORCE
LAST_ACTIVE_TIMEDATETIme at which the query plan was last active
BIND_DATARAW(2000)Bind data
TYPECHECK_MEMNUMBER???

V$SQL_WORKAREA

V$SQL_WORKAREA displays information about work areas used by SQL cursors. Each SQL statement stored in the shared pool has one or more child cursors that are listed in the V$SQL view. V$SQL_WORKAREA lists all work areas needed by these child cursors; V$SQL_WORKAREA can be joined with V$SQLAREA on (ADDRESSHASH_VALUE) and with V$SQL on (ADDRESSHASH_VALUECHILD_NUMBER).

You can use this view to find out answers to the following questions:

  • What are the top 10 work areas that require the most cache area?
  • For work areas allocated in AUTO mode, what percentage of work areas are running using maximum memory?
ColumnDatatypeDescription
ADDRESSRAW(4 | 8)Address of the parent cursor handle
HASH_VALUENUMBERHash value of the parent statement in the library cache. Two columns PARENT_HANDLE andHASH_VALUE can be used to join with V$SQLAREA to locate the parent cursor.
SQL_IDVARCHAR2(13)SQL identifier of the parent statement in the library cache
CHILD_NUMBERNUMBERNumber of the child cursor that uses this work area. The columns PARENT_HANDLEHASH_VALUE, andCHILD_NUMBER can be used to join with V$SQL to locate the child cursor using this area.
WORKAREA_ADDRESSRAW(4 | 8)Address of the work area handle. This is the primary key for the view.
OPERATION_TYPEVARCHAR2(20)Type of operation using the work area (SORTHASH JOINGROUP BYBUFFERINGBITMAP MERGE, orBITMAP CREATE)
OPERATION_IDNUMBERA unique number used to identify the operation in the execution plan. This identifier can be joined to V$SQL_PLAN to locate the operation that uses this work area.
POLICYVARCHAR2(10)Sizing policy for this work area (MANUAL or AUTO)
ESTIMATED_OPTIMAL_SIZENUMBEREstimated size (in bytes) required by this work area to execute the operation completely in memory (optimal execution). Derived from either optimizer statistics or previous executions.
ESTIMATED_ONEPASS_SIZENUMBEREstimated size (in bytes) required by this work area to execute the operation in a single pass. Derived from either optimizer statistics or previous executions.
LAST_MEMORY_USEDNUMBERMemory (in bytes) used by this work area during the last execution of the cursor
LAST_EXECUTIONVARCHAR2(10)Indicates whether this work area runs using OPTIMAL, ONE PASS, or ONE PASS memory requirement (or MULTI-PASS), during the last execution of the cursor
LAST_DEGREENUMBERDegree of parallelism used during the last execution of this operation
TOTAL_EXECUTIONSNUMBERNumber of times this work area was active
OPTIMAL_EXECUTIONSNUMBERNumber of times this work area ran in optimal mode
ONEPASS_EXECUTIONSNUMBERNumber of times this work area ran in one-pass mode
MULTIPASSES_EXECUTIONSNUMBERNumber of times this work area ran below the one-pass memory requirement
ACTIVE_TIMENUMBERAverage time this work area is active (in hundredths of a second)
MAX_TEMPSEG_SIZENUMBERMaximum temporary segment size (in bytes) created by an instantiation of this work area. This column is NULL if this work area has never spilled to disk.
LAST_TEMPSEG_SIZENUMBERTemporary segment size (in bytes) created in the last instantiation of this work area. This column is NULL if the last instantiation of this work area did not spill to disk.


7.5.1.2.6 V$SQL_WORKAREA

Oracle maintains cumulative work area statistics for each loaded cursor whose execution plan uses one or more work areas. Every time a work area is deallocated, theV$SQL_WORKAREA table is updated with execution statistics for that work area.

V$SQL_WORKAREA can be joined with V$SQL to relate a work area to a cursor. It can even be joined to V$SQL_PLAN to precisely determine which operator in the plan uses a work area.

Example 7-7 shows three typical queries on the V$SQL_WORKAREA dynamic view:

Example 7-7 Querying V$SQL_WORKAREA

The following query finds the top 10 work areas requiring most cache memory:

SELECT *
FROM   ( SELECT workarea_address, operation_type, policy, estimated_optimal_size
         FROM V$SQL_WORKAREA
        ORDER BY estimated_optimal_size )
 WHERE ROWNUM <= 10;

The following query finds the cursors with one or more work areas that have been executed in one or even multiple passes:

col sql_text format A80 wrap 
SELECT sql_text, sum(ONEPASS_EXECUTIONS) onepass_cnt,
       sum(MULTIPASSES_EXECUTIONS) mpass_cnt 
FROM V$SQL s, V$SQL_WORKAREA wa 
WHERE s.address = wa.address 
GROUP BY sql_text 
HAVING sum(ONEPASS_EXECUTIONS+MULTIPASSES_EXECUTIONS)>0;

Using the hash value and address of a particular cursor, the following query displays the cursor execution plan, including information about the associated work areas.

col "O/1/M" format a10
col name format a20
SELECT operation, options, object_name name, trunc(bytes/1024/1024) "input(MB)",
       trunc(last_memory_used/1024) last_mem,
       trunc(estimated_optimal_size/1024) optimal_mem, 
       trunc(estimated_onepass_size/1024) onepass_mem, 
       decode(optimal_executions, null, null, 
              optimal_executions||'/'||onepass_executions||'/'||
              multipasses_executions) "O/1/M"
  FROM V$SQL_PLAN p, V$SQL_WORKAREA w 
 WHERE p.address=w.address(+) 
   AND p.hash_value=w.hash_value(+) 
   AND p.id=w.operation_id(+) 
   AND p.address='88BB460C'
   AND p.hash_value=3738161960; 

OPERATION    OPTIONS  NAME     input(MB) LAST_MEM OPTIMAL_ME ONEPASS_ME O/1/M 
------------ -------- -------- --------- -------- ---------- ---------- ------
SELECT STATE                                                                  
HASH         GROUP BY               4582        8         16         16 16/0/0
HASH JOIN    SEMI                   4582     5976       5194       2187 16/0/0
TABLE ACCESS FULL     ORDERS          51                                      
TABLE ACCESS FUL      LINEITEM      1000                                      

You can get the address and hash value from the V$SQL view by specifying a pattern in the query. For example:

SELECT address, hash_value 
  FROM V$SQL 
WHERE sql_text LIKE '%my_pattern%';

2009년 2월 15일 일요일

Redo Log Data Dictionary Views

Redo Log Data Dictionary Views

The following views provide information on redo logs.

View Description
V$LOG Displays the redo log file information from the control file
V$LOGFILE Identifies redo log groups and members and member status
V$LOG_HISTORY Contains log history information

The following query returns the control file information about the redo log for a database.

SELECT * FROM V$LOG;

GROUP# THREAD#   SEQ   BYTES  MEMBERS  ARC STATUS     FIRST_CHANGE# FIRST_TIM
------ ------- ----- -------  -------  --- ---------  ------------- ---------
     1       1 10605 1048576        1  YES ACTIVE          11515628 16-APR-00
     2       1 10606 1048576        1  NO  CURRENT         11517595 16-APR-00
     3       1 10603 1048576        1  YES INACTIVE        11511666 16-APR-00
     4       1 10604 1048576        1  YES INACTIVE        11513647 16-APR-00

To see the names of all of the member of a group, use a query similar to the following:

SELECT * FROM V$LOGFILE;

GROUP#   STATUS  MEMBER
------  -------  ----------------------------------
     1           D:\ORANT\ORADATA\IDDB2\REDO04.LOG
     2           D:\ORANT\ORADATA\IDDB2\REDO03.LOG
     3           D:\ORANT\ORADATA\IDDB2\REDO02.LOG
     4           D:\ORANT\ORADATA\IDDB2\REDO01.LOG

If STATUS is blank for a member, then the file is in use.

2009년 2월 8일 일요일

Data Dictionary - SYS_TABLES

System Table Description
ALL_ARGUMENTS Arguments in object accessible to the user
ALL_CATALOG All tables, views, synonyms, sequences accessible to the user
ALL_COL_COMMENTS Comments on columns of accessible tables and views
ALL_CONSTRAINTS Constraint definitions on accessible tables
ALL_CONS_COLUMNS Information about accessible columns in constraint definitions
ALL_DB_LINKS Database links accessible to the user
ALL_ERRORS Current errors on stored objects that user is allowed to create
ALL_INDEXES Descriptions of indexes on tables accessible to the user
ALL_IND_COLUMNS COLUMNs comprising INDEXes on accessible TABLES
ALL_LOBS Description of LOBs contained in tables accessible to the user
ALL_OBJECTS Objects accessible to the user
ALL_OBJECT_TABLES Description of all object tables accessible to the user
ALL_SEQUENCES Description of SEQUENCEs accessible to the user
ALL_SNAPSHOTS Snapshots the user can access
ALL_SOURCE Current source on stored objects that user is allowed to create
ALL_SYNONYMS All synonyms accessible to the user
ALL_TABLES Description of relational tables accessible to the user
ALL_TAB_COLUMNS Columns of user's tables, views and clusters
ALL_TAB_COL_STATISTICS Columns of user's tables, views and clusters
ALL_TAB_COMMENTS Comments on tables and views accessible to the user
ALL_TRIGGERS Triggers accessible to the current user
ALL_TRIGGER_COLS Column usage in user's triggers or in triggers on user's tables
ALL_TYPES Description of types accessible to the user
ALL_UPDATABLE_COLUMNS Description of all updatable columns
ALL_USERS Information about all users of the database
ALL_VIEWS Description of views accessible to the user
DATABASE_COMPATIBLE_LEVEL Database compatible parameter set via init.ora
DBA_DB_LINKS All database links in the database
DBA_ERRORS Current errors on all stored objects in the database
DBA_OBJECTS All objects in the database
DBA_ROLES All Roles which exist in the database
DBA_ROLE_PRIVS Roles granted to users and roles
DBA_SOURCE Source of all stored objects in the database
DBA_TABLESPACES Description of all tablespaces
DBA_TAB_PRIVS All grants on objects in the database
DBA_TRIGGERS All triggers in the database
DBA_TS_QUOTAS Tablespace quotas for all users
DBA_USERS Information about all users of the database
DBA_VIEWS Description of all views in the database
DICTIONARY Description of data dictionary tables and views
DICT_COLUMNS Description of columns in data dictionary tables and views
GLOBAL_NAME global database name
NLS_DATABASE_PARAMETERS Permanent NLS parameters of the database
NLS_INSTANCE_PARAMETERS NLS parameters of the instance
NLS_SESSION_PARAMETERS NLS parameters of the user session
PRODUCT_COMPONENT_VERSION version and status information for component products
ROLE_TAB_PRIVS Table privileges granted to roles
SESSION_PRIVS Privileges which the user currently has set
SESSION_ROLES Roles which the user currently has enabled.
SYSTEM_PRIVILEGE_MAP Description table for privilege type codes. Maps privilege type numbers to type names
TABLE_PRIVILEGES Grants on objects for which the user is the grantor, grantee, owner, or an enabled role or PUBLIC is the grantee
TABLE_PRIVILEGE_MAP Description table for privilege (auditing option) type codes. Maps privilege (auditing option) type numbers to type names





A.2.9
 ALL_TABLES

Description of tables accessible to the user:

Column name Description
OWNER Owner of the table
TABLE_NAME Name of the table
TABLESPACE_NAME Name of the tablespace containing the table
CLUSTER_NAME N/A
IOT_NAME Name of the index organized table
PCT_FREE N/A
PCT_USED N/A
INI_TRANS N/A
MAX_TRANS N/A
INITIAL_EXTENT N/A
NEXT_EXTENT N/A
MIN_EXTENTS N/A
MAX_EXTENTS N/A
PCT_INCREASE N/A
FREELISTS Number of process freelists allocated to this segment
FREELIST_GROUPS Number of freelist groups allocated to this segment
LOGGING Logging attribute
BACKED_UP N/A
NUM_ROWS Number of rows in the table
BLOCKS N/A
EMPTY_BLOCKS N/A
AVG_SPACE N/A
CHAIN_CNT N/A
AVG_ROW_LEN Average length of a row in the table in bytes
AVG_SPACE_FREELIST_BLOCKS Average freespace of all blocks on a freelist
NUM_FREELIST_BLOCKS Number of blocks on the freelist
DEGREE Number of threads per instance for scanning the table
INSTANCES Number of instances across which the table is to be scanned
CACHE Whether the cluster is to be cached in the buffer cache
TABLE_LOCK Whether the table locking is enabled or disabled
SAMPLE_SIZE Sample size used in analyzing this table
LAST_ANALYZED Date on which this table was most recently analyzed
PARTITIONED Whether this table is partitioned
IOT_TYPE Whether the table is an index-organized table
TEMPORARY Can the current session only see data that it placed in this object itself?
SECONDARY N/A
NESTED Whether the table is a nested table
BUFFER_POOL Default buffer pool for the object
ROW_MOVEMENT N/A
GLOBAL_STATS N/A
USER_STATS N/A
DURATION N/A
SKIP_CORRUPT N/A
MONITORING N/A
CLUSTER_OWNER N/A
DEPENDENCIES N/A
COMPRESSION N/A


A.2.10
 ALL_TAB_COLUMNS

Columns of all tables, views, and clusters accessible to the user:

Column name Description
OWNER Owner of the table or view
TABLE_NAME Table or view name
COLUMN_NAME Column name
DATA_TYPE Data type of the column
DATA_TYPE_MOD Data type modifier of the column
DATA_TYPE_OWNER Owner of the data type of the column
DATA_LENGTH Maximum length of the column in bytes
DATA_PRECISION N/A
DATA_SCALE Digits to the right of decimal point in a number
NULLABLE Whether the column permits nulls? Value is n if there is a NOT NULL constraint on the column or if the column is part of a PRIMARY key.
COLUMN_ID Sequence number of the column as created
DEFAULT_LENGTH N/A
DATA_DEFAULT N/A
NUM_DISTINCT Number of distinct values in each column of the table
LOW_VALUE For tables with more than three rows, the second lowest and second highest values. These statistics are expressed in hexadecimal notation for the internal representation of the first 32 bytes of the values.
HIGH_VALUE N/A
DENSITY N/A
NUM_NULLS Number of nulls in the column
NUM_BUCKETS Number of buckets in histogram for the column
LAST_ANALYZED Date on which this column was most recently analyzed
SAMPLE_SIZE Sample size used in analyzing this column
CHARACTER_SET_NAME Name of the character set
CHAR_COL_DECL_LENGTH Length of the character set
GLOBAL_STATS N/A
USER_STATS N/A
AVG_COL_LEN Average length of the column (in bytes)
CHAR_LENGTH Displays the length of the column in characters
CHAR_USED N/A


A.2.11
 ALL_TAB_COMMENTS

Comments on tables and views accessible to the user:

Column name Description
OWNER Owner of the object
TABLE_NAME Name of the object
TABLE_TYPE Type of the object
COMMENTS Comments on the object


A.2.12
 ALL_USERS

Information about all users of the database:

Column name Description
USERNAME Name of the user
USER_ID N/A
CREATED N/A


A.2.13
 ALL_VIEWS

Text of views accessible to the user:

Column name Description
OWNER Owner of the view
VIEW_NAME Name of the view
TEXT_LENGTH Length of the view text
TEXT View text. Only the first row of text is returned, even if multiple rows exist.
TYPE_TEXT_LENGTH Length of the type clause of the typed view
TYPE_TEXT Type clause of the typed view
OID_TEXT_LENGTH Length of the WITH OID clause of the typed view
OID_TEXT WITH OID clause of the typed view
VIEW_TYPE_OWNER Owner of the type of the view, if the view is a typed view
VIEW_TYPE Type of the view, if the view is a typed view
SUPERVIEW_NAME N/A




ALL_TABLES

 

ALL_TABLES describes the relational tables accessible to the current user. To gather statistics for this view, use the ANALYZE SQL statement.

Related Views

  • DBA_TABLES describes all relational tables in the database.
  • USER_TABLES describes the relational tables owned by the current user. This view does not display the OWNER column.

Note:

Columns marked with an asterisk (*) are populated only if you collect statistics on the table with the ANALYZE statement or the DBMS_STATS package.
Column Datatype NULL Description
OWNER VARCHAR2(30) NOT NULL Owner of the table
TABLE_NAME VARCHAR2(30) NOT NULL Name of the table
TABLESPACE_NAME VARCHAR2(30)   Name of the tablespace containing the table; NULL for partitioned, temporary, and index-organized tables
CLUSTER_NAME VARCHAR2(30)   Name of the cluster, if any, to which the table belongs
IOT_NAME VARCHAR2(30)   Name of the index-organized table, if any, to which the overflow or mapping table entry belongs. If the IOT_TYPE column is not NULL, then this column contains the base table name.
STATUS VARCHAR2(8)   If a previous DROP TABLE operation failed, indicates whether the table is unusable (UNUSABLE) or valid (VALID)
PCT_FREE NUMBER   Minimum percentage of free space in a block; NULL for partitioned tables
PCT_USED NUMBER   Minimum percentage of used space in a block; NULL for partitioned tables
INI_TRANS NUMBER   Initial number of transactions; NULL for partitioned tables
MAX_TRANS NUMBER   Maximum number of transactions; NULL for partitioned tables
INITIAL_EXTENT NUMBER   Size of the initial extent (in bytes); NULL for partitioned tables
NEXT_EXTENT NUMBER   Size of secondary extents (in bytes); NULL for partitioned tables
MIN_EXTENTS NUMBER   Minimum number of extents allowed in the segment; NULL for partitioned tables
MAX_EXTENTS NUMBER   Maximum number of extents allowed in the segment; NULL for partitioned tables
PCT_INCREASE NUMBER   Percentage increase in extent size; NULL for partitioned tables
FREELISTS NUMBER   Number of process freelists allocated to the segment; NULL for partitioned tables
FREELIST_GROUPS NUMBER   Number of freelist groups allocated to the segment; NULL for partitioned tables
LOGGING VARCHAR2(3)   Indicates whether or not changes to the table are logged; NULL for partitioned tables:
  • YES


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 the ANALYZE SQL statement or the DBMS_STATS package.

Related Views

  • DBA_TAB_COLUMNS describes the columns of all tables, views, and clusters in the database.
  • USER_TAB_COLUMNS describes the columns of the tables, views, and clusters owned by the current user. This view does not display theOWNER column.
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 NUMBER datatype; binary precision forFLOAT datatype; NULL for all other datatypes
DATA_SCALE NUMBER   Digits to the right of the decimal point in a number
NULLABLE VARCHAR2(1)   Indicates whether a column allows NULLs. The 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 anENABLE VALIDATE state.
COLUMN_ID NUMBER   Sequence number of the column as created
DEFAULT_LENGTH NUMBER   Length of the 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 SIZE parameter of the ANALYZE SQL statement. However, Oracle Database does not create a histogram with more buckets than the number of rows in the sample. Also, if the sample contains any values that are very repetitious, Oracle Database creates the specified number of buckets, but the value indicated by this column may be smaller because of an internal compression algorithm.

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

  • NCHAR_CS

CHAR_COL_DECL_LENGTH NUMBER   Declaration length of the character type column
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

  • VARCHAR2

  • NCHAR

  • NVARCHAR

CHAR_USED VARCHAR2(1)   Indicates that the column uses BYTE length semantics (B) orCHAR length semantics (C), or whether the datatype is not any of the following (NULL):
  • CHAR

  • VARCHAR2

  • NCHAR

  • NVARCHAR2

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:
  • NONE

  • FREQUENCY

  • HEIGHT BALANCED



ALL_CONSTRAINTS

ALL_CONSTRAINTS describes constraint definitions on tables accessible to the current user.

Related Views

  • DBA_CONSTRAINTS describes all constraint definitions in the database.

  • USER_CONSTRAINTS describes constraint definitions on tables in the current user's schema.

Column Datatype NULL Description
OWNER VARCHAR2(30) NOT NULL Owner of the constraint definition
CONSTRAINT_NAME VARCHAR2(30) NOT NULL Name of the constraint definition
CONSTRAINT_TYPE VARCHAR2(1)   Type of the constraint definition:
  • C - Check constraint on a table

  • P - Primary key

  • U - Unique key

  • R - Referential integrity

  • V - With check option, on a view

  • O - With read only, on a view

  • H - Hash expression

  • F - Constraint that involves a REF column

  • S - Supplemental logging

TABLE_NAME VARCHAR2(30) NOT NULL Name associated with the table (or view) with the constraint definition
SEARCH_CONDITION LONG   Text of search condition for a check constraint
R_OWNER VARCHAR2(30)   Owner of the table referred to in a referential constraint
R_CONSTRAINT_NAME VARCHAR2(30)   Name of the unique constraint definition for the referenced table
DELETE_RULE VARCHAR2(9)   Delete rule for a referential constraint:
  • CASCADE

  • SET NULL

  • NO ACTION

STATUS VARCHAR2(8)   Enforcement status of the constraint:
  • ENABLED

  • DISABLED

DEFERRABLE VARCHAR2(14)   Indicates whether the constraint is deferrable (DEFERRABLE) or not (NOT DEFERRABLE)
DEFERRED VARCHAR2(9)   Indicates whether the constraint was initially deferred (DEFERRED) or not (IMMEDIATE)
VALIDATED VARCHAR2(13)   Indicates whether all data obeys the constraint (VALIDATED) or not (NOT VALIDATED)
GENERATED VARCHAR2(14)   Indicates whether the name of the constraint is user-generated (USER NAME) or system-generated (GENERATED NAME)
BAD VARCHAR2(3)   Indicates whether this constraint specifies a century in an ambiguous manner (BAD) or not (NULL). To avoid errors resulting from this ambiguity, rewrite the constraint using the TO_DATE function with a four-digit year.

See Also: the TO_DATE function in Oracle Database SQL Language Reference and Oracle Database Advanced Application Developer's Guide

RELY VARCHAR2(4)   Indicates whether an enabled constraint is enforced (RELY) or unenforced (NULL)

See Also: the constraints in Oracle Database SQL Language Reference

LAST_CHANGE DATE   When the constraint was last enabled or disabled
INDEX_OWNER VARCHAR2(30)   Name of the user owning the index
INDEX_NAME VARCHAR2(30)   Name of the index (only shown for unique and primary-key constraints)
INVALID VARCHAR2(7)   Indicates whether the constraint is invalid (INVALID) or not (NULL)
VIEW_RELATED VARCHAR2(14)   Indicates whether the constraint depends on a view (DEPEND ON VIEW) or not (NULL)