---
title: "查询表空间"
author: "fxyc"
date: "2011-05-17T15:15:54Z"
tags: []
categories: ["数据库"]
slug: "untitled"
draft: false
lastmod: "2011-05-17T15:15:54Z"
id: 1047091
url: "https://fxyc.iteye.com/blog/1047091"
---

```
　　SELECT a.tablespace_name "表空间名",round(total/1024/1024/1024,4) "表空间大小Gb",round(free/1024/1024/1024,4) "表空间剩余大小Gb",
　　round((total-free)/1024/1024/1024,4) "表空间使用大小Gb",
　　ROUND((total-free)/total,4)*100 "使用率 %"
　　FROM  (SELECT tablespace_name,SUM(bytes) free FROM DBA_FREE_SPACE
　　GROUP BY tablespace_name ) a,
　　(SELECT tablespace_name,SUM(bytes) total FROM DBA_DATA_FILES
　　GROUP BY tablespace_name) b
　　WHERE a.tablespace_name=b.tablespace_name  order by 5 desc
```