oracle 10 数据库系统表应用

---查询共有多少个系统owner
select distinct owner from all_tab_comments t
--查询某个owner的所有表
select * from all_tab_comments t where owner='MARINEADMIN'
----列信息
select * from all_col_comments t where owner='MARINEADMIN'
--主键、外键对照
select OWNER, CONSTRAINT_NAME, CONSTRAINT_TYPE, TABLE_NAME, R_OWNER, R_CONSTRAINT_NAME from all_constraints
where owner='MARINEADMIN' and (Constraint_Type='P' or Constraint_Type='R')
--主键、外键信息
select * from all_cons_columns where owner='MARINEADMIN' order by Constraint_Name, Position
--每个表的数据行数
select owner,table_name,tablespace_name,num_rows from dba_all_tables t where t.owner='MARINEADMIN'
--当前数据库用户(current schema -----marineadmin)下的用户表
select * from user_tables where tablespace_name='ZTK'
-- 所有表,字段名,类型,长度
select * from user_tab_columns order by table_name desc
--表示所有该用户可以访问的表
select * from all_tables
--是视图
select * from user_views
select * from all_views
--视图所有列信息
select * from user_tab_columns where table_name in (select view_name from user_views)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值