100% 25KB 25.0KB/s 00:00
arch_JYRAC_20171229_0ksnb4q5_1_1
100% 93KB 93.0KB/s 00:00
c-2655496871-20171229-00
100% 18MB 17.9MB/s 00:01
jyrac_0jsnb48u_JYRAC_964006174_19_1
100% 1861MB 38.0MB/s 00:49
[oracle@jytest3 rman]$ ls -lrt
total 1924300
-rw-r-----. 1 oracle oinstall 25600 Dec 30 01:48 arch_JYRAC_20171229_0isnb48r_1_1
-rw-r-----. 1 oracle oinstall 95232 Dec 30 01:48 arch_JYRAC_20171229_0ksnb4q5_1_1
-rw-r-----. 1 oracle oinstall 18776064 Dec 30 01:48 c-2655496871-20171229-00
-rw-r-----. 1 oracle oinstall 1951571968 Dec 30 01:49 jyrac_0jsnb48u_JYRAC_964006174_19_1
4.在目标主机上,设置ORACLE_SID为源数据库的SID(jyrac1为单实例数据库)
[oracle@jytest3 ~]$ export ORACLE_SID=jyrac1
5.在目标主机上启动RMAN并连接到目标数据库
[oracle@jytest3 ~]$ rman target/ nocatalog
Recovery Manager: Release 12.2.0.1.0 - Production on Sat Dec 30 02:06:59 2017
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
connected to target database (not started)
6.设置DBID,该值为源数据库的DBID
RMAN> set DBID 2655496871
executing command: SET DBID
7.启动目标数据库到nomount状态
RMAN> startup nomount
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/12.2.0/db/dbs/initjyrac1.ora'
starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started
Total System Global Area 1073741824 bytes
Fixed Size 8628936 bytes
Variable Size 293602616 bytes
Database Buffers 763363328 bytes
Redo Buffers 8146944 bytes
RMAN查找spfile参数文件失败,因为它还没有被还原,然而,实例将会使用虚拟参数文件来进行启动。
8.从源数据库的自动备份文件中还原spfile参数文件
因为源数据库启用了控制文件自动备份,所以spfile参数文件会被包含在自动备份文件中。为了还原非缺省格式的自动备份,需要执行set controlfile autobackup format命令来指定格式。下面的命令将设置控制文件自动备份格式,将源数据库的spfile参数文件还原为/u01/app/oracle/product/12.2.0/db/dbs/initjyrac1.ora文件,然后关闭目标数据库。
RMAN> run
2> {
3> set controlfile autobackup format for device type disk to '/ora_xtts/rman/%F';
4> restore spfile to pfile '/u01/app/oracle/product/12.2.0/db/dbs/initjyrac1.ora' from autobackup;
5> shutdown abort;
6> }
executing command: SET CONTROLFILE AUTOBACKUP FORMAT
Starting restore at 30-DEC-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=6 device type=DISK