ORA-01578: ORACLE data block corrupted (file # num, block # num)
以上任一原因導致邏輯壞塊或物理壞塊。注意:報錯時間可能晚於實際損壞時間。
-- 1. 定位壞塊所屬段
SELECT owner, segment_name, segment_type
FROM dba_extents
WHERE file_id = <F> AND <B> BETWEEN block_id AND block_id + blocks - 1;
-- <F>、<B> 為錯誤提示的文件號、塊號
| 壞塊位置 | 處理策略 |
|---|---|
| 索引段 | 重建索引:ALTER INDEX idx_name REBUILD; 即可修復 |
| 表段 | 見下文詳細流程 |
| 數據字典/系統表空間/回滾段 | 立即聯繫 Oracle 支持,不可自行嘗試 |
ANALYZE TABLE <table_name> VALIDATE STRUCTURE CASCADE;
-- 1. 關閉數據庫
SHUTDOWN IMMEDIATE;
-- 2. 編輯 init<SID>.ora 添加
event="10231 trace name context forever, level 10"
-- 3. 限制模式啟動
STARTUP RESTRICT;
-- 4. 創建臨時表搶救數據
CREATE TABLE temp_rescue AS SELECT * FROM corrupted_table;
-- 5. 移除 event 參數,正常重啟
SHUTDOWN IMMEDIATE;
-- 刪除 event 行
STARTUP;
-- 6. 替換原表
RENAME corrupted_table TO corrupted_table_bad;
RENAME temp_rescue TO corrupted_table;
-- 7. 重建索引、約束、授權
替代方案:使用 ROWID 範圍分批導出數據,參考 Oracle 故障排除手冊。
ORA-01628: max # of extents num reached for rollback segment num
回滾段或表空間達到 MAXEXTENTS 參數上限。注意:這是邏輯參數上限,非硬件上限。硬件上限取決於創建數據庫時的 DB_BLOCK_SIZE。
ALTER TABLESPACE tbs_name STORAGE (MAXEXTENTS 10000);
新值必須 > 當前報錯值,且 ≤ LARGEST MAXEXTENT(由 block size 決定)。
-- 1. EXP 導出表 (COMPRESS=Y)
-- 2. 重命名原表空間
-- 3. 創建新表空間 (較大 INITIAL/NEXT/UNIFORM SIZE)
-- 4. IMP 導入數據
ORA-01628: max # extents 50 reached for rollback segment RBS_1
-- 處理:DROP ROLLBACK SEGMENT RBS_1; CREATE ROLLBACK SEGMENT RBS_1 STORAGE (MAXEXTENTS UNLIMITED);
ORA-01578
Cause: The given data block was corrupted, probably due to program errors.
Action: Try to restore the segment containing the given data block. This may involve dropping the segment and recreating it. If there is a trace file, report the messages in it to customer support.ORA-01628
Cause: An attempt was made to extend a rollback segment that already has reached its maximum size or space could not be allocated in the data dictionary to contain the definition of the object.
Action: If possible, increase the value of either the MAXEXTENTS or PCTINCREASE initialization parameters or find the data dictionary table lacking space and alter the storage parameters.
DB_BLOCK_CHECKING=FULL、DB_BLOCK_CHECKSUM=FULL、定期 RMAN VALIDATE、RAID 冗余、備份驗證。