zoukankan      html  css  js  c++  java
  • 转: Oracle表空间查询

     

    1、查询数据库中的表空间名称

    1)查询所有表空间

    select tablespace_name from dba_tablespaces; 
    select tablespace_name from user_tablespaces; 

    2)查询使用过的表空间  

    select distinct tablespace_name from dba_all_tables;

    select distinct tablespace_name from user_all_tables; 

    2、查询表空间中所有表的名称

    select table_name from dba_all_tables where tablespace_name = tablespacename

    3、查询系统用户

    select * from all_users
    select * from dba_users

    4、查看当前连接用户

    select * from v$session

    5、查看当前用户权限

    select * from session_privs

    6、查看所有的函数和存储过程

    select * from user_source

    其中TYPE包括:PROCEDURE、FUNCTION

    7、查看表空间使用情况

    select a.file_id "FileNo",
           a.tablespace_name "表空间",
           a.bytes "Bytes",
           a.bytes - sum(nvl(b.bytes, 0)) "已用",
           sum(nvl(b.bytes, 0)) "空闲",
           sum(nvl(b.bytes, 0)) / a.bytes * 100 "空闲百分率"
      from dba_data_files a, dba_free_space b
     where a.file_id = b.file_id(+)
     group by a.tablespace_name, a.file_id, a.bytes
     order by a.tablespace_name;

  • 相关阅读:
    hdu 2082 找单词
    hdu 2079 选课时间(题目已修改,注意读题)
    hdu 2073 无限的路
    hdu 2062 Subset sequence
    poj 2777 Count Color
    hdu 2067 小兔的棋盘
    卡特兰数
    poj3468
    hdu1394
    hdu1166(线段树之单点更新)
  • 原文地址:https://www.cnblogs.com/atuotuo/p/4629887.html
Copyright © 2011-2022 走看看