当前位置: 首页 > article >正文

oracle 11g SYSAUX表空间清理

oracle 11g SYSAUX表空间清理

SELECT OCCUPANT_NAME "Item",SPACE_USAGE_KBYTES / 1048576 "Space Used (GB)",SCHEMA_NAME "Schema",MOVE_PROCEDURE "Move Procedure"FROM V$SYSAUX_OCCUPANTS WHERE SPACE_USAGE_KBYTES > 1048576 ORDER BY "Space Used (GB)" DESC;

select * from (select segment_name,PARTITION_NAME,segment_type,bytes/1024/1024 from dba_segments where tablespace_name='SYSAUX' order by 4 desc) where rownum<=10;

SEGMENT_NAME                        PARTITION_NAME                                               SEGMENT_TYPE                         BYTES/1024/1024
----------------------------------- ------------------------------------------------------------ ------------------------------------ ---------------
WRH$_ACTIVE_SESSION_HISTORY         WRH$_ACTIVE_2248810413_0                                     TABLE PARTITION                                 8083
SYS_LOB0000006409C00004$$                                                                        LOBSEGMENT                                      2112
WRH$_ACTIVE_SESSION_HISTORY_PK      WRH$_ACTIVE_2248810413_0                                     INDEX PARTITION                                  864
WRH$_EVENT_HISTOGRAM_PK             WRH$_EVENT__2248810413_0                                     INDEX PARTITION                                  448
WRH$_EVENT_HISTOGRAM                WRH$_EVENT__2248810413_0                                     TABLE PARTITION                                  429
WRH$_LATCH                          WRH$_LATCH_2248810413_0                                      TABLE PARTITION                                  312
WRH$_SQLSTAT                        WRH$_SQLSTA_2248810413_0                                     TABLE PARTITION                                  305
WRH$_SERVICE_STAT_PK                WRH$_SERVIC_2248810413_0                                     INDEX PARTITION                                  240
WRH$_SYSSTAT_PK                     WRH$_SYSSTA_2248810413_0                                     INDEX PARTITION                                  216
WRH$_SYSSTAT                        WRH$_SYSSTA_2248810413_0                                     TABLE PARTITION                                  208

10 rows selected.

01:42:31 SYS@cdc> TRUNCATE TABLE WRH$_ACTIVE_SESSION_HISTORY;

Table truncated.

Elapsed: 00:00:00.92
01:42:33 SYS@cdc> Col tablespace_name for a30
01:42:39 SYS@cdc> Col used_pct for a10
01:42:39 SYS@cdc> Set line 120 pages 120
01:42:39 SYS@cdc> select total.tablespace_name,round(total.MB, 2) as Total_MB,round(total.MB - free.MB, 2) as Used_MB,round((1-free.MB / total.MB)* 100, 2) || '%' as Used_Pct 
01:42:39   2  from (
01:42:39   3  select tablespace_name, sum(bytes) /1024/1024 as MB 
01:42:39   4  from dba_free_space group by tablespace_name) free,
01:42:39   5  (select tablespace_name, sum(bytes) / 1024 / 1024 as MB 
01:42:39   6  from dba_data_files group by tablespace_name) total     
01:42:39   7  where free.tablespace_name = total.tablespace_name 
01:42:39   8  order by 4
01:42:39   9  /

TABLESPACE_NAME                  TOTAL_MB    USED_MB USED_PCT
------------------------------ ---------- ---------- ----------
UNDOTBS1                            24630     759.88 3.09%
USERS                               78744    30099.5 38.22%
SYSTEM                               2048     886.19 43.27%
SYSAUX                              17680    7885.13 44.6%



Elapsed: 00:00:00.05

参考链接:
https://blog.itpub.net/26148431/viewspace-2135213/


http://www.kler.cn/a/313969.html

相关文章:

  • HTTP协议基础
  • 软件测试面试2024最新热点问题
  • 多叉树笔记
  • ISAAC SIM踩坑记录--ubuntu 22.04操作系统安装
  • Chromium 中sqlite数据库操作演示c++
  • spring cloud 入门笔记1(RestTemplate,Consul)
  • 微服务——网关登录校验(一)
  • ODrive电机驱动算法VScode环境配置笔记教程
  • Java | Leetcode Java题解之第412题Fizz Buzz
  • Apache doris手动部署时报错“Please disable swap memory before installation.“
  • Web 服务器介绍 | 通过 Tomcat 说明其作用
  • 华为摄像机/NVR主动注册协议接入SVMSP平台
  • pytorch入门(2)——TensorBoard的使用
  • Python利用PyInstaller封装EXE文件
  • 2024“华为杯”中国研究生数学建模竞赛(E题)深度剖析_数学建模完整过程+详细思路+代码全解析
  • Mysql实战
  • RNN的反向传播
  • 经典sql题(九)SQL 查询详细指南总结二
  • MySQL中的LIMIT与ORDER BY关键字详解
  • git 推送文件
  • vue3 ant-design 4.x 表格动态行样式设置
  • Tomcat服务器—Windows下载配置详细教程
  • Sui Builder House锦集,原生USDC和CCTP即将登陆Sui
  • 【HTTP】请求“报头”,Referer 和 Cookie
  • (CS231n课程笔记)深度学习之损失函数详解(SVM loss,Softmax,熵,交叉熵,KL散度)
  • 大批量查询方案简记(Mybatis流式查询)