如何使用 SQL 查询显示 Oracle 模式大小? [英] How to display Oracle schema size with SQL query?

查看:58
本文介绍了如何使用 SQL 查询显示 Oracle 模式大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含 70 多个表的 Oracle 架构.我想创建一个简单的页面,可以显示表占用的硬盘空间.如何使用 SQL 查询获取此值?

I have a Oracle schema with 70+ tables. I want to create simple page which can display the HDD space occupied by the tables. How I can get this value with SQL query?

附言以及如何获得 Oracle 架构版本?

P.S And how I can get the Oracle architecture version?

推荐答案

你可能想要

SELECT sum(bytes)
  FROM dba_segments
 WHERE owner = <<owner of schema>>

如果您以架构所有者身份登录,您还可以

If you are logged in as the schema owner, you can also

SELECT SUM(bytes)
  FROM user_segments

这将为您提供分配给用户拥有的对象在它们所在的任何表空间中的空间.分配给表的空间可能会被这些查询计为已分配.

That will give you the space allocated to the objects owned by the user in whatever tablespaces they are in. There may be empty space allocated to the tables that is counted as allocated by these queries.

这篇关于如何使用 SQL 查询显示 Oracle 模式大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆