ORA-01410 invalid rowid

4701 ワード

最近、業務メールはよく次のような異常を報告しています.
システムエラーコード:ORA-01410:無効なROWID、エラーソース:PKG_BASE_DATA_XXXX,ローカルエラーメッセージ:TABLE_NAME=T_XXXX_CONN_MAC、エラー位置:1-6.
ビジネスシーンと組み合わせて、インデックスの失効によるbig queryが正しいデータを取得できないと分析されています.テーブルデータは、sqlldrによってdirect方式でテーブルにロードされます.以下、主にこの異常を分析します.
Oracle Error: ORA-01410
Error Description:Invalid ROWID
Error Cause:
A ROWID was entered incorrectly. ROWIDs must be entered as formatted hexadecimal strings using only numbers and the characters A through F.

A typical ROWID format is '000001F8.0001.0006'.
A relatively frequent cause of the error comes from the habit of using automatic programs to rebuild multiple indexes.
For example, if you rebuild an index, Oracle will copy the index contents from one location to another and when the copy is complete, it will free up the space that held the original index contents. If there is a long running query that started before the rebuild the query will carry on running using the old index. If some other process now demands the space and puts something into it (perhaps by creating or extending a table or index), if the long-running query hits the old index it may suddenly find itself looking at a block that contains the wrong type of data for the wrong object id. When this happens an ORA-01410 error is produced.

sqlldr directを使用してテーブルにデータをインポートするには、oracleは自動的なrebuild indexが必要です.ただし、rebuild indexでは、indexの再生成を行う必要があり、これにより、プロセス前の古いインデックスデータが読み込まれた後、古いインデックスによって読み込まれたデータブロックによってデータ型とデータオブジェクトIDが間違っていることが肯定され、ORA-01410エラーが発生する.
解決構想:インデックスの失効を回避し、失効インデックスが発生した場合、インデックスをタイムリーに修復する必要があります.
ここでこのブロガーがまとめた文章を引用して、書いたほうが全部いいです.
リンク:http://blog.csdn.net/kechengtan/article/details/6191084
転載の内容は以下の通りです.
 、    

2 16         tablespace      ,          ,      ,          。            ,               ,                   。                ,         ,         ,           。


   2011-02-02   16             ,     。
                   。
         ,       80% 。     。
  1  ,                ,         ,    ,      。
 、    
               。
select * from v$locked_object t1,user_objects t2
where t1.object_id=t2.object_id
      ,            。
            
select sid,
       v$session.username    ,
       last_call_et     ,
       status   ,
       LOCKWAIT    ,
       machine      ,
       logon_time       ,
       sql_text
from v$session, v$process, v$sqlarea
where paddr = addr
   and sql_hash_value = hash_value 
   and status = 'ACTIVE'
   and v$session.username is not null
order by last_call_et desc;

    delete     , delete   :
delete from table1 where column1=? and column2=? and column3=?
         ,       ,     。

            
select status,T.* from user_indexes T
where table_name='TABLE1'
  status='INVALID'  。
     :
drop index ......
create index ......
    。
             ?              ,                     。        。
 、     
1.           ?
    user_indexes status         。
      DBA_IND_PARTITIONS status   。
2.          ,     ?
1)drop index... create index
2)alter index idx_name rebuild
3)alter index idx_name rebuild online
a)rebuild       DML  ,     rebuild            。
b)rebuild         ,       。            ,   ,rebuild           。
c)rebuild online             DML  。
d)rebuild online       。
3.            ?  :          rowid  ,        。
        rowid      unuseable  invalid ?
         3       index unusable
1)move 【alter table move】【alter table t02 move tablespace tbs01;】
2)sqlldr 【sqlldr ( parallel or direct )append 】【sqlldr direct=y +     】
3)  alter index unusable
    ,   local index globa index  
1)                            .
2) local index exchange without including indexes     unusable
3)global index partition mt      unusable[    update global indexes]
     :
1.     : 
      SQL*LOADER           ,        , SQL*LOADER            ,  ORACLE        ,          ,       。        :        SQL*LOADER   ,  ,      。
2.  global  , global        alter table        ,        :

? ADD PARTITION | SUBPARTITION

? COALESCE PARTITION | SUBPARTITION

? DROP PARTITION | SUBPARTITION

? EXCHANGE PARTITION | SUBPARTITION

? MERGE PARTITION | SUBPARTITION

? MOVE PARTITION | SUBPARTITION

? SPLIT PARTITION | SUBPARTITION

? TRUNCATE PARTITION | SUBPARTITION

  ,           sql      update indexes   ,oracle           。

3.   alter table     update indexes   :

   range/list   , local    global        ;

   hash   ,              local    glocal       unuseable,

      

               

select 'alter index '||t.index_name||' rebuild partition '||t.partition_name from user_ind_partitions t where t.index_name='IDX_PART2'  and t.status='unusable'

    ,       。          。