Oracle 查询表空间占用率超时

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

环境:Oracle 11g问题描述:在数据库中执行查看表空间利用率语句如下: select d.tp_name 表空间名,e.contents 类型,e.sta

环境:Oracle 11g

问题描述:在数据库中执行查看表空间利用率语句如下:

select d.tp_name 表空间名,e.contents 类型,e.status 状态, e.extent_management 区管理,

b.bytes 大小m, b.bytes-d.bytes 已使用m,(b.bytes-d.bytes)*100/b.bytes 占用率

from (select c.tablespace_name tp_name,sum(c.bytes)/1024/1024 bytes

from dba_free_space c

group by c.tablespace_name) d,

(select a.tablespace_name tp_name,sum(a.bytes)/1024/1024 bytes

from dba_data_files a

group by a.tablespace_name) b,

(select tablespace_name tp_name,contents,status,extent_management

from dba_tablespaces )e

where d.tp_name=b.tp_name and d.tp_name=e.tp_name

order by 7;

执行1个半小时以后以超时而告终。于是我想看看该语句所用到的视图情况,执行select count(*) from dba_free_space,发现执行该语句也是很长一段时间没有反应。

原因:咨询oracle工程师得出结论:由于视图DBA_RECYCLE中数据量很大,导致dba_free_space中数据量过亿,,需要清理DBA_RECYCLE中的垃圾数据:切换到sys用户下面,执行purge DBA_RECYCLE;执行了一天2夜,执行完毕以后,再次查询数据库表空间,很快变得出结论。

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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!