生成分析报告,移除定时任务,删除历史数据
来源:互联网 发布:印刷排版软件下载 编辑:程序博客网 时间:2024/06/11 15:36
生成分析报告
调用@/home/orapaid/product/92/rdbms/admin/spreport生成
此过程中要输入开始快照 和 终止快照 编号
移除定时任务
SQL>execute dbms_job.remove('job_id');
删除历史数据
删除stats$snapshot表中数据 ,其他表中的数据会相应的级连删除
oracle提供了用于 truncate 这些统计信息表的 脚本
[orapaid@bj37 admin]$ cat sptrunc.sql
Rem
Rem $Header: sptrunc.sql 19-feb-2002.11:36:28 vbarrier Exp $
Rem
Rem sptrunc.sql
Rem
Rem Copyright (c) 2000, 2002, Oracle Corporation. All rights reserved.
Rem
Rem NAME
Rem sptrunc.sql - STATSPACK - Truncate tables
Rem
Rem DESCRIPTION
Rem Truncates data in Statspack tables
Rem
Rem NOTES
Rem Should be run as STATSPACK user, PERFSTAT.
Rem
Rem The following tables should NOT be truncated
Rem STATS$LEVEL_DESCRIPTION
Rem STATS$IDLE_EVENT
Rem STATS$STATSPACK_PARAMETER
Rem
Rem MODIFIED (MM/DD/YY)
Rem vbarrier 03/05/02 - Segment Statistics
Rem cdialeri 04/13/01 - 9.0
Rem cdialeri 09/12/00 - sp_1404195
Rem cdialeri 04/11/00 - 1261813
Rem cdialeri 03/15/00 - Created
Rem
undefine anystring
set showmode off echo off;
whenever sqlerror exit;
spool sptrunc.lis
/* ------------------------------------------------------------------------- */
prompt
prompt Warning
prompt ~~~~~~~
prompt Running sptrunc.sql removes ALL data from Statspack tables. You may
prompt wish to export the data before continuing.
prompt
prompt
prompt About to Truncate Statspack Tables
prompt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prompt If you would like to continue, press <return>
prompt
prompt
prompt &return Entered - starting truncate operation
truncate table STATS$FILESTATXS;
truncate table STATS$TEMPSTATXS;
truncate table STATS$LATCH;
truncate table STATS$LATCH_CHILDREN;
truncate table STATS$LATCH_MISSES_SUMMARY;
truncate table STATS$LATCH_PARENT;
truncate table STATS$LIBRARYCACHE;
truncate table STATS$BUFFER_POOL_STATISTICS;
truncate table STATS$ROLLSTAT;
truncate table STATS$ROWCACHE_SUMMARY;
truncate table STATS$SGA;
truncate table STATS$SGASTAT;
truncate table STATS$SYSSTAT;
truncate table STATS$SESSTAT;
truncate table STATS$SYSTEM_EVENT;
truncate table STATS$SESSION_EVENT;
truncate table STATS$BG_EVENT_SUMMARY;
truncate table STATS$WAITSTAT;
truncate table STATS$ENQUEUE_STAT;
truncate table STATS$SQL_SUMMARY;
truncate table STATS$SQL_STATISTICS;
truncate table STATS$SQLTEXT;
truncate table STATS$PARAMETER;
truncate table STATS$RESOURCE_LIMIT;
truncate table STATS$DLM_MISC;
truncate table STATS$UNDOSTAT;
truncate table STATS$SQL_PLAN;
truncate table STATS$SQL_PLAN_USAGE;
truncate table STATS$SEG_STAT;
truncate table STATS$SEG_STAT_OBJ;
truncate table STATS$DB_CACHE_ADVICE;
truncate table STATS$PGASTAT;
truncate table STATS$INSTANCE_RECOVERY;
delete from STATS$SNAPSHOT;
delete from STATS$DATABASE_INSTANCE;
commit;
Rem This is required to allow further snapshots to work without
Rem recreating package or restarting the instance
alter package statspack compile;
prompt
prompt Truncate operation complete
prompt
/* ------------------------------------------------------------------------- */
spool off;
whenever sqlerror continue;
set echo on;
[orapaid@bj37 admin]$
- 生成分析报告,移除定时任务,删除历史数据
- 数据库定时删除历史数据的SQL指令
- 如何删除statspack生成的历史数据
- 存储过程+Even定时删除历史数据(Mysql5.1.6+)
- mongoDB 定时清理历史数据
- MySQL定时任务删除数据
- java 定时任务,定时删除缓存文件
- 定时自动生成awr报告
- Golang Cron 定时任务分析
- Android后台定时任务分析
- Spring定时任务源码分析
- 简单定时任务,处理定时任务创建报表或生成
- sqlserver2008r2 定时任务删除表中数据
- quartz动态添加和删除定时任务
- linux下删除指定crontab定时任务
- quartz动态添加、更新、删除定时任务
- Quartz定时任务删除冗余操作日志
- spring-boot动态添加、删除定时任务
- 测试安装好的Statspack以及使statspack自动收集
- 工作日志2006.11.20
- statspack的系统参数
- Perl 简介
- statspack report分析
- 生成分析报告,移除定时任务,删除历史数据
- 网页的蝉蜕之路
- zr
- Oracle中捕获问题SQL解决CPU过渡消耗
- statspack的一些使用技巧
- 用jar命令打包
- 仅为笔记本1/4大小的低能耗超便携设备即将发布
- statspack report分析(二)
- 中小型网站怎样最经济地解决南北互联问题?