處理ORA-01578錯時有用的分割槽操作
在遇到下述錯時,如果是index,直接drop掉index重建就ok,
如果是table一般有兩種解決方法 (關於判斷塊所在對像的型別,見另一個貼子)
[@more@]Wed Nov 18 15:16:17 2009
Errors in file /oracle/app/admin/diag/rdbms/start/start10/trace/start10_p004_13490.trc (incident=2152710):
ORA-01578: ORACLE 鏁版嵁鍧楁崯鍧?(鏂囦歡鍙?5782, 鍧楀彿 85299)
ORA-01110: 鏁版嵁鏂囦歡 5782: '+NL02/start/datafile/isdh03m200907090'
ORA-26040: 鏁版嵁鍧楁槸浣跨敤 NOLOGGING 閫夐」鍔犺澆鐨?
Incident details in: /oracle/app/admin/diag/rdbms/start/start10/incident/incdir_2152710/start10_p004_13490_i2152710.trc
1) 從備份中restore df,然後recover df;
最近一次level 0備份存在, 利用Block Media Recovery 只recover壞塊
2) ALTER SESSION SET EVENTS '10231 TRACE NAME CONTEXT FOREVER, LEVEL 10'; --掃描表時會skip 壞塊
Execute DBMS_REPAIR.SKIP_CORRUPT_BLOCKS('
跳過壞塊後,接下來就是將壞塊對應的分割槽裡的資料select出來導到一張普通表, 然後將有壞塊的分割槽drop掉,再將其下一個分割槽split成2個,將普通表與split出來的第一個分割槽exchange
#從將普通表"insert"到分割槽表中間的過程演示如下
CREATE TABLE test_o
( object_id ,
object_name,
owner
)noLOGGING
PARTITION BY RANGE ( object_id)
( PARTITION test_o_p1 VALUES LESS THAN ( 1001 ),
PARTITION test_o_p2 VALUES LESS THAN ( 20001 ),
PARTITION test_o_p3 VALUES LESS THAN ( 100001 ),
PARTITION test_o_p4 VALUES LESS THAN ( 1000001 )
)ENABLE ROW MOVEMENT
as
select object_id,object_name,owner
from dba_objects;
SQL> set linesize 1000
SQL> col PARTITION_NAME for a20
SQL> col HIGH_VALUE for a10
SQL> select PARTITION_NAME,HIGH_VALUE,PARTITION_POSITION from dba_tab_partitions where TABLE_NAME='TEST_O';
PARTITION_NAME HIGH_VALUE PARTITION_POSITION
-------------------- ---------- ------------------
TEST_O_P1 1001 1
TEST_O_P2 20001 2
TEST_O_P3 100001 3
TEST_O_P4 1000001 4
create table test_f
( object_id ,
object_name,
owner
)noLOGGING
as select object_id,object_name,owner
from TEST_O where object_id between 2000 and 10000;
SQL> select count(*) from test_f;
COUNT(*)
----------
7784
SQL> alter table TEST_O drop partition TEST_O_P2;
Table altered.
SQL> alter table TEST_O add partition TEST_O_P2 values less than ( 20001 );
alter table TEST_O add partition TEST_O_P2 values less than ( 20001 )
*
ERROR at line 1:
ORA-14074: partition bound must collate higher than that of the last partition
SQL> alter table TEST_O add partition TEST_O_P2 values less than ( maxvalue );
Table altered.
SQL> select PARTITION_NAME,HIGH_VALUE,PARTITION_POSITION from dba_tab_partitions where TABLE_NAME='TEST_O';
PARTITION_NAME HIGH_VALUE PARTITION_POSITION
-------------------- ---------- ------------------
TEST_O_P1 1001 1
TEST_O_P3 100001 2
TEST_O_P4 1000001 3
TEST_O_P2 MAXVALUE 4
SQL> select count(*) from TEST_O partition(TEST_O_P2);
COUNT(*)
----------
0
ALTER TABLE stocks
EXCHANGE PARTITION p3 WITH TABLE stock_table_3;
SQL> alter table TEST_O exchange partition TEST_O_P2 with table test_f;
alter table TEST_O exchange partition TEST_O_P2 with table test_f
*
ERROR at line 1:
ORA-14099: all rows in table do not qualify for specified partition
#drop p2
SQL> alter table TEST_O drop partition TEST_O_P2;
Table altered.
SQL> select PARTITION_NAME,HIGH_VALUE,PARTITION_POSITION from dba_tab_partitions where TABLE_NAME='TEST_O';
PARTITION_NAME HIGH_VALUE PARTITION_POSITION
-------------------- ---------- ------------------
TEST_O_P1 1001 1
TEST_O_P3 100001 2
TEST_O_P4 1000001 3
#split part
SQL> alter table TEST_O split partition
2 TEST_O_P3 at (20001) into (
3 partition TEST_O_P2 ,PARTITION TEST_O_P3);
Table altered.
SQL> select PARTITION_NAME,HIGH_VALUE,PARTITION_POSITION from dba_tab_partitions where TABLE_NAME='TEST_O';
PARTITION_NAME HIGH_VALUE PARTITION_POSITION
-------------------- ---------- ------------------
TEST_O_P1 1001 1
TEST_O_P2 20001 2
TEST_O_P3 100001 3
TEST_O_P4 1000001 4
SQL> SQL> alter table TEST_O exchange partition TEST_O_P2 with table test_f;
Table altered.
SQL> select count(*) from TEST_O partition(TEST_O_P2);
COUNT(*)
----------
7784
也可以truncate掉分割槽再exchange,這樣不必split 分割槽
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/94384/viewspace-1028832/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 分割槽表split操作及maxvalue處理
- 處理動態分割槽時出現的異常
- 分割槽表truncate慢處理
- 分割槽表中全域性及本地分割槽索引什麼時候會失效及處理索引
- 海量資料處理_表分割槽
- INTERVAL分割槽表鎖分割槽操作
- MySql資料分割槽操作之新增分割槽操作MySql
- MySQL分割槽, 子分割槽以及對錄入Null值的處理情況MySqlNull
- 海量資料處理_表分割槽(分割槽自動維護與歷史分割槽歸檔)
- 分割槽表中全域性及本地分割槽索引什麼時候會失效及處理[final]索引
- var分割槽不足%15問題處理
- 分割槽表的常用操作
- 解密Kafka主題的分割槽策略:提升實時資料處理的關鍵解密Kafka
- win10刪除系統保留分割槽如何操作_win10刪除系統保留分割槽怎麼處理Win10
- 分割槽操作常用sqlSQL
- 關於分割槽表的操作
- 高效靈活的分割槽操作
- 全面學習分割槽表及分割槽索引(17)--其它索引分割槽管理操作索引
- MySQL分表後原分割槽表處理方案MySql
- mysql分割槽表佔用大量容量處理(最佳化)及歸檔分割槽表MySql
- Spark操作Hive分割槽表SparkHive
- 分割槽表attach detach操作
- 關於分割槽表的move操作
- ORACLE分割槽表的概念及操作Oracle
- ORACLE分割槽表的操作應用Oracle
- 使用 pq magic 8.0分割槽出現 Error 983 報錯資訊的處理辦法Error
- 海量資料處理_表分割槽(線上重定義)
- 時間型分割槽欄位不走分割槽的解決
- win10分割槽合併不了的解決方法_win10分割槽合併不了如何處理Win10
- Sql Server系列:分割槽表操作SQLServer
- split分割槽操作導致的librarycachelock
- 關於分割槽表的概念及操作
- 如何解決安裝CentOS時遇到引導分割槽位於一個GPT分割槽方案的錯誤提示且分割槽後無法應用CentOSGPT
- 如何查詢分割槽表的分割槽及子分割槽
- ORACLE壞塊(ORA-01578)處理方法Oracle
- Windows分割槽報錯解決Windows
- Oracle分割槽表全域性索引新增分割槽時不會失效Oracle索引
- PLSQL根據分割槽表的分割槽名批次truncate分割槽SQL