Home > Database > Mysql Tutorial > body text

Oracle表空间相关查询

WBOY
Release: 2016-06-07 17:00:25
Original
1094 people have browsed it

1. 查表空间名字、大

1. 查表空间名字、大小、已用大小、未用大小、已用百分比、未用百分比

select tablespace_name, sum(totalM), sum(usedM), sum(remainedM),
           sum(usedM) / sum(totalM) * 100, sum(remainedM) / sum(totalM) * 100
from
(
  select b.file_id, b.tablespace_name, b.file_name,
  b.bytes / 1024 / 1024  totalM,
  ( b.bytes - sum( nvl( a.bytes, 0) ) ) / 1024 / 1024 usedM,
  sum( nvl(a.bytes,0) ) / 1024 / 1024  remainedM,
  sum( nvl(a.bytes,0) ) / (b.bytes) * 100 usedPer,
  (100-sum( (nvl(a.bytes,0) ) / (b.bytes) * 100)) remainedPer
  from dba_free_space a, dba_data_files b
  where a.file_id = b.file_id
  group by b.tablespace_name, b.file_name, b.file_id, b.bytes
  order by b.tablespace_name
)
group by tablespace_name

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template