环境描述
原系统: 11.2.0.3.0
目标系统 11.2.0.4.0
1.原系统进行备份
run
{
allocate channel c1 type disk;
allocate channel c2 type disk;
backup database format '/u01/full_%n_%T_%t_%s_%p.bak';
sql 'alter system archive log current';
backup archivelog all format '/u01/arch_%d_%T_%s_%p.bak' delete input;
backup current controlfile format '/u01/ctl_%d_%T_%s_%p.bak';
release channel c1;
release channel c2;
}
2.传输备份
3.异机恢复
3.1 编辑pfile并启库
3.2 还原控制文件
RMAN> restore controlfile from '/u01/ctl_MYTEST_20171010_8_1.bak';
3.3 还原归档
RMAN> list backup of archivelog all;
using target database control file instead of recovery catalog
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
6 602.50K DISK 00:00:00 10-OCT-17
BP Key: 6 Status: AVAILABLE Compressed: NO Tag: TAG20171010T233223
Piece Name: /u01/arch_MYTEST_20171010_6_1.bak
List of Archived Logs in backup set 6
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 626 12816578 10-OCT-17 12817363 10-OCT-17
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
7 223.00K DISK 00:00:00 10-OCT-17
BP Key: 7 Status: AVAILABLE Compressed: NO Tag: TAG20171010T233223
Piece Name: /u01/arch_MYTEST_20171010_7_1.bak
List of Archived Logs in backup set 7
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 627 12817363 10-OCT-17 12818121 10-OCT-17
1 628 12818121 10-OCT-17 12818129 10-OCT-17
RMAN> restore archivelog sequence between 627 and 628;
Starting restore at 11-OCT-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=7510 device type=DISK
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=627
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=628
channel ORA_DISK_1: reading from backup piece /u01/arch_MYTEST_20171010_7_1.bak
channel ORA_DISK_1: piece handle=/u01/arch_MYTEST_20171010_7_1.bak tag=TAG20171010T233223
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 11-OCT-17
3.3 还原数据文件
RUN
{
ALLOCATE CHANNEL c1 DEVICE TYPE DISK;
set newname for datafile 1 to "/u01/app/oracle/mytest/system.301.940986413";
set newname for datafile 2 to "/u01/app/oracle/mytest/sysaux.304.940986413";
set newname for datafile 3 to "/u01/app/oracle/mytest/undotbs1.303.940986413";
set newname for datafile 4 to "/u01/app/oracle/mytest/users.302.940986413";
set newname for tempfile 1 to "/u01/app/oracle/mytest/temp.256.940986481";
SET UNTIL sequence 628 thread 1;
RESTORE DATABASE;
SWITCH DATAFILE ALL;
RECOVER DATABASE;
}
3.4 处理logfile
ALTER DATABASE RENAME FILE ''+DG/mytest/onlinelog/group_3.293.940986475'' to ''/u01/app/oracle/mytest/group_3.293.940986475'';
ALTER DATABASE RENAME FILE ''+DG/mytest/onlinelog/group_2.300.940986471'' to ''/u01/app/oracle/mytest/group_2.300.940986471'';
ALTER DATABASE RENAME FILE ''+DG/mytest/onlinelog/group_1.292.940986469'' to ''/u01/app/oracle/mytest/group_1.292.940986469'';
4.启库
5.运行脚本
5.1 catupgrd.sql 数据字典升级脚
5.2 utlrp.sql 编译失效对象
5.3 catuppst.sql 执行一些未在升级包中的操作
5.4 utlu112s.sql 升级结果
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7569309/viewspace-2145892/
,如需转载,请注明出处,否则将追究法律责任。