当前位置:网站首页>Oracle 11.2.0.3 handles the problem of continuous growth of sysaux table space without downtime
Oracle 11.2.0.3 handles the problem of continuous growth of sysaux table space without downtime
2022-07-02 07:05:00 【Virtuous time】
appearance
SYSAUX Table space has been growing , A month of rapid growth 10G, Table spaces need to be maintained regularly
reason
oracle bug cause (Doc ID 1055547.1)
MMON performs the purge of the optimizer stats history automatically. However it has an internal limit of 5 minutes to perform this job. If the operation takes more than 5 minutes, then it is aborted and stats not purged.
No trace or alert message is reported.
Processing mode - No patches
Disable statistics
Because when collecting statistical information, you need to insert data into the related table below , Statistics cannot be collected during cleanup .
wri$_optstat_tab_history
wri$_optstat_ind_history
wri$_optstat_histhead_history
wri$_optstat_histgrm_history
Sign in ebs Put two ( One GL、 One ALL) Plan request Statistical data mode Cancel it ( Cancel the previous screenshot backup parameters ).
Delete historical data
All of the following sql in sys as dba perform
First, calculate the total earliest date of the existing data .
SELECT TRUNC(SYSDATE) - TO_DATE(to_char(MIN(savtime), 'YYYY-MM-DD'), 'yyyy-mm-dd')
FROM sys.WRI$_OPTSTAT_HISTHEAD_HISTORY;
The assumption is 190 God , Then log in through remote desktop sqlplus ( The following sql It may take several days , You need to run in the background or remote desktop )
set serveroutput on
BEGIN
DBMS_OUTPUT.ENABLE(buffer_size => null);
for i in reverse 10..190
loop
dbms_output.put_line(to_char(sysdate,'YYYY-MM-DD HH24:MI:SS') || '-Begin delete Day ' || i );
dbms_stats.purge_stats(sysdate-i);
COMMIT;
dbms_output.put_line(to_char(sysdate,'YYYY-MM-DD HH24:MI:SS') || '-Complete delete Day ' || i );
end loop;
end;
/
Above this sql It may take several days , After execution, use shink Shrink the table .
Shrink the table
-- First back up the index data
select dbms_metadata.get_ddl('INDEX','I_WRI$_OPTSTAT_HH_OBJ_ICOL_ST','SYS') from dual;
select dbms_metadata.get_ddl('INDEX','I_WRI$_OPTSTAT_HH_ST','SYS') from dual;
-- Drop indexes
drop index I_WRI$_OPTSTAT_HH_OBJ_ICOL_ST;
drop index I_WRI$_OPTSTAT_HH_ST;
-- Enable row migration
alter table WRI$_OPTSTAT_HISTHEAD_HISTORY enable row movement;
-- To contract ( It's useless here move To save space )
alter table WRI$_OPTSTAT_HISTHEAD_HISTORY shrink space cascade;
-- Index reconstruction after shrinking
CREATE UNIQUE INDEX "SYS"."I_WRI$_OPTSTAT_HH_OBJ_ICOL_ST" ON "SYS"."WRI$_OPTSTAT_HISTHEAD_HISTORY" ("OBJ#", "INTCOL#", SYS_EXTRACT_UTC("SAVTIME"), "COLNAME")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSAUX" ;
CREATE INDEX "SYS"."I_WRI$_OPTSTAT_HH_ST" ON "SYS"."WRI$_OPTSTAT_HISTHEAD_HISTORY" (SYS_EXTRACT_UTC("SAVTIME"))
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSAUX" ;
Collect statistics
EXEC dbms_stats.gather_table_stats(ownname => ‘SYS’,tabname => ‘WRI$_OPTSTAT_HISTHEAD_HISTORY’,cascade => TRUE);
See the effect
SELECT *
FROM (SELECT owner, segment_name, segment_type, SUM(bytes) / 1024 / 1024 / 1024 GB
FROM dba_segments
WHERE tablespace_name = 'SYSAUX'
GROUP BY owner, segment_name, segment_type
ORDER BY 4 DESC)
WHERE rownum < 10;
SELECT occupant_name "Item",
space_usage_kbytes / 1048576 "Space Used (GB)",
schema_name "Schema",
move_procedure "Move Procedure"
FROM v$sysaux_occupants
ORDER BY space_usage_kbytes DESC;
Resume statistical mode information collection
Submit it immediately ALL Statistics of patterns , Then set a plan request ,ALL Pattern , Five nights a week 10 Click to collect data , Parameter reference backup screenshot .
Because the weekly data size of the general ledger model changes little , To save power , There is no need to set a schedule to request running every night .
Not EBS The library needs to use the corresponding api To enable and disable statistics collection .
边栏推荐
- SQL injection closure judgment
- ORACLE APEX 21.2安装及一键部署
- Changes in foreign currency bookkeeping and revaluation general ledger balance table (Part 2)
- ORACLE APEX 21.2安裝及一鍵部署
- In depth study of JVM bottom layer (V): class loading mechanism
- Review of reflection topics
- Yolov5 practice: teach object detection by hand
- 2021-07-05c /cad secondary development create arc (4)
- Sqli labs customs clearance summary-page1
- php中判断版本号是否连续
猜你喜欢

搭建frp进行内网穿透

sqli-labs通关汇总-page4

Recursion (maze problem, Queen 8 problem)

Sentry construction and use

UEditor . Net version arbitrary file upload vulnerability recurrence

CAD二次开发 对象

In depth study of JVM bottom layer (3): garbage collector and memory allocation strategy

Latex compiles Chinese in vscode and solves the problem of using Chinese path

Sqli Labs clearance summary - page 2

SQLI-LABS通关(less1)
随机推荐
Brief analysis of PHP session principle
php中计算树状结构数据中的合计
MySQL index
2021-07-05C#/CAD二次开发创建圆弧(4)
uniapp引入本地字体
Sqli - Labs Clearance (less6 - less14)
js创建一个自定义json数组
CRP实施方法论
Yolov5 practice: teach object detection by hand
Sqli-labs customs clearance (less6-less14)
Thinkphp5中一个字段对应多个模糊查询
Recursion (maze problem, Queen 8 problem)
CAD二次开发 对象
SQLI-LABS通关(less6-less14)
Changes in foreign currency bookkeeping and revaluation general ledger balance table (Part 2)
Huawei mindspire open source internship machine test questions
Use of interrupt()
IDEA2020中测试PySpark的运行出错
ORACLE EBS接口开发-json格式数据快捷生成
CVE-2015-1635(MS15-034 )远程代码执行漏洞复现