zoukankan      html  css  js  c++  java
  • Script To Get Tablespace Utilization In Oracle Database 12c

    This is a script to get the tablespace utilization in Oracle Database 12c. You can use this script to get the tablespace utilization ALLOCATED(MB), USED(MB) and Used parentage for all containers tablespaces.

    sqlplus -s / as sysdba
    
    set pages 80
    set lin 120
    set echo off
    set feed off
    column PCT format 999.99
    column tbspce format A30
    col container for a30
    select substr(f.tablespace_name,1,30) tbspce,
         round(f.tsbytes/(1024*1024),0) "ALLOCATED(MB)",
         round(nvl(s.segbytes,0)/(1024*1024),0) "USED(MB)",
         round((nvl(s.segbytes,0)/f.tsbytes)*100,2) PCT,
         lower(vc.name) as container
    from
       (select con_id,tablespace_name,sum(bytes) tsbytes from cdb_data_files group by con_id,tablespace_name) f,
       (select con_id,tablespace_name,sum(bytes) segbytes from cdb_segments group by con_id,tablespace_name) s,
       v$containers vc
    where f.con_id=s.con_id(+)
      and f.tablespace_name=s.tablespace_name(+)
      and f.con_id=vc.con_id
    order by container, tbspce;
    喜欢请赞赏一下啦^_^

    微信赞赏

    支付宝赞赏

  • 相关阅读:
    Android TTS
    观察者模式(C++实现)
    android 8未知来源app安装
    NotificationChannel
    java底层知识
    Java14
    数据库分区、分库分表
    二叉搜索树的第k大节点
    从上到下按层打印二叉树
    springcloud面试知识点
  • 原文地址:https://www.cnblogs.com/lkj371/p/15319412.html
Copyright © 2011-2022 走看看