select *
  from (Select a.tablespace_name,
               to_char(a.bytes / 1024 / 1024, '99,999.999') total_bytes,
               to_char(b.bytes / 1024 / 1024, '99,999.999') free_bytes,
               to_char(a.bytes / 1024 / 1024 - b.bytes / 1024 / 1024,
                       '99,999.999') use_bytes,
               to_char((1 - b.bytes / a.bytes) * 100, '99.99') || '%' use
          from (select tablespace_name, sum(bytes) bytes
                  from dba_data_files
                 group by tablespace_name) a,
               (select tablespace_name, sum(bytes) bytes
                  from dba_free_space
                 group by tablespace_name) b
         where a.tablespace_name = b.tablespace_name
        union all
        select c.tablespace_name,
               to_char(c.bytes / 1024 / 1024, '99,999.999') total_bytes,
               to_char((c.bytes - d.bytes_used) / 1024 / 1024, '99,999.999') free_bytes,
               to_char(d.bytes_used / 1024 / 1024, '99,999.999') use_bytes,
               to_char(d.bytes_used * 100 / c.bytes, '99.99') || '%' use
          from (select tablespace_name, sum(bytes) bytes
                  from dba_temp_files
                 group by tablespace_name) c,
               (select tablespace_name, sum(bytes_cached) bytes_used
                  from v$temp_extent_pool
                 group by tablespace_name) d
         where c.tablespace_name = d.tablespace_name)
 order by tablespace_name;

Oracle 查询表空间使用情况的更多相关文章

  1. Oracle查询表空间使用情况

    --查询表空间使用情况 SELECT UPPER(F.TABLESPACE_NAME) "表空间名", D.TOT_GROOTTE_MB "表空间大小(M)", ...

  2. Oracle查询表空间使用情况的一个sql

    select  t1.tablespace_name,curr_b/1024/1024/1024,max_b/1024/1024/1024,curr_b/max_b from(select table ...

  3. oracle增加表空间的四种方法,查询表空间使用情况

    增加表空间大小的四种方法Meathod1:给表空间增加数据文件ALTER TABLESPACE app_data ADD DATAFILE'D:\ORACLE\PRODUCT\10.2.0\ORADA ...

  4. Oracle查询表空间使用率很慢

    Oracle查询表空间使用率很慢 问题描述 执行查询表空间的语句,需要接近2min的时间才能执行完成. 以前也在其他客户的生产库遇到过一样的情况,当时是由于回收站的内容过多引起的. 不过这次的情况却不 ...

  5. ORACLE ASM中查询表空间使用情况、数据文件路径、裸设备磁盘总大小剩余大小

    在ASM中:查询所有磁盘名称.总大小.剩余大小:单位MB-----查看组的信息(总大小)select name,total_mb, free_mb from v$asm_diskgroup; ---查 ...

  6. 查看Oracle表空间使用情况与增大表空间

    1,查看表空间使用情况 SELECT D.TABLESPACE_NAME, SPACE || 'M' "SUM_SPACE(M)", BLOCKS "SUM_BLOCKS ...

  7. 查看Oracle表空间使用情况

    1.查询表空间的总容量 as MB from sys.dba_data_files a group by a.TABLESPACE_NAME 2.查询表空间的空闲容量 select b.TABLESP ...

  8. linux系统下oracle表空间占用情况

    1.我们先查询表空间的占用情况,使用sql如下: select upper(f.tablespace_name) "表空间名", d.tot_grootte_mb "表空 ...

  9. oracle 表空间使用情况

    --表空间使用情况 SELECT a.tablespace_name "表空间名", round(total/1024/1024,2) "表空间大小", rou ...

随机推荐

  1. 使用gethostname()函数和gethostbyname()函数获取主机相关信息

    gethostname() : 返回本地主机的标准主机名. 原型如下: #include <unistd.h> int gethostname(char *name, size_t len ...

  2. linux下c通过虚拟地址映射读写文件的代码

    在代码过程中中,把开发过程中比较好的一些代码片段记录起来,如下的代码内容是关于 linux下c通过虚拟地址映射读写文件的代码,应该对小伙伴有些好处.#include<stdio.h>#in ...

  3. canal-随记001-吐血一个下午找bug

    前天leader说,阿里的新版本canal支持 canal收集binlog直接发到kafka,你要不研究一下? ok,没问题. 昨天周六,在家搭了套环境.解决centos7安装mysql各种小细节,按 ...

  4. cocoapods 创建公开公共库

    1 :首先安装了 pod,sourceTree(下载地址https://pan.baidu.com/s/1c1Wc5ck), 并在开元中国申请的 git 账号 2 :打开终端: cd 文件目录地址(任 ...

  5. node 和 npm 常用命令

    npm node 简述 快速入门 安装npm和管理npm版本 npm安装 更新npm npm -v npm install npm@latest -g npm install npm@next -g ...

  6. Python3——坦克大战

    # coding=utf-8 # Version:python3.6.1 __date__ = '2018/9/20 18:51' __author__ = 'Lgsp_Harold' import ...

  7. POSIX-Data Structure

    struct sigevent The <signal.h> header shall define the sigeventstructure, which shall include ...

  8. in 索引失效的问题

    先安利一篇博文MySQL的or/in/union与索引优化 简单的in查询 索引失效: 步骤 1.检查建立索引没有 order_status 字段为普通索引的tinyint类型 2.检查是否使用了使索 ...

  9. 回文数(vector的使用)

    问题描述一个正整数,如果交换高低位以后和原数相等,那么称这个数为回文数.比如 121,2332 都是回文数,134567 不是回文数. 任意一个正整数,如果其不是回文数,将该数交换高低位以后和原数相加 ...

  10. Linux-day1-上课笔记

    命令的组成 命令关键字 [选项] [参数] 注意: 1. 通常情况下 选项- --连接 ls -l /etc 2. - 选项和选项之间是可以合并的 ls -ld /etc ls 罗列文件   常见的选 ...