当前位置:网站首页>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 .
边栏推荐
- PgSQL learning notes
- Review of reflection topics
- Atcoder beginer contest 253 F - operations on a matrix / / tree array
- php中计算两个日期之前相差多少天、月、年
- Implement strstr() II
- Wechat applet Foundation
- Sqli-labs customs clearance (less2-less5)
- sqli-labs通关汇总-page2
- oracle-外币记账时总账余额表gl_balance变化(上)
- In depth study of JVM bottom layer (II): hotspot virtual machine object
猜你喜欢
随机推荐
Win10: add or delete boot items, and add user-defined boot files to boot items
JS delete the last character of the string
Network security -- intrusion detection of emergency response
Sqli Labs clearance summary - page 2
Log - 7 - record a major error in missing documents (A4 paper)
Latex warning: citation "*****" on page y undefined on input line*
Latex error: the font size command \normalsize is not defined problem solved
PXC high availability cluster summary
Sentry construction and use
ORACLE 11G SYSAUX表空间满处理及move和shrink区别
Basic knowledge of software testing
Improve user experience defensive programming
Oracle rman半自动恢复脚本-restore阶段
Ceaspectuss shipping company shipping artificial intelligence products, anytime, anywhere container inspection and reporting to achieve cloud yard, shipping company intelligent digital container contr
Oracle rman自动恢复脚本(生产数据向测试迁移)
ORACLE EBS ADI 开发步骤
Check log4j problems using stain analysis
Sublime text configuring PHP compilation environment
Eslint configuration code auto format
The use of regular expressions in JS









