时间:2021-07-01 10:21:17 帮助过:20人阅读
前缀 |
说明 |
USER |
用户自己的 |
ALL |
用户可以访问到的 |
DBA |
管理员视图 |
V$ |
性能相关的数据 |
从DICTIONARY开始,这个数据对象包含了数据字典的表名和说明
DESCRIBE DICTIONARY
SELECT*
FROM dictionary
WHERE table_name= ‘USER_OBJECTS‘;
USER_OBJECTS视图:
SELECTobject_name,object_type,created, status
FROM user_objects
ORDERBY object_type;
ALL_OBJECTS:
?可以通过查询ALL_OBJECTS来确定当前用户能访问的数据对象USER_TABLES 用户自己的表:
DESCRIBE user_tables
SELECTtable_name
FROM user_tables;
DESCRIBEuser_tab_columns
SELECT column_name,data_type,data_length,
data_precision,data_scale,nullable
FROM user_tab_columns
WHERE table_name= ‘EMPLOYEES‘;
DESCRIBE user_constraints
SELECT constraint_name,constraint_type,
search_condition,r_constraint_name,
delete_rule,status
FROM user_constraints
WHERE table_name= ‘EMPLOYEES‘;
DESCRIBE user_cons_columns
SELECT constraint_name,column_name
FROM user_cons_columns
WHERE table_name= ‘EMPLOYEES‘;
DESCRIBE user_views
SELECTDISTINCT view_nameFROM user_views;
SELECT text FROM user_views
WHERE view_name= ‘EMP_DETAILS_VIEW‘;
DESCRIBE user_sequences
SELECT sequence_name,min_value,max_value,
increment_by,last_number
FROM user_sequences;
?LAST_NUMBER表示当没有使用NOCAHCE时,下一个可用的值
DESCRIBE user_synonyms
SELECT*
FROM user_synonyms;
COMMENTON TABLE employees
IS ‘Employee Information‘;
Commentcreated.
?注释相关的视图: ?ALL_COL_COMMENTS ?USER_COL_COMMENTS ?ALL_TAB_COMMENTS ?USER_TAB_COMMENTS ?查询表的注释 ?select * from user_tab_commentswhere table_name=‘???‘;Oracle学习(13):数据字典
标签:oracle 数据字典 dba