ITPub博客

首页 > 数据库 > Oracle > RMAN中CONVERT跨平台传输数据库时整库转换不通过的问题

RMAN中CONVERT跨平台传输数据库时整库转换不通过的问题

原创 Oracle 作者:静以致远√团团 时间:2014-04-09 19:55:39 1 删除 编辑
今天在用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/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
每个人都有梦想,去实现吧!

注册时间:2013-11-14

  • 博文量
    164
  • 访问量
    2124070