物化試圖日誌過大
發現一張物化試圖日誌表達到了2G。...
[@more@]1. 遠端試圖使用的rowid重新整理,可我的日誌用的是主鍵建立的,所以fast重新整理失敗,結果使用了完全重新整理,導致日誌表一直增加。
順便看了下物化檢視重新整理的順序。
更新的順序是先刪除後更新,最後插入。
首先查詢出需要刪除的資料:
SELECT /*+ remote_mapped(MASPROD104.CIMC.COM) */
DISTINCT M_ROW$$
FROM (SELECT M_ROW$$
FROM "MAS9I"."MLOG$_ACTION_TEST1"@MASPROD104.CIMC.COM MLOG$
WHERE "SNAPTIME$$" > :1
AND ("DMLTYPE$$" != 'I')) LOG$
WHERE (M_ROW$$) NOT IN
(SELECT ROWID
FROM "MAS_TAB$"
WHERE MAS_TAB$.ROWID = LOG$.M_ROW$$);
DELETE FROM "MAS9I"."MV_ACTION_TEST1" SNAP$ WHERE M_ROW$$ = :1;
然後查出需要update和insert的資料
SELECT /*+ remote_mapped(MASPROD104.CIMC.COM) */
CURRENT$."R_ID",
CURRENT$."OWNER",
CURRENT$."OBJECT_NAME",
CURRENT$."SUBOBJECT_NAME",
CURRENT$."OBJECT_ID",
CURRENT$."DATA_OBJECT_ID",
CURRENT$."OBJECT_TYPE",
CURRENT$."CREATED",
CURRENT$."LAST_DDL_TIME",
CURRENT$."TIMESTAMP",
CURRENT$."STATUS",
CURRENT$."TEMPORARY",
CURRENT$."GENERATED",
CURRENT$."SECONDARY",
ROWIDTOCHAR(CURRENT$.ROWID) M_ROW$$
FROM (SELECT "A".ROWID "R_ID",
"A"."OWNER" "OWNER",
"A"."OBJECT_NAME" "OBJECT_NAME",
"A"."SUBOBJECT_NAME" "SUBOBJECT_NAME",
"A"."OBJECT_ID" "OBJECT_ID",
"A"."DATA_OBJECT_ID" "DATA_OBJECT_ID",
"A"."OBJECT_TYPE" "OBJECT_TYPE",
"A"."CREATED" "CREATED",
"A"."LAST_DDL_TIME" "LAST_DDL_TIME",
"A"."TIMESTAMP" "TIMESTAMP",
"A"."STATUS" "STATUS",
"A"."TEMPORARY" "TEMPORARY",
"A"."GENERATED" "GENERATED",
"A"."SECONDARY" "SECONDARY"
FROM "A") CURRENT$,
(SELECT DISTINCT M_ROW$$
FROM "MAS9I"."MLOG$_ACTION_TEST1"@MASPROD104.CIMC.COM MLOG$
WHERE "SNAPTIME$$" > :1
AND ("DMLTYPE$$" != 'D')) LOG$
WHERE CURRENT$.ROWID = LOG$.M_ROW$$;
UPDATE "MAS9I"."MV_ACTION_TEST1"
SET "R_ID" = :1,
"OWNER" = :2,
"OBJECT_NAME" = :3,
"SUBOBJECT_NAME" = :4,
"OBJECT_ID" = :5,
"DATA_OBJECT_ID" = :6,
"OBJECT_TYPE" = :7,
"CREATED" = :8,
"LAST_DDL_TIME" = :9,
"TIMESTAMP" = :10,
"STATUS" = :11,
"TEMPORARY" = :12,
"GENERATED" = :13,
"SECONDARY" = :14
WHERE M_ROW$$ = :15
select * from sys.snap_reftime$;
INSERT INTO "MAS9I"."MV_ACTION_TEST1" ("R_ID","OWNER","OBJECT_NAME","SUBOBJECT_NAME","OBJECT_ID","DATA_OBJECT_ID","OBJECT_TYPE","CREATED","LAST_DDL_TIME","TIMESTAMP","STATUS","TEMPORARY","GENERATED","SECONDARY","M_ROW$$") VALUES (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,:15)
UPDATE sys.snap$ SET status = :1, rscn = :2, refhnt = :3, flag = :4 WHERE vname = :5 AND sowner = :6 AND instsite = :7
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/133835/viewspace-1005195/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 日誌檔案過大清理
- 物化檢視日誌無法正常清除的解決方法
- 用exp、imp遷移包含物化檢視日誌的資料
- Kibana(一張圖片勝過千萬行日誌)
- 通過 Systemd Journal 收集日誌
- phpMyadmin通過日誌寫webshellPHPWebshell
- 大資料開發過程中Kafka日誌結構解析大資料Kafka
- ELK太重?試試KFC日誌採集
- 通過helm部署EFK收集應用日誌,ingress-nginx日誌解析。應用日誌Nginx
- ClickHouse 效能優化?試試物化檢視優化
- ClickHouse效能優化?試試物化檢視優化
- ITMySQL錯誤日誌與通用查詢日誌圖文詳析jugMySql
- 測試在丟失歸檔日誌的情況下,跳過部分歸檔日誌進行資料恢復資料恢復
- 透過 Filebeat 收集 ubuntu 系統日誌Ubuntu
- 日誌分析-apache日誌分析Apache
- Cmocka 單元測試日誌記錄Mock
- Linux下日誌檔案過大解決方案Linux
- python通過TimedRotatingFileHandler按時間切割日誌Python
- oracle 刪除過期的歸檔日誌Oracle
- [日誌分析篇]-利用ELK分析jumpserver日誌-日誌拆分篇Server
- 大資料01-Flume 日誌收集大資料
- Python強大的日誌模組loggingPython
- ASP.NET Core 整合測試中通過 Serilog 向控制檯輸出日誌ASP.NET
- 通過RMAN設定standby接收日誌後主庫歸檔日誌才可刪除
- 日誌
- Android測試日誌檔案抓取與分析Android
- mariadb審計日誌通過 logstash匯入 hiveHive
- MySQL通過bin log日誌恢復資料|手撕MySQL|對線面試官MySql面試
- 基於ROWID更新的物化檢視測試
- 【Spring】日誌列印sql,日誌配置列印sqlSpringSQL
- 我試了試用 SQL查 Linux日誌,好用到飛起SQLLinux
- 基於 kafka 的日誌資料建模測試Kafka
- [Java/日誌] 日誌框架列印應用程式日誌程式碼的執行情況Java框架
- python過濾nginx access日誌存入資料庫中PythonNginx資料庫
- 【log4j2日誌框架】敏感字元過濾框架字元
- CMS日誌
- 日誌配置
- mybatis日誌MyBatis
- Weblogic日誌Web