1、用户
  查看当前用户的缺省表空间
  SQL>select username,default_tablespace from user_users;
  查看当前用户的角色
  SQL>select * from user_role_privs;
  查看当前用户的系统权限和表级权限
  SQL>select * from user_sys_privs;
  SQL>select * from user_tab_privs;
  显示当前会话所具有的权限
  SQL>select * from session_privs;
  显示指定用户所具有的系统权限
  SQL>select * from dba_sys_privs where grantee='GAME';
  2、表
  查看用户下所有的表
  SQL>select * from user_tables;
  查看名称包含log字符的表
  SQL>select object_name,object_id from user_objects
  where instr(object_name,'LOG')>0;
  查看某表的创建时间
  SQL>select object_name,created from user_objects where object_name=upper('&table_name');
  查看某表的大小
  SQL>select sum(bytes)/(1024*1024) as "size(M)" from user_segments
  where segment_name=upper('&table_name');
  查看放在Oracle的内存区里的表
  SQL>select table_name,cache from user_tables where instr(cache,'Y')>0;
  3、索引
  查看索引个数和类别
  SQL>select index_name,index_type,table_name from user_indexes order by table_name;
  查看索引被索引的字段
  SQL>select * from user_ind_columns where index_name=upper('&index_name');
  查看索引的大小
  SQL>select sum(bytes)/(1024*1024) as "size(M)" from user_segments
  where segment_name=upper('&index_name');
  4、序列号
  查看序列号,last_number是当前值
  SQL>select * from user_sequences;
  5、视图
  查看视图的名称
  SQL>select view_name from user_views;
  查看创建视图的select语句
  SQL>set view_name,text_length from user_views;
  SQL>set long 2000; 说明:可以根据视图的text_length值设定set long 的大小
  SQL>select text from user_views where view_name=upper('&view_name');
  6、同义词
  查看同义词的名称
  SQL>select * from user_synonyms;
  7、约束条件
  查看某表的约束条件
  SQL>select constraint_name, constraint_type,search_condition, r_constraint_name
  from user_constraints where table_name = upper('&table_name');
  SQL>select c.constraint_name,c.constraint_type,cc.column_name
  from user_constraints c,user_cons_columns cc
  where c.owner = upper('&table_owner') and c.table_name = upper('&table_name')
  and c.owner = cc.owner and c.constraint_name = cc.constraint_name
  order by cc.position;
  8、存储函数和过程
  查看函数和过程的状态
  SQL>select object_name,status from user_objects where object_type='FUNCTION';
  SQL>select object_name,status from user_objects where object_type='PROCEDURE';
  查看函数和过程的源代码
  SQL>select text from all_source where owner=user and name=upper('&plsql_name');

http://blog.csdn.net/qq_37723153/article/details/70766939

oracle如何查看表空间的更多相关文章

  1. Oracle数据库查看表空间sql语句

    转: Oracle数据库查看表空间sql语句 2018-09-03 15:49:51 兰海泽 阅读数 6212   版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出 ...

  2. 【总结】Oracle数据库 查看表空间和增加表空间

    一.Oracle查看 表空间 的名称及其大小 查看 表空间的名称及其大小的SQL语句: select t1.tablespace_name,round(sum(bytes/(1024*1024)),0 ...

  3. 【Oracle】查看表空间是否为自动扩展

    查看指定的表空间是否为自动扩展 SQL>   select file_name,autoextensible,increment_by from dba_data_files where tab ...

  4. Oracle数据库查看表空间是否为自增的

    表空间是有数据文件组成的,所以看表空间是否自增即看数据文件,如下查自增的表空间: select tablespace_name,file_name,autoextensible from dba_da ...

  5. oracle怎么查看表空间里有哪些表

    select TABLE_NAME,TABLESPACE_NAME from dba_tables where TABLESPACE_NAME='表空间名'; 注意:表空间名要大写

  6. 【oracle】查看表空间对应文件所在位置

    select file_name , tablespace_name from dba_data_files;select * from dba_data_files;

  7. ORACLE查看表空间对象

    ORACLE如何查看表空间存储了那些数据库对象呢?可以使用下面脚本简单的查询表空间存储了那些对象: SELECT TABLESPACE_NAME       AS TABLESPACE_NAME    ...

  8. Oracle以及SDE维护常用命令-查看表空间等

    之前现场反馈一个数据更新的问题,查看感觉是因为表空间满了导致的(错误在之前的博客随笔中写过),因此远程对服务器进行查看.个人平常都是通过Oracle客户端的Entreprise Manager Con ...

  9. Oracle 查看表空间的大小及使用情况sql语句

    --1.查看表空间的名称及大小 )), ) ts_size FROM dba_tablespaces t, dba_data_files d WHERE t.tablespace_name = d.t ...

随机推荐

  1. jq .attr()和.prop()方法的区别

    今天在nodejs交流群里面遇到别人在里面说面试的时候遇到了这个问题,没回答出来,面试官讲的他也不明白,这个问题看着很简单,但是往深的解释就很难了. 对于HTML元素本身就带有的固有属性,在处理时,使 ...

  2. redis中文文档

    phpredis是php的一个扩展,效率是相当高有链表排序功能,对创建内存级的模块业务关系 很有用;以下是redis官方提供的命令使用技巧: 下载地址如下: https://github.com/ow ...

  3. HTML中table边框的显示总结

    一.1.显示表格的4个边框:<table border frame=box>2.只显示上边框: <table border frame=above>3.只显示下边框: < ...

  4. 80X86寄存器详解<转载>

    引子 打算写几篇稍近底层或者说是基础的博文,浅要介绍或者说是回顾一些基础知识, 自然,还是得从最基础的开始,那就从汇编语言开刀吧, 从汇编语言开刀的话,我们必须还先要了解一些其他东西, 像  CPU ...

  5. 获取浏览器的相关信息(navigator)

    * 智能机浏览器版本信息: * */ var browser = { versions: function() { var u = navigator.userAgent + navigator.ap ...

  6. 在CentOS6.4中安装配置LAMP环境的详细步骤 - Leroy-LIZH

    本文详细介绍了CentOS6.4系统中安装LAMP服务并对其进行配置的过程,即安装Apache+PHP+Mysql,参照了网上大神的设置,其他Linux发行系统可以参考~ 在本文中部分命令操作需要ro ...

  7. 阿里云分布式缓存OCS与DB之间的数据一致性

    [分布式系统的数据一致性问题]   OCS概要介绍 据AlertSite网络分析公司表示,Facebook的响应时间在2010年平均为1秒钟,到2011年中期已提高到了0.73秒.对比来看,响应时间占 ...

  8. jsp: jstl标签库

    jstl标签库,通过maven配置: <!-- jstl标签的支持 --> <dependency> <groupId>javax.servlet</grou ...

  9. 2017-02-20 安装Sql Server2016+配置Java环境

    昨天在安装Sql Server 2016时,在前面的规则检查结果中,出现“Polybase要求安装Oracle JRE7更新51(64位)或更高版本”规则失败的错误,如图 解决方案为,下载安装jdk, ...

  10. hdu 2509 Be the Winner(anti nim)

    Be the Winner Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tot ...