使用rman convert database将oracle 10g 10.2.0.4 for windows x64环境下的数据库转换到oracle 10g 10.2.0.4 for linux x64环境下。
**注意:**无法使用standby备库来进行转换。
1、以只读方式打开数据库
1 2 3
SQL> shutdown immediate SQL> startup mount SQL> alter database open read only;
2、检查可转换性和标示外部对象。
使用DBMS_TDB.CHECK_DB检查数据库状态,是否可以顺利转换到目标平台:
1 2 3 4 5 6 7 8 9
SQL> set serveroutput on SQL> declare db_ready boolean; begin /* db_ready is ignored, but with SERVEROUTPUT set to ON any * conditions preventing transport will be output to console */ db_ready := dbms_tdb.check_db('Linux x86 64-bit', dbms_tdb.skip_none); end; /
SQL> set serveroutput on SQL> declare external boolean; begin /* value of external is ignored, but with SERVEROUTPUT set to ON * dbms_tdb.check_external displays report of external objects * on console */ external := dbms_tdb.check_external; end; /
CONVERT DATAFILE 'E:\\ORACLE\\PRODUCT\\10.2.0\\DB_1\\DATABASE\\DIGITALSCANDATA.DAT' FROM PLATFORM 'Microsoft Windows x86 64-bit' FORMAT 'D:\\RMAN\\DATA_D-ORCL_I-1276927241_TS-DIGITALSCANDATA_FNO-38_HDV216EA';
CONVERT DATAFILE 'E:\\ORACLE\\PRODUCT\\10.2.0\\DB_1\\DATABASE\\DIGITALSCANDATA01.DAT' FROM PLATFORM 'Microsoft Windows x86 64-bit' FORMAT 'D:\\RMAN\\DATA_D-ORCL_I-1276927241_TS-DIGITALSCANDATA_FNO-39_HEV216EA'; ...
根据目标平台文件系统布局,修改为:
1 2 3 4 5 6 7 8 9 10 11
RUN {
CONVERT DATAFILE '/mnt/data/database/DIGITALSCANDATA.DAT' FROM PLATFORM 'Microsoft Windows x86 64-bit' FORMAT '/u01/oradata/orcl/DATA_D-ORCL_I-1276927241_TS-DIGITALSCANDATA_FNO-38_HDV216EA';
CONVERT DATAFILE '/mnt/data/database/DIGITALSCANDATA01.DAT' FROM PLATFORM 'Microsoft Windows x86 64-bit' FORMAT '/u01/oradata/orcl/DATA_D-ORCL_I-1276927241_TS-DIGITALSCANDATA_FNO-39_HEV216EA'; ...
-- The following commands will create a new control file and use it -- to open the database. -- Data used by Recovery Manager will be lost. -- The contents of online logs will be lost and all backups will -- be invalidated. Use this only if online logs are damaged.
-- After mounting the created controlfile, the following SQL -- statement will place the database in the appropriate -- protection mode: -- ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE
STARTUP NOMOUNT PFILE='D:\\RMAN\\INIT_00V216EA_1_0.ORA' CREATE CONTROLFILE REUSE SET DATABASE "ORCL" RESETLOGS FORCE LOGGING ARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 14616 LOGFILE GROUP 1'D:\\RMAN\\ARCH_D-ORCL_ID-1276927241_S-517_T-1_A-1017328065_00V216EA' SIZE 50M, GROUP 2'D:\\RMAN\\ARCH_D-ORCL_ID-1276927241_S-515_T-1_A-1017328065_00V216EA' SIZE 50M, GROUP 3'D:\\RMAN\\ARCH_D-ORCL_ID-1276927241_S-516_T-1_A-1017328065_00V216EA' SIZE 50M DATAFILE 'D:\\RMAN\\DATA_D-ORCL_I-1276927241_TS-SYSTEM_FNO-1_IKV216EF', ...
相应修改为:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
STARTUP NOMOUNT PFILE='/u01/app/oracle/admin/orcl/pfile/INIT_00V216EA_1_0.ORA' CREATE CONTROLFILE REUSE SET DATABASE "ORCL" RESETLOGS FORCE LOGGING ARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 14616 LOGFILE GROUP 1'/u01/oradata/orcl/ARCH_D-ORCL_ID-1276927241_S-517_T-1_A-1017328065_00V216EA' SIZE 50M, GROUP 2'/u01/oradata/orcl/ARCH_D-ORCL_ID-1276927241_S-515_T-1_A-1017328065_00V216EA' SIZE 50M, GROUP 3'/u01/oradata/orcl/ARCH_D-ORCL_ID-1276927241_S-516_T-1_A-1017328065_00V216EA' SIZE 50M DATAFILE '/u01/oradata/orcl/DATA_D-ORCL_I-1276927241_TS-SYSTEM_FNO-1_IKV216EF', ...