首页 > 数据库 >oracle统计表空间语句

oracle统计表空间语句

时间:2022-09-06 17:24:17浏览次数:68  
标签:语句 1024 name bytes 空间 tablespace oracle round 统计表

1、统计单个表所占空间

   select segment_name,round(sum(BYTES)/1024/1024/1024,2) GB  from user_segments
where partition_name like 'DWB_PSUSCPN%'
group by segment_name

使用dba_segments或user_segments都可以
2、查看oracle空间

SELECT a.tablespace_name 表空间名,
round(a.bytes/1024/1024/1024,2) 总空间,
round(b.bytes/1024/1024/1024,2) 使用空间,
round(c.bytes/1024/1024/1024,2) 空闲空间,
d.maxbytes 最大空间,
round((b.bytes * 100) / a.bytes,2) "% USED ",
round((c.bytes * 100) / a.bytes,2) "% FREE "
FROM sys.sm$ts_avail a, sys.sm$ts_used b, sys.sm$ts_free c,
(SELECT tablespace_name,round(SUM(maxbytes) / 1024 / 1024 / 1024, 2) maxbytes FROM dba_data_files GROUP BY tablespace_name) d
WHERE a.tablespace_name = b.tablespace_name
AND a.tablespace_name = c.tablespace_name
AND a.tablespace_name = d.tablespace_name;

 

标签:语句,1024,name,bytes,空间,tablespace,oracle,round,统计表
From: https://www.cnblogs.com/ZJ199012/p/16662537.html

相关文章

  • 5:判断语句
    判断语句C语言把任何非零和非空的值假定为true,把零或null假定为false。if判断#include<stdio.h>intmain(void){/*if(条件){......
  • 如何查询Oracle指定表名所在的表空间是什么?
    场景1:假设你知道完整的表名是student,那么可以使用下面的精确语句查询SELECT*FROMall_tablesWHEREUPPER(table_name)='STUDENT';场景2:假如你只知道表名的一部分,那么......
  • switch 语句
    switch语句switch语句也是多分支语句,它用于基本不同的条件来执行不同的代码。当要只针对变量设置一系列的特定值的选项时,就可以使用switch。语法结构代码案例注意......
  • oracle数据库sql常用语句02
    ---视图---视图的概念:视图就是提供一个查询的窗口,所有数据来自于原表。---查询语句创建表createtableempasselect*fromscott.emp;select*fromemp;---创建视图【......
  • oracle数据库sql常用语句01
    --创建表空间createtablespaceitheimadatafile'c:\itheima.dbf'size100mautoextendonnext10m;--删除表空间droptablespaceitheima;--创建用户createuseritheima......
  • # JS输入输出语句
    JS输入输出语句方法说明归属alert(msg)浏览器弹出警示框浏览器console.log(msg)浏览器控制台打印输出信息浏览器prompt(info)浏览器弹出输出框,用户......
  • Oracle查看锁表sql写法
    --查看锁表进程SQL语句1:selectsess.sid,sess.serial#,lo.oracle_username,lo.os_user_name,ao.object_name,lo.locked_modefrom......
  • msyql 的增删改查之基础语句
    增删改查增删改查的语句命苦为:操作命令增insert删delete改update查select或者show库操作:操作代码创建数据库 CREATEDATABASESshukuk......
  • https://www.oracle.com/au/cloud/free/
      https://www.oracle.com/au/cloud/free/"OracleCloudFree"免费云在线注册关于个人应用的用户在注册和试用的过程中遇到任何问题,公司统一是由一个全球的专门的......
  • MySQL语句语法汇总
    一、数据库基础操作1.数据库操作——创建、删除、切换、查看当前选择的数据库createdatabase数据库名charset=utf8;//创建数据库dropdatabase数据库名;//删......