DICT in Oracle Data Dictionary View

Source: Internet
Author: User
[VIEW] DICT_COLUMNS2010-10-1322 of Oracle Data Dictionary VIEW: 41: 31 individual classification: Oracle VIEW (489) Comment (0) score (00) DICT_COLUMNS VIEW records the information of the data dictionary table field, is an effective supplement to the DICT view. This view is an effective means of self-learning and prompting. 1. DICT_COLU

[VIEW] DICT_COLUMNS of Oracle Data Dictionary VIEW/22:41:31/personal classification: Oracle VIEW (489)/comment (0)/score (0/0) the DICT_COLUMNS view records the field information of the data dictionary table, which is an effective supplement to the DICT view. This view is an effective means of self-learning and prompting. 1. DICT_COLU

[VIEW] DICT_COLUMNS of Oracle Data Dictionary VIEW

/22:41:31/personal classification: Oracle

View (489)/comment (0)/score (0/0)

DICT_COLUMNSView records Data DictionaryThe table field information is an effective supplement to the DICT view. The ViewIt is an effective means of self-learning and prompting.

1. DICT_COLUMNS view Function
1) The COMMENTS field can be used to obtain the field description information, which helps the field to be deeply understood.
Sys @ ora10g> select * from dict_columns where TABLE_NAME = 'dict ';

TABLE_NAME COLUMN_NAME COMMENTS
-------------------------------------------------------------------
DICT TABLE_NAME Name of the object
Dict comments Text comment on the object

2) which tables in the query contain the specified fields?
Sys @ ora10g> select * from dict_columns where COLUMN_NAME = 'table _ name' and rownum <4;

TABLE_NAME COLUMN_NAME COMMENTS
--------------------------------------------------------------------
USER_CATALOG TABLE_NAME Name of the object
ALL_CATALOG TABLE_NAME Name of the object
DBA_CATALOG TABLE_NAME Name of the object

3) query which tables have many fields
Sys @ ora10g> SELECT *
FROM (SELECT table_name, COUNT (*)
FROM dict_columns
Group by table_name
Order by 2 DESC)
Where rownum <10;

TABLE_NAME COUNT (*)
----------------------------------------
GV $ SESSION 81
V $ SESSION 80
GV $ SQL 72
V $ SQL 71
GV $ SQL _PLAN_STATISTICS_ALL 69
GV $ SQLAREA 68
V $ SQL _PLAN_STATISTICS_ALL 68
GV $ DISPATCHER_RATE 67
V $ SQLAREA 67

9 rows selected.

From the preceding query, we can see that the GV $ SESSION view contains a maximum of 81 fields!
This method can also be used DatabaseDesign Evaluation: Review tables that contain too many columns to prevent design defects.

2. View DICT_COLUMNS source -- catalog. SQL
We can find the creation Statement of DICT_COLUMNS in the catalog. SQL script, which is very helpful for understanding the implementation of DICT_COLUMNS.
Create or replace ViewDICT_COLUMNS
(TABLE_NAME, COLUMN_NAME, COMMENTS)
As
Select o. name, c. name, co. comment $
From sys.com $ co, sys. col $ c, sys. obj $ o
Where o. owner # = 0
And o. type # = 4
And (o. name like 'user %'
Or o. name like 'All %'
Or (o. name like 'dba %'
And exists
(Select null
From sys. v $ enabledprivs
Where priv_number =-47/* select any table */)
)
)
And o. obj # = c. obj #
And c. obj # = co. obj # (+)
And c. col # = co. col # (+)
And bitand (c. property, 32) = 0/* not hidden column */
Union all
Select o. name, c. name, co. comment $
From sys.com $ co, sys. col $ c, sys. obj $ o
Where o. owner # = 0
And o. name in ('audit _ ACTIONS ', 'dual', 'dictionary', 'dict _ COLUMNS ')
And o. obj # = c. obj #
And c. obj # = co. obj # (+)
And c. col # = co. col # (+)
And bitand (c. property, 32) = 0/* not hidden column */
Union all
Select so. name, c. name, co. comment $
From sys.com $ co, sys. col $ c, sys. obj $ ro, sys. syn $ sy, sys. obj $ so
Where so. type # = 5
And so. owner # = 1
And so. obj # = sy. obj #
And so. name <> sy. name
And sy. owner = 'sys'
And sy. name = ro. name
And ro. owner # = 0
And ro. type # = 4
And ro. obj # = c. obj #
And c. col # = co. col # (+)
And bitand (c. property, 32) = 0/* not hidden column */
And c. obj # = co. obj # (+)
/
Comment on table DICT_COLUMNS is
'Description of columns in DataDictionary tables and views'
/
Comment on column DICT_COLUMNS.TABLE_NAME is
'Name of the object that contains the column'
/
Comment on column DICT_COLUMNS.COLUMN_NAME is
'Name of the column'
/
Comment on column DICT_COLUMNS.COMMENTS is
'Text comment on the Object'
/
Create or replace public synonym DICT_COLUMNS for DICT_COLUMNS
/
Grant select on DICT_COLUMNS to PUBLIC with grant option
/

3. description in the oracle Official Document
Reference: http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_4195.htm#sthref1972
DICT_COLUMNS

DICT_COLUMNSContains descriptions of columns in data dictionary tables and views.

Column Datatype NULL Description
TABLE_NAME VARCHAR2(30) Name of the object that contains the column
COLUMN_NAME VARCHAR2(30) Name of the column
COMMENTS VARCHAR2(4000) Text comment on the column


4. Other views related to table field descriptions
Based on the functions of the DICT_COLUMNS view, we can use the DICT view in the system to obtain views related to table fields.
Sys @ ora10g> select table_name from dict where table_name like '% COLUMNS %' order by 1;

TABLE_NAME
------------------------------
ALL_APPLY_CONFLICT_COLUMNS
ALL_APPLY_KEY_COLUMNS
ALL_APPLY_TABLE_COLUMNS
ALL_AUDIT_POLICY_COLUMNS
ALL_CONS_COLUMNS
ALL_CONS_OBJ_COLUMNS
ALL_ENCRYPTED_COLUMNS
ALL_IND_COLUMNS
ALL_JOIN_IND_COLUMNS
ALL_LOG_GROUP_COLUMNS
ALL_PART_KEY_COLUMNS
ALL_PUBLISHED_COLUMNS
ALL_REPFLAVOR_COLUMNS
ALL_REPKEY_COLUMNS
ALL_SUBPART_KEY_COLUMNS
ALL_SUBSCRIBED_COLUMNS
ALL_TAB_COLUMNS
ALL_UPDATABLE_COLUMNS
DBA_APPLY_CONFLICT_COLUMNS
DBA_APPLY_KEY_COLUMNS
DBA_APPLY_TABLE_COLUMNS
DBA_AUDIT_POLICY_COLUMNS
DBA_CLU_COLUMNS
DBA_CONS_COLUMNS
DBA_CONS_OBJ_COLUMNS
DBA_ENCRYPTED_COLUMNS
DBA_IND_COLUMNS
DBA_JOIN_IND_COLUMNS
DBA_LOG_GROUP_COLUMNS
DBA_OLDIMAGE_COLUMNS
DBA_PART_KEY_COLUMNS
DBA_PUBLISHED_COLUMNS
DBA_REPFLAVOR_COLUMNS
DBA_REPKEY_COLUMNS
DBA_SUBPART_KEY_COLUMNS
DBA_SUBSCRIBED_COLUMNS
DBA_TAB_COLUMNS
DBA_UPDATABLE_COLUMNS
DICT_COLUMNS
USER_AUDIT_POLICY_COLUMNS
USER_CLU_COLUMNS
USER_CONS_COLUMNS
USER_CONS_OBJ_COLUMNS
USER_ENCRYPTED_COLUMNS
USER_IND_COLUMNS
USER_JOIN_IND_COLUMNS
USER_LOG_GROUP_COLUMNS
USER_OLDIMAGE_COLUMNS
USER_PART_KEY_COLUMNS
USER_PUBLISHED_COLUMNS
USER_REPFLAVOR_COLUMNS
USER_REPKEY_COLUMNS
USER_SUBPART_KEY_COLUMNS
USER_SUBSCRIBED_COLUMNS
USER_TAB_COLUMNS
USER_UPDATABLE_COLUMNS

56 rows selected.

5. Summary
OracleIt provides many ways for self-understanding and learning. Many views are Tools.

Good luck.

Secooler
10.10.13

-- The End --



From http://space.itpub.net/519536/viewspace-571453

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.