实战:Oracle10.2.0.4异机迁移并升级到Oracle 11.2.0.4(五)

2015-01-21 12:18:09 · 作者: · 浏览: 29
oracle/oradata/orcl/ex.dbf

RMAN> exit


Recovery Manager complete.
[oracle@ora1 ~]$ pwd
/home/oracle
[oracle@ora1 ~]$ cd bak
[oracle@ora1 bak]$ ls
diag.log? full_orcl_01pq07r8_1_1? full_orcl_02pq07sn_1_1
[oracle@ora1 bak]$

MAN> BACKUP ARCHIVELOG ALL format '/home/oracle/bak/%U';

Starting backup at 12-DEC-14
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=144 devtype=DISK
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=2 recid=1 stamp=866131136
input archive log thread=1 sequence=3 recid=2 stamp=866131686
input archive log thread=1 sequence=4 recid=3 stamp=866137581
channel ORA_DISK_1: starting piece 1 at 12-DEC-14
channel ORA_DISK_1: finished piece 1 at 12-DEC-14
piece handle=/home/oracle/bak/03pq0dg5_1_1 tag=TAG20141212T174638 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:04:31
Finished backup at 12-DEC-14



####在目标库主机上通过RMAN恢复源库


把备份集cp到目标主机上面,并在目标主机上面恢复数据库


修改spfile中的参数:*.diagnostic_dest='/home/oracle',并把background_dump_dest、core_dump_dest等参数去掉,因为在11G中已经不用这些参数了。

[oracle@ora11 bak]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Dec 11 17:27:18 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.? All rights reserved.

connected to target database: ORCL (not mounted)

RMAN> set DBID=1393903281;

executing command: SET DBID

RMAN> restore controlfile from '/home/oracle/bak/full_orcl_02pq07sn_1_1';

Starting restore at 11-DEC-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
output file name=/home/oracle/oradata/orcl/control01.ctl
output file name=/home/oracle/oradata/orcl/control02.ctl
output file name=/home/oracle/oradata/orcl/control03.ctl
Finished restore at 11-DEC-14

RMAN> sql 'alter database mount';

sql statement: alter database mount
released channel: ORA_DISK_1

RMAN> restore database;

Starting restore at 11-DEC-14
Starting implicit crosscheck backup at 11-DEC-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
Crosschecked 1 objects
Finished implicit crosscheck backup at 11-DEC-14

Starting implicit crosscheck copy at 11-DEC-14
using channel ORA_DISK_1
Finished implicit crosscheck copy at 11-DEC-14

searching for all files in the recovery area
cataloging files...
no files cataloged

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /home/oracle/oradata/orcl/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /home/oracle/oradata/orcl/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /home/oracle/oradata/orcl/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /home/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /home/oracle/oradata/orcl/example01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /home/oracle/oradata/orcl/system02.dbf
channel ORA_DISK_1: restoring datafile 00007 to /home/oracle/oradata/orcl/undotbs02.dbf
channel ORA