rman (同平台 db版本)迁移
os version都是
Distributor ID: RedHatEnterpriseAS
Description: Red Hat Enterprise Linux AS release 4 (Nahant Update 7)
Release: 4
Codename: NahantUpdate7
源库 目标库都是
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
os version都是
Distributor ID: RedHatEnterpriseAS
Description: Red Hat Enterprise Linux AS release 4 (Nahant Update 7)
Release: 4
Codename: NahantUpdate7
源库 目标库都是
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
准备:
源库》
备份数据库 备份控制文件
拷贝备份文件 归档文件 日志文件到目标库相同路径下
导出pfile文件
拷贝至目标库 任意路径下或相同路径下
源库》
备份数据库 备份控制文件
拷贝备份文件 归档文件 日志文件到目标库相同路径下
导出pfile文件
拷贝至目标库 任意路径下或相同路径下
目标库》
pfile中指定一些路径预先建好 ex:bdump等
pfile中指定一些路径预先建好 ex:bdump等
RMAN> startup nomount pfile='/u01/app/oracle/db10g/dbs/initorcl.ora';
Oracle instance started
Total System Global Area 167772160 bytes
Fixed Size 1266392 bytes
Variable Size 75500840 bytes
Database Buffers 88080384 bytes
Redo Buffers 2924544 bytes
RMAN> restore controlfile from '/u01/app/oracle/flash_recovery_area/ORCL/autobackup/2010_10_13/o1_mf_s_732295240_6cd1n94d_.bkp';
Variable Size 75500840 bytes
Database Buffers 88080384 bytes
Redo Buffers 2924544 bytes
RMAN> restore controlfile from '/u01/app/oracle/flash_recovery_area/ORCL/autobackup/2010_10_13/o1_mf_s_732295240_6cd1n94d_.bkp';
Starting restore at 13-OCT-10
using channel ORA_DISK_1
using channel ORA_DISK_1
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:06
output filename=/u01/app/oracle/oradata/orcl/control01.ctl
output filename=/u01/app/oracle/oradata/orcl/control02.ctl
output filename=/u01/app/oracle/oradata/orcl/control03.ctl
Finished restore at 13-OCT-10
channel ORA_DISK_1: restore complete, elapsed time: 00:00:06
output filename=/u01/app/oracle/oradata/orcl/control01.ctl
output filename=/u01/app/oracle/oradata/orcl/control02.ctl
output filename=/u01/app/oracle/oradata/orcl/control03.ctl
Finished restore at 13-OCT-10
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
released channel: ORA_DISK_1
RMAN> restore database;
Starting restore at 13-OCT-10
Starting implicit crosscheck backup at 13-OCT-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 1 objects
Finished implicit crosscheck backup at 13-OCT-10
Starting implicit crosscheck backup at 13-OCT-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 1 objects
Finished implicit crosscheck backup at 13-OCT-10
Starting implicit crosscheck copy at 13-OCT-10
using channel ORA_DISK_1
Finished implicit crosscheck copy at 13-OCT-10
using channel ORA_DISK_1
Finished implicit crosscheck copy at 13-OCT-10
searching for all files in the recovery area
cataloging files...
cataloging done
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2010_10_13/o1_mf_s_732295240_6cd1n94d_.bkp
=======================
File Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2010_10_13/o1_mf_s_732295240_6cd1n94d_.bkp
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u01/app/oracle/oradata/orcl/system01.dbf
restoring datafile 00002 to /u01/app/oracle/oradata/orcl/undotbs01.dbf
restoring datafile 00003 to /u01/app/oracle/oradata/orcl/sysaux01.dbf
restoring datafile 00004 to /u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/ORCL/backupset/2010_10_13/o1_mf_nnndf_TAG20101013T151954_6cd1ltst_.bkp
channel ORA_DISK_1: restored backup piece 1
piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2010_10_13/o1_mf_nnndf_TAG20101013T151954_6cd1ltst_.bkp tag=TAG20101013T151954
channel ORA_DISK_1: restore complete, elapsed time: 00:00:46
Finished restore at 13-OCT-10
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u01/app/oracle/oradata/orcl/system01.dbf
restoring datafile 00002 to /u01/app/oracle/oradata/orcl/undotbs01.dbf
restoring datafile 00003 to /u01/app/oracle/oradata/orcl/sysaux01.dbf
restoring datafile 00004 to /u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/ORCL/backupset/2010_10_13/o1_mf_nnndf_TAG20101013T151954_6cd1ltst_.bkp
channel ORA_DISK_1: restored backup piece 1
piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2010_10_13/o1_mf_nnndf_TAG20101013T151954_6cd1ltst_.bkp tag=TAG20101013T151954
channel ORA_DISK_1: restore complete, elapsed time: 00:00:46
Finished restore at 13-OCT-10
RMAN> recover database;
Starting recover at 13-OCT-10
using channel ORA_DISK_1
using channel ORA_DISK_1
starting media recovery
archive log thread 1 sequence 4 is already on disk as file /u01/app/oracle/oradata/orcl/redo01.log
archive log filename=/u01/app/oracle/oradata/orcl/redo01.log thread=1 sequence=4
media recovery complete, elapsed time: 00:00:04
Finished recover at 13-OCT-10
archive log filename=/u01/app/oracle/oradata/orcl/redo01.log thread=1 sequence=4
media recovery complete, elapsed time: 00:00:04
Finished recover at 13-OCT-10
RMAN> alter database open;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 10/13/2010 15:22:04
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 10/13/2010 15:22:04
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
RMAN> alter database open resetlogs;
database opened
修改/etc/oratab
$ORACLE_SID;$ORACLE_HOME:Y:
注:跨版本迁移 高往低 就会:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 10/15/2010 21:25:38
ORA-00201: control file version 10.2.0.3.0 incompatible with ORACLE version 10.2.0.1.0
注:跨版本迁移 高往低 就会:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 10/15/2010 21:25:38
ORA-00201: control file version 10.2.0.3.0 incompatible with ORACLE version 10.2.0.1.0
案例:os 版本一致 跨数据库版本
源库 10.2.0.1.0
目标库 10.2.0.3.0
源库的操作和上面一样
目标库:
修改pfile文件中路径 适应本地的路径
使用pfile启动数据库
还原控制文件 同上
alter database mount;
修改数据文件和日志文件的路径
select name from v$datafile;select * from v$logfile;
使用alter database rename file 'source path' to 'target path';
ex:
alter database rename file '/u01/oracle/oradata/orcl/system01.dbf' to '/u01/app/oracle/oradata/orcl/system01.dbf';
restore database;
或
{
RMAN> run{
2> set newname for datafile 1 to '/u01/app/oracle/oradata/orcl/system01.dbf';
3> set newname for datafile 2 to '/u01/app/oracle/oradata/orcl/undotbs01.dbf';
4> set newname for datafile 3 to '/u01/app/oracle/oradata/orcl/sysaux01.dbf';
5> set newname for datafile 4 to '/u01/app/oracle/oradata/orcl/users01.dbf';
6> restore database;
7> }
目标库:
修改pfile文件中路径 适应本地的路径
使用pfile启动数据库
还原控制文件 同上
alter database mount;
修改数据文件和日志文件的路径
select name from v$datafile;select * from v$logfile;
使用alter database rename file 'source path' to 'target path';
ex:
alter database rename file '/u01/oracle/oradata/orcl/system01.dbf' to '/u01/app/oracle/oradata/orcl/system01.dbf';
restore database;
或
{
RMAN> run{
2> set newname for datafile 1 to '/u01/app/oracle/oradata/orcl/system01.dbf';
3> set newname for datafile 2 to '/u01/app/oracle/oradata/orcl/undotbs01.dbf';
4> set newname for datafile 3 to '/u01/app/oracle/oradata/orcl/sysaux01.dbf';
5> set newname for datafile 4 to '/u01/app/oracle/oradata/orcl/users01.dbf';
6> restore database;
7> }
executing command: SET NEWNAME
using target database control file instead of recovery catalog
using target database control file instead of recovery catalog
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 13-OCT-10
Starting implicit crosscheck backup at 13-OCT-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
Crosschecked 1 objects
Finished implicit crosscheck backup at 13-OCT-10
。。。
}
RMAN> recover database;
Starting implicit crosscheck backup at 13-OCT-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
Crosschecked 1 objects
Finished implicit crosscheck backup at 13-OCT-10
。。。
}
RMAN> recover database;
Starting recover at 13-OCT-10
using channel ORA_DISK_1
using channel ORA_DISK_1
starting media recovery
archive log thread 1 sequence 1 is already on disk as file /u01/app/oracle/oradata/orcl/redo03.log
archive log filename=/u01/app/oracle/oradata/orcl/redo03.log thread=1 sequence=1
media recovery complete, elapsed time: 00:00:07
Finished recover at 13-OCT-10
RMAN> alter database open resetlogs;
archive log filename=/u01/app/oracle/oradata/orcl/redo03.log thread=1 sequence=1
media recovery complete, elapsed time: 00:00:07
Finished recover at 13-OCT-10
RMAN> alter database open resetlogs;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 10/13/2010 16:37:40
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
ORA-03114: not connected to ORACLE
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 10/13/2010 16:37:40
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 10/13/2010 16:37:40
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
ORA-03114: not connected to ORACLE
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 10/13/2010 16:37:40
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option
sql>startup upgrade
sql>@/u01/app/oracle/db10g/rdbms/admin/catupgrd.sql
....
sql>@/u01/app/oracle/db10g/rdbms/admin/catupgrd.sql
....
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21993926/viewspace-675978/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/21993926/viewspace-675978/