Oracle 数据字典
关于表、表字段的数据字典
说明:user_tables、all_tables、dba_tables关系:
user_tables :可查询当前用户的表;
all_tables :可查询所有用户的表;
dba_tables:可查询包括系统表在内的所有表;只有dba角色可查询
1获取表:
2
3select * from user_tables; // 当前用户的表
4
5select * from all_tables; // 所有用户的表
6
7select * from dba_tables; // 包括系统表(dba角色可见)
8
9获取表注释:
10
11select * from user_tab_comments;
12
13select * from all_tab_comments;
14
15select * from dba_tab_comments;
16
17
18获取表字段:
19
20select * from user_tab_columns where table_name='用户表名';
21
22select * from all_tab_columns where table_name='用户表名';
23
24select * from dba_tab_columns where table_name='用户表';
25
26获取字段注释:
27
28select * from user_col_comments;
29
30select * from all_col_comments;
31
32select * from dba_col_comments;
关于用户的数据字典
说明:user_users、all_users、dba_users 关系:
user_users :描述当前用户;
all_users :列出数据库中对当前用户可见的所有用户;
dba_users :描述数据库中所有用户;只有dba角色可查询
1查看当前用户信息(用户名、默认表空间等):
2select * from user_users
3
4查看当前用户可见的所有用户信息:
5select * from all_users
6
7
8查看所有用户信息(dba角色可见):
9select * from dba_users
关于表空间的数据字典
1查看数据库中所有的表空间(dba角色可见):
2select * from dba_data_files
3或
4select * from dba_tablespaces
评论