プロのOracle Databaseの復旧サービスを提供 携帯番号: +86 13764045638 メール:service@parnassusdata.com

  たまにはORA-01122,ORA-01110,ORA-01200エラになる、例えば:   ORA-01122: database file 9 failed verification check ORA-01110: data file 9: '/u02/oradata/orcl/users01.dbf ' ORA-01200: actual file size of 64000 is smaller than correct size of 65600     [oracle@mlab2 ~]$ oerr ora 1122 01122, 00000, "database file %s failed verification check" // *Cause:  The information in this file is inconsistent with information //         from the control file. See accompanying message for reason. // *Action: Make certain that the db files and control files are the correct //         files for this database.     [oracle@mlab2 ~]$ oerr ora 1110 01110, 00000, "data file %s: '%s'" // *Cause:  Reporting file name for details of another error. The reported //          name can be of the old file if a data file move operation is //          in progress. // *Action: See associated error message.     [oracle@mlab2 ~]$ oerr ora 1200 01200, 00000, "actual file size of %s is smaller than correct size of %s blocks" // *Cause:  The size of the file as returned by the operating system is smaller //         than the size of the file as indicated in the file header and the //         control file. Somehow the file has been truncated. Maybe it is the //         result of a half completed copy. // *Action: Restore a good copy of the data file and do recovery as needed.   ORA-1200エラに対するディスクライブは、今のデータファイルの実際サイズがデータファイルヘッダにディスクライブされたヘッダの数より小さい場合に、ここでディスクライブした実際のサイズはOSのシステム使用によって獲得した。これはデータファイルが切断されたと意味している。     バックアップもアーカイブも完全な場合に、バックアップでリカバリするだけでトラブルを解決できる。この文で紹介した方法はバックアップがない場合に限って運用できる。SYSTEMテーブルスペースのデータファイルに対して、この方法を使われないでください   まずはデータベースごとにコールドバックアップしてください。そして、ORA-01110 と ORA-01122エラを分析して、該当するトラブルの具体的なデータファイル番号を探し出せる。例えば、以下の例にはFILE#=9のファイルにエラになった:   ORA-01122: database file 9 failed verification check ORA-01110: data file 9: '/u02/oradata/orcl/users01.dbf '     前の例でORA-01200: actual file size of 64000 is smaller than correct size of 65600、つまり、実際のサイズは64000*db_block_size+一つのOracle BLock=64000 * 8192 + 8192 =524296192 実際のサイズはどうなのか。 ls –ltrデータファイルで確認できる。   けどORACLEはデータファイルヘッダから獲得したデータファイル理論的なサイズは65600 –> 65000 * 8192 +8192=532488192 bytesである。   二つを比べてみれば、65600-64000=1600の差が見られる。これはddで既存するデータファイルに追加できる。もちろん、追加したのは空けたブロック。 例えば:   dd if=<locationf datafile having problem> of=<output/target datafile> count=< > bs=<db_block_size in bytes>   例えばdd if=/u02/oradata/orcl/users01.dbf of=/tmp/corr_temp.DBF count=64000 bs=8192   そして1600の空けたブロックを新たなデータファイルに追加する dd if=/dev/zero of=<location of datafile> bs=<db_block_size in bytes> seek=<Actual block number reported + 1 > count=<Difference in number of block>   如dd if=/dev/zero of=/u02/oradata/careware/users01.dbf bs=8192 seek=64001 count=1600 conv=notrun       データベースを起動するときに、データファイルとコントロールファイル情報だけを検証するから、前のオペレーションがOracleの検証に騙せる。けどデータベースを起動したあと、データベースを再構造することを勧めている。。