RMAN中CONVERT跨平臺傳輸資料庫時整庫轉換不通過的問題

靜以致遠√團團發表於2014-04-09
今天在用RMANCONVERT做跨平臺傳輸資料時,到整庫轉換時怎麼也過不去,總是在做undotbs的備份時自動將資料庫shutdown
檢視了一下告警日誌如下:
Data in bad block:
 type: 2 format: 2 rdba: 0x00806dc4
 last change scn: 0x0000.00116ab5 seq: 0x75 flg: 0x04
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0x00000000
 check value in block header: 0xaf89
 computed block checksum: 0x8f75
Hex dump of block from foreign database
Hex dump of (file 2, block 28101) in trace file /u01/app/oracle/admin/orcl/udump/orcl_ora_5317.trc
Corrupt block relative dba: 0x00806dc5 (file 2, block 28101)
Completely zero block found during reading datafile for conversion
Hex dump of block from foreign database
Hex dump of (file 2, block 28102) in trace file /u01/app/oracle/admin/orcl/udump/orcl_ora_5317.trc
Corrupt block relative dba: 0x00806dc6 (file 2, block 28102)
Completely zero block found during reading datafile for conversion
Hex dump of block from foreign databaseHex dump of (file 2, block 28103) in trace file /u01/app/oracle/admin/orcl/udump/orcl_ora_5317.trc
Corrupt block relative dba: 0x00806dc7 (file 2, block 28103)
Completely zero block found during reading datafile for conversionHex dump of block from foreign database
.
.
.

看這樣子是出現壞塊了,進入資料庫檢視一下:
SQL> select tablespace_name, segment_type, owner, segment_name, partition_name from dba_extents where file_id = 2 and 28081 between block_id and block_id + blocks - 1; 
no rows selected

沒有查到這個壞塊資訊,去網上求救,據說出現這種問題是oracle10.2.0.1的一個bug,直接向在資料庫中新建立一個大表,向該大表中插入資料後刪除,目的是將出現的壞塊替換掉,照做了還是無法解決該問題

仔細看了下出錯資訊,進入資料庫檢視一下:

SQL> select file#,name from v$datafile;

    FILE# NAME
--------- ---------------------------------------------
        1 /u01/app/oracle/oradata/orcl/system01.dbf
        3 /u01/app/oracle/oradata/orcl/sysaux01.dbf
        4 /u01/app/oracle/oradata/orcl/users01.dbf
        5 /u01/app/oracle/oradata/orcl/example01.dbf
        6 /u01/app/oracle/oradata/orcl/tts01.dbf
        7 /u01/app/oracle/oradata/orcl/tts02.dbf
        8 /u01/app/oracle/oradata/orcl/undotbs001.dbf

file 2竟然是undo表空間中的一個資料檔案,清醒的是資料庫能正常開啟,重做一個undo表空間:

SQL> create undo tablespace undotbs
  2  datafile '/u01/app/oracle/oradata/orcl/undotbs001.dbf' size 100m
  3  /

Tablespace created.

SQL> alter system set undo_tablespace=undotbs  ;

System altered.

SQL> drop tablespace undotbs1 including contents and datafiles;

Tablespace dropped.

SQL> select file_name,tablespace_name from dba_data_files;

FILE_NAME                                     TABLESPACE_NAME
--------------------------------------------- ------------------------------
/u01/app/oracle/oradata/orcl/users01.dbf      USERS
/u01/app/oracle/oradata/orcl/sysaux01.dbf     SYSAUX
/u01/app/oracle/oradata/orcl/system01.dbf     SYSTEM
/u01/app/oracle/oradata/orcl/example01.dbf    EXAMPLE
/u01/tts_dir/tts02.dbf                        TTS_TEST
/u01/tts_dir/tts01.dbf                        TTS_TEST
/u01/app/oracle/oradata/orcl/undotbs001.dbf   UNDOTBS


READ ONLY模式啟動資料庫

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup open read only;
ORACLE instance started.

Total System Global Area  167772160 bytes
Fixed Size                  1218316 bytes
Variable Size              79694068 bytes
Database Buffers           83886080 bytes
Redo Buffers                2973696 bytes
Database mounted.
Database opened.

再次執行一次整庫轉換:
RMAN> convert database new database 'orcl2'
2> transport script '/u01/rman_convert/whole_db_script.sql'
3> to platform 'Linux IA (32-bit)'
4> db_file_name_convert '/u01/app/oracle/oradata/orcl' '/u01/app/oracle/oradata/orcl2'
5> ;

Starting convert at 09-APR-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=153 devtype=DISK

External table SH.SALES_TRANSACTIONS_EXT found in the database

Directory SYS.EXPDP_DIR2 found in the database
Directory SYS.EXPDP_DIR found in the database
Directory SYS.DATA_PUMP_DIR found in the database
Directory SYS.SUBDIR found in the database
Directory SYS.XMLDIR found in the database
Directory SYS.MEDIA_DIR found in the database
Directory SYS.LOG_FILE_DIR found in the database
Directory SYS.DATA_FILE_DIR found in the database
Directory SYS.WORK_DIR found in the database
Directory SYS.ADMIN_DIR found in the database

BFILE PM.PRINT_MEDIA found in the database

User SYS with SYSDBA and SYSOPER privilege found in password file
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
converted datafile=/u01/app/oracle/oradata/orcl2/system01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00003 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
converted datafile=/u01/app/oracle/oradata/orcl2/sysaux01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
converted datafile=/u01/app/oracle/oradata/orcl2/users01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00005 name=/u01/app/oracle/oradata/orcl/example01.dbf
converted datafile=/u01/app/oracle/oradata/orcl2/example01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00008 name=/u01/app/oracle/oradata/orcl/undotbs001.dbf
converted datafile=/u01/app/oracle/oradata/orcl2/undotbs001.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00006 name=/u01/app/oracle/oradata/orcl/tts01.dbf
converted datafile=/u01/app/oracle/oradata/orcl2/tts01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00007 name=/u01/app/oracle/oradata/orcl/tts02.dbf
converted datafile=/u01/app/oracle/oradata/orcl2/tts02.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:03
Run SQL script /u01/rman_convert/whole_db_script.sql on the target platform to create database
Edit init.ora file /u01/app/oracle/10.2.0/db_1/dbs/init_00p5aqna_1_0.ora. This PFILE will be used to create the database on the target platform
To recompile all PL/SQL modules, run utlirp.sql and utlrp.sql on the target platform
To change the internal database identifier, use DBNEWID Utility
Finished backup at 09-APR-14

轉換成功



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29320885/viewspace-1138936/,如需轉載,請註明出處,否則將追究法律責任。

相關文章