当前位置:网站首页>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 .
边栏推荐
- SQLI-LABS通关(less18-less20)
- Code execution sequence with and without resolve in promise
- Cve - 2015 - 1635 (ms15 - 034) réplication de la vulnérabilité d'exécution de code à distance
- Latex error: the font size command \normalsize is not defined problem solved
- In depth study of JVM bottom layer (IV): class file structure
- 2021-07-19C#CAD二次开发创建多线段
- JS create a custom JSON array
- Latex compiles Chinese in vscode and solves the problem of using Chinese path
- Oracle apex Ajax process + dy verification
- pySpark构建临时表报错
猜你喜欢
How to debug wechat built-in browser applications (enterprise number, official account, subscription number)
In depth study of JVM bottom layer (V): class loading mechanism
mapreduce概念和案例(尚硅谷学习笔记)
2021-07-05C#/CAD二次开发创建圆弧(4)
Only the background of famous universities and factories can programmers have a way out? Netizen: two, big factory background is OK
Sublime text configuring PHP compilation environment
sqli-labs通关汇总-page2
Win10: add or delete boot items, and add user-defined boot files to boot items
Sqli-labs customs clearance (less2-less5)
Redis -- cache breakdown, penetration, avalanche
随机推荐
Explain in detail the process of realizing Chinese text classification by CNN
Sqli labs customs clearance summary-page2
Spark的原理解析
Changes in foreign currency bookkeeping and revaluation general ledger balance table (Part 2)
Only the background of famous universities and factories can programmers have a way out? Netizen: two, big factory background is OK
sqli-labs通关汇总-page3
Atcoder beginer contest 253 F - operations on a matrix / / tree array
Latex compilation error I found no \bibstyle &\bibdata &\citation command
Queue (linear structure)
In depth study of JVM bottom layer (II): hotspot virtual machine object
Sqli-labs customs clearance (less6-less14)
Sqli-labs customs clearance (less15-less17)
ARP攻击
Stress test modification solution
The use of regular expressions in JS
Code execution sequence with and without resolve in promise
Self study table Au
Latex error: the font size command \normalsize is not defined problem solved
How to debug wechat built-in browser applications (enterprise number, official account, subscription number)
The win10 network icon disappears, and the network icon turns gray. Open the network and set the flash back to solve the problem