Oracle数据库 数据字典

这篇博客介绍了Oracle数据库中如何查询用户对象,包括用户表、对象、约束、视图和序列。还讲解了如何使用`COMMENT ON`语句为表添加注释,并展示了查询表注释的方法。涉及的关键技术包括数据字典、动态性能视图以及对象管理。
摘要由CSDN通过智能技术生成
select * from user_tables;
select * from dictionary;
-- 数据字典的命名规则:
   前缀    说明
   user  用户自定义
   DBA   管理员视图
   ALL   用户可访问
   V$    动态性能视图
-- 查询当前用户创建的表
select * from user_tables;
-- 数据库对象
   user_objects 和 all_objects
select * from user_objects;
select * from all_objects;--应该是2
-- 表
   user_tables 和 all_tables;
select * from user_tables;
select * from all_tables;--应该是6
select * from DUAL;
-- 约束:user_constrains
select * from user_constraints;
-- 视图:user_views 和 all_views
select * from user_views;
select * from all_views;--7
-- 序列:user_sequences
select * from user_sequences;


-- 给表添加注释
-- 使用comment语句给表或列添加注释
-- 表的注释: comment on table 表名 is'注释内容';
comment on table emp is'This is the employees information';
-- 相关视图
All_Col_Comments
User_Col_Comments
All_Tab_Comments
User_Tab_Comments

select * from user_tab_comments where table_name = 'DEPT'; -- table_name中的内容要大写
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值