oracle rac rman 备份 怎么恢复到另外的rac
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了oracle rac rman 备份 怎么恢复到另外的rac相关的知识,希望对你有一定的参考价值。
参考技术A rac rman 备份和恢复 和单实例的备份和恢复稍有不同,ORACLE RAC主要是有多个实例,但是千万不要把多实例和多数据库搞混淆,在RAC中通常情况下一台服务器Oracle 11g R2 RAC数据库备份通过RMAN恢复到单实例数据库实现
Oracle 11g R2 RAC数据库备份通过RMAN恢复到单实例数据库实现
下面是我的一次从Oracle 11g R2 RAC到单实例间通过RMAN恢复备份集的过程,记录在此。
有些人以此方法作为RMAN备份有效性校验,当然我不反对这个说法,但我也相信RMAN提供的备份有效性校验方法,参考我整理的博文:《Oracle RMAN(Recovery Manager) – 安全性与监控》
操作环境:
• Source DB: 2-Node Oracle Database 11g R2 RAC On Linux(11.2.0.1 with ASM)
• Target DB: Single Instance Database 11g R2 On Linux(11.2.0.1 with FileSystem)
目标端数据库环境介绍:
[root@luocs ~]# hostname
[root@luocs ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/cciss/c0d0p1 388G 9.1G 359G 3% /
/dev/cciss/c0d0p3 421G 2.6G 397G 1% /data
tmpfs 5.9G 0 5.9G 0% /dev/shm
– 目标端磁盘空间需要充足,至少要比源端所有数据文件大小还大。
源端与目标端环境已准备好,下面开始进入操作。
1.将源端的一个FULL BACKUPSET拷贝到目标端
我在目标端创建/data/bak目录,将备份文件放于这里
[root@luocs ~]# mkdir /data/bak
[root@luocs ~]# chown -R oracle.oinstall /data/bak/
异机拷贝使用scp或者ftp方式都可以,略。
我这里备份文件已打包,所以在目标端进行解压
[oracle@luocs bak]$ tar zxvf fulldb20121211.tgz
[oracle@luocs bak]$ tar zxvf ArchFile20121211.tgz
2.从备份中恢复参数文件
我的一贯作风,在动现场之前保留一份源文件
[oracle@luocs dbs]$ pwd
/u01/app/oracle/product/11.2.0/dbhome_1/dbs
[oracle@luocs dbs]$ cp -p spfilehkrt.ora spfilehkrt.ora.bak
将数据库启动到nomount状态
SQL> startup nomount
ORACLE instance started.
Total System Global Area 5077495808 bytes
Fixed Size 2212976 bytes
Variable Size 3288337296 bytes
Database Buffers 1744830464 bytes
Redo Buffers 42115072 bytes
通过RMAN工具还原出参数文件,还原出初始化参数文件
RMAN> restore spfile to pfile \'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/inithkrt.ora\' from \'/data/bak/full_HKRT_1mnsi77q_1_1\';
Starting restore at 12-DEC-2012 00:21:03
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 spfile from AUTOBACKUP /data/bak/full_HKRT_1mnsi77q_1_1
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 12-DEC-2012 00:21:05
3.编辑初始化参数文件,相应地创建所需目录
[oracle@luocs dbs]$ cp -p inithkrt.ora inithkrt.ora.bak
我们恢复过来的参数文件是RAC的,所以我们要改成符合单实例数据库
[oracle@luocs dbs]$ cat inithkrt.ora
#hkrt1.__db_cache_size=4362076160
#hkrt2.__db_cache_size=5972688896
#hkrt1.__java_pool_size=67108864
#hkrt2.__java_pool_size=67108864
#hkrt1.__large_pool_size=67108864
#hkrt2.__large_pool_size=67108864
#hkrt1.__pga_aggregate_target=7381975040
#hkrt2.__pga_aggregate_target=6710886400
#hkrt1.__sga_target=9395240960
#hkrt2.__sga_target=10066329600
#hkrt1.__shared_io_pool_size=0
#hkrt2.__shared_io_pool_size=0
#hkrt1.__shared_pool_size=4630511616
#hkrt2.__shared_pool_size=3825205248
#hkrt2.__streams_pool_size=0
#hkrt1.__streams_pool_size=134217728
*.audit_file_dest=\'/u01/app/oracle/admin/hkrt/adump\'
*.audit_trail=\'db\'
#*.cluster_database=true
*.compatible=\'11.2.0.0.0\'
*.control_files=\'/u01/app/oracle/oradata/hkrt/control01.dbf\',\'/u01/app/oracle/oradata/hkrt/control02.dbf\'
*.db_block_size=8192
#*.db_create_file_dest=\'+ASMDATA\'
*.db_domain=\'\'
*.db_name=\'hkrt\'
#*.db_recovery_file_dest=\'+RECOVERY\'
#*.db_recovery_file_dest_size=47185920000
*.diagnostic_dest=\'/u01/app/oracle\'
*.dispatchers=\'(PROTOCOL=TCP) (SERVICE=hkrtXDB)\'
#hkrt2.instance_number=2
#hkrt1.instance_number=1
#hkrt1.local_listener=\'(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac01-vip.hkrt.com)(PORT=1521))))\'
#hkrt2.local_listener=\'(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac02-vip.hkrt.com)(PORT=1521))))\'
*.log_archive_dest_1=\'LOCATION=/u01/arch\'
#*.log_archive_dest_2=\'LOCATION=+ARCH\'
*.log_archive_format=\'%t_%s_%r.dbf\'
*.memory_target=5034213376
*.open_cursors=300
*.processes=400
#*.remote_listener=\'scan-cluster:1521\'
*.remote_login_passwordfile=\'exclusive\'
#hkrt2.thread=2
#hkrt1.thread=1
#hkrt1.undo_tablespace=\'UNDOTBS1\'
#hkrt2.undo_tablespace=\'UNDOTBS2\'
*.undo_tablespace=\'UNDOTBS1\'
创建相应的目录
[root@luocs ~]# mkdir /u01/arch
[root@luocs ~]# chown oracle.oinstall /u01/arch
-- 存放归档日志文件
[root@luocs ~]# mkdir /u01/app/oracle/admin/hkrt/adump -p
[root@luocs ~]# chown -R oracle.oinstall /u01/app/oracle/admin/hkrt
-- 存放审计跟踪文件
[root@luocs ~]# mkdir /u01/app/oracle/oradata/hkrt/
[root@luocs ~]# chown oracle.oinstall /u01/app/oracle/oradata/hkrt/
-- 存放数据文件
4.通过编辑好的初始化参数重启数据库到NOMOUNT
SQL> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> create spfile from pfile;
File created.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 5077495808 bytes
Fixed Size 2212976 bytes
Variable Size 3288337296 bytes
Database Buffers 1744830464 bytes
Redo Buffers 42115072 bytes
5.从备份集还原控制文件
我们从备份集里还原出控制文件
RMAN> restore controlfile from \'/data/bak/full_HKRT_1lnsi77o_1_1\';
Starting restore at 12-DEC-2012 00:35:22
using channel ORA_DISK_1
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/hkrt/control01.dbf
output file name=/u01/app/oracle/oradata/hkrt/control02.dbf
Finished restore at 12-DEC-2012 00:35:23
将数据库启动到MOUNT状态
RMAN> mount database;
database mounted
released channel: ORA_DISK_1
6.将备份集注册进控制文件里
RMAN> catalog start with \'/data/bak/\';
searching for all files that match the pattern /data/bak/
List of Files Unknown to the Database
=====================================
File Name: /data/bak/full_HKRT_1mnsi77q_1_1
File Name: /data/bak/arch_HKRT_1onsi78l_1_1
File Name: /data/bak/ArchFile20121211.tgz
File Name: /data/bak/full_HKRT_1knsi76k_1_1
File Name: /data/bak/full_HKRT_1lnsi77o_1_1
File Name: /data/bak/full_HKRT_1jnsi76k_1_1
File Name: /data/bak/arch_HKRT_1nnsi78j_1_1
File Name: /data/bak/arch_HKRT_1pnsi7ha_1_1
File Name: /data/bak/fulldb20121211.tgz
Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /data/bak/full_HKRT_1mnsi77q_1_1
File Name: /data/bak/arch_HKRT_1onsi78l_1_1
File Name: /data/bak/full_HKRT_1knsi76k_1_1
File Name: /data/bak/full_HKRT_1lnsi77o_1_1
File Name: /data/bak/full_HKRT_1jnsi76k_1_1
File Name: /data/bak/arch_HKRT_1nnsi78j_1_1
File Name: /data/bak/arch_HKRT_1pnsi7ha_1_1
List of Files Which Where Not Cataloged
=======================================
File Name: /data/bak/ArchFile20121211.tgz
RMAN-07517: Reason: The file header is corrupted
File Name: /data/bak/fulldb20121211.tgz
RMAN-07517: Reason: The file header is corrupted
可以通过list backup;查看,略。
7.确认数据文件、联机日志文件、临时文件路径
SQL> set pagesize 9999
SQL> col NAME for a65
SQL> select file#,name from v$datafile;
FILE# NAME
---------- -----------------------------------------------------------------
1 +ASMDATA/hkrt/datafile/system.260.781033387
2 +ASMDATA/hkrt/datafile/sysaux.269.781033387
3 +ASMDATA/hkrt/datafile/undotbs1.264.781033387
4 +ASMDATA/hkrt/datafile/users.268.781033387
5 +ASMDATA/hkrt/datafile/undotbs2.265.781033679
6 +ASMDATA/hkrt/datafile/sell.270.786630869
7 +ASMDATA/hkrt/datafile/proxy.271.786631115
8 +ASMDATA/hkrt/datafile/pay.272.786631367
9 +ASMDATA/hkrt/datafile/payment.273.786631689
10 +ASMDATA/hkrt/datafile/cms.274.786724997
11 +ASMDATA/hkrt/datafile/itrusradb.276.787063121
12 +ASMDATA/hkrt/datafile/itruscadb.275.787061395
13 +ASMDATA/hkrt/datafile/ob2c.277.789750069
13 rows selected.
SQL> col MEMBER for a65
SQL> select member from v$logfile;
MEMBER
------------------------------------------------------------------------------------------------------------------------------------------------------
+ASMDATA/hkrt/onlinelog/group_5.262.781033549
+RECOVERY/hkrt/onlinelog/group_5.259.781033555
+ASMDATA/hkrt/onlinelog/group_2.266.781033537
+RECOVERY/hkrt/onlinelog/group_2.258.781033543
+ASMDATA/hkrt/onlinelog/group_1.267.781033527
+RECOVERY/hkrt/onlinelog/group_1.257.781033533
+ASMDATA/hkrt/onlinelog/group_3.259.781033803
+RECOVERY/hkrt/onlinelog/group_3.260.781033809
+ASMDATA/hkrt/onlinelog/group_4.258.781033815
+RECOVERY/hkrt/onlinelog/group_4.261.781033821
+ASMDATA/hkrt/onlinelog/group_6.257.781033825
+RECOVERY/hkrt/onlinelog/group_6.262.781033831
12 rows selected.
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
+ASMDATA/hkrt/tempfile/temp.261.781033565
8.通过RMAN重命名数据文件和临时文件,进行还原
RMAN> RUN {
2> SET NEWNAME FOR DATAFILE 1 to \'/u01/app/oracle/oradata/hkrt/system01.dbf\';
3> SET NEWNAME FOR DATAFILE 2 to \'/u01/app/oracle/oradata/hkrt/sysaux01.dbf\';
SET NEWNAME FOR DATAFILE 3 to \'/u01/app/oracle/oradata/hkrt/undotbs1.dbf\';
SET NEWNAME FOR DATAFILE 4 to \'/u01/app/oracle/oradata/hkrt/users01.dbf\';
6> SET NEWNAME FOR DATAFILE 5 to \'/u01/app/oracle/oradata/hkrt/undotbs2.dbf\';
SET NEWNAME FOR DATAFILE 6 to \'/u01/app/oracle/oradata/hkrt/sell01.dbf\';
SET NEWNAME FOR DATAFILE 7 to \'/u01/app/oracle/oradata/hkrt/proxy01.dbf\';
9> SET NEWNAME FOR DATAFILE 8 to \'/u01/app/oracle/oradata/hkrt/pay01.dbf\';
10> SET NEWNAME FOR DATAFILE 9 to \'/u01/app/oracle/oradata/hkrt/payment01.dbf\';
SET NEWNAME FOR DATAFILE 10 to \'/u01/app/oracle/oradata/hkrt/cms01.dbf\';
SET NEWNAME FOR DATAFILE 11 to \'/u01/app/oracle/oradata/hkrt/itrusradb01.dbf\';
SET NEWNAME FOR DATAFILE 12 to \'/u01/app/oracle/oradata/hkrt/itruscadb01.dbf\';
14> SET NEWNAME FOR DATAFILE 13 to \'/u01/app/oracle/oradata/hkrt/ob2c01.dbf\';
SET NEWNAME FOR TEMPFILE 1 to \'/u01/app/oracle/oradata/hkrt/temp01.dbf\';
RESTORE DATABASE;
17> SWITCH DATAFILE ALL;
SWITCH TEMPFILE ALL;
19>
20> }
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 12-DEC-2012 00:37:38
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
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 /u01/app/oracle/oradata/hkrt/system01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/hkrt/undotbs1.dbf
channel ORA_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/hkrt/sell01.dbf
channel ORA_DISK_1: restoring datafile 00008 to /u01/app/oracle/oradata/hkrt/pay01.dbf
channel ORA_DISK_1: restoring datafile 00010 to /u01/app/oracle/oradata/hkrt/cms01.dbf
channel ORA_DISK_1: restoring datafile 00011 to /u01/app/oracle/oradata/hkrt/itrusradb01.dbf
channel ORA_DISK_1: reading from backup piece /u01/bak/rman_bk/full_HKRT_1knsi76k_1_1
channel ORA_DISK_1: errors found reading piece handle=/u01/bak/rman_bk/full_HKRT_1knsi76k_1_1
channel ORA_DISK_1: failover to piece handle=/data/bak/full_HKRT_1knsi76k_1_1 tag=BACKUPDATABASE
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:06:16
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 00002 to /u01/app/oracle/oradata/hkrt/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/hkrt/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/hkrt/undotbs2.dbf
channel ORA_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/hkrt/proxy01.dbf
channel ORA_DISK_1: restoring datafile 00009 to /u01/app/oracle/oradata/hkrt/payment01.dbf
channel ORA_DISK_1: restoring datafile 00012 to /u01/app/oracle/oradata/hkrt/itruscadb01.dbf
channel ORA_DISK_1: restoring datafile 00013 to /u01/app/oracle/oradata/hkrt/ob2c01.dbf
channel ORA_DISK_1: reading from backup piece /data/bak/full_HKRT_1jnsi76k_1_1
channel ORA_DISK_1: piece handle=/data/bak/full_HKRT_1jnsi76k_1_1 tag=BACKUPDATABASE
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:06:05
Finished restore at 12-DEC-2012 00:50:01
datafile 1 switched to datafile copy
input datafile copy RECID=14 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=15 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=16 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/undotbs1.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=17 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=18 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/undotbs2.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=19 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/sell01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=20 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/proxy01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=21 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/pay01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=22 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/payment01.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=23 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/cms01.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=24 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/itrusradb01.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=25 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/itruscadb01.dbf
datafile 13 switched to datafile copy
input datafile copy RECID=26 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/ob2c01.dbf
renamed tempfile 1 to /u01/app/oracle/oradata/hkrt/temp01.dbf in control file
9.修改联机日志文件的路径
alter database rename file \'+ASMDATA/hkrt/onlinelog/group_1.267.781033527\' to \'/u01/app/oracle/oradata/hkrt/redo1_1.log\';
alter database rename file \'+RECOVERY/hkrt/onlinelog/group_1.257.781033533\' to \'/u01/app/oracle/oradata/hkrt/redo1_2.log\';
alter database rename file \'+ASMDATA/hkrt/onlinelog/group_2.266.781033537\' to \'/u01/app/oracle/oradata/hkrt/redo2_1.log\';
alter database rename file \'+RECOVERY/hkrt/onlinelog/group_2.258.781033543\' to \'/u01/app/oracle/oradata/hkrt/redo2_2.log\';
alter database rename file \'+ASMDATA/hkrt/onlinelog/group_3.259.781033803\' to \'/u01/app/oracle/oradata/hkrt/redo3_1.log\';
alter database rename file \'+RECOVERY/hkrt/onlinelog/group_3.260.781033809\' to \'/u01/app/oracle/oradata/hkrt/redo3_2.log\';
alter database rename file \'+ASMDATA/hkrt/onlinelog/group_4.258.781033815\' to \'/u01/app/oracle/oradata/hkrt/redo4_1.log\';
alter database rename file \'+RECOVERY/hkrt/onlinelog/group_4.261.781033821\' to \'/u01/app/oracle/oradata/hkrt/redo4_2.log\';
alter database rename file \'+ASMDATA/hkrt/onlinelog/group_5.262.781033549\' to \'/u01/app/oracle/oradata/hkrt/redo5_1.log\';
alter database rename file \'+RECOVERY/hkrt/onlinelog/group_5.259.781033555\' to \'/u01/app/oracle/oradata/hkrt/redo5_2.log\';
alter database rename file \'+ASMDATA/hkrt/onlinelog/group_6.257.781033825\' to \'/u01/app/oracle/oradata/hkrt/redo6_1.log\';
alter database rename file \'+RECOVERY/hkrt/onlinelog/group_6.262.781033831\' to \'/u01/app/oracle/oradata/hkrt/redo6_2.log\';
-- 上面操作在执行的时候会报ERROR,类似如下:
SQL> alter database rename file \'+ASMDATA/hkrt/onlinelog/group_6.257.781033825\' to \'/u01/app/oracle/oradata/hkrt/redo6_1.log\';
alter database rename file \'+ASMDATA/hkrt/onlinelog/group_6.257.781033825\' to \'/u01/app/oracle/oradata/hkrt/redo6_1.log\'
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 14779
Session ID: 158 Serial number: 3
-- 可见报错后session被断开,我们需要重新连接实例继续往下执行
联机日志文件修改之后查看
SQL> set pagesize 9999
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/hkrt/redo5_1.log
/u01/app/oracle/oradata/hkrt/redo5_2.log
/u01/app/oracle/oradata/hkrt/redo2_1.log
/u01/app/oracle/oradata/hkrt/redo2_2.log
/u01/app/oracle/oradata/hkrt/redo1_1.log
/u01/app/oracle/oradata/hkrt/redo1_2.log
/u01/app/oracle/oradata/hkrt/redo3_1.log
/u01/app/oracle/oradata/hkrt/redo3_2.log
/u01/app/oracle/oradata/hkrt/redo4_1.log
/u01/app/oracle/oradata/hkrt/redo4_2.log
/u01/app/oracle/oradata/hkrt/redo6_1.log
/u01/app/oracle/oradata/hkrt/redo6_2.log
12 rows selected.
10.恢复数据库
RMAN> recover database;
Starting recover at 12-DEC-2012 01:07:39
using channel ORA_DISK_1
starting media recovery
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=515
channel ORA_DISK_1: restoring archived log
archived log thread=2 sequence=506
channel ORA_DISK_1: reading from backup piece /data/bak/arch_HKRT_1onsi78l_1_1
channel ORA_DISK_1: piece handle=/data/bak/arch_HKRT_1onsi78l_1_1 tag=BACKUPARCH
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:03:35
archived log file name=/u01/arch/1_515_781033526.dbf thread=1 sequence=515
archived log file name=/u01/arch/2_506_781033526.dbf thread=2 sequence=506
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=516
channel ORA_DISK_1: restoring archived log
archived log thread=2 sequence=507
channel ORA_DISK_1: reading from backup piece /data/bak/arch_HKRT_1pnsi7ha_1_1
channel ORA_DISK_1: piece handle=/data/bak/arch_HKRT_1pnsi7ha_1_1 tag=BACKUPARCH
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/u01/arch/1_516_781033526.dbf thread=1 sequence=516
archived log file name=/u01/arch/2_507_781033526.dbf thread=2 sequence=507
unable to find archived log
archived log thread=2 sequence=508
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 12/12/2012 01:11:21
RMAN-06054: media recovery requesting unknown archived log for thread 2 with sequence 508 and starting SCN of 121279435
11.RESETLOGS打开数据库
SQL> alter database open resetlogs;
Database altered.
完整输出日志内容:
alter database open resetlogs
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: \'/u01/app/oracle/oradata/hkrt/redo1_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 1 thread 1: \'/u01/app/oracle/oradata/hkrt/redo1_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: \'/u01/app/oracle/oradata/hkrt/redo1_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 1 thread 1: \'/u01/app/oracle/oradata/hkrt/redo1_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: \'/u01/app/oracle/oradata/hkrt/redo2_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 2 thread 1: \'/u01/app/oracle/oradata/hkrt/redo2_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: \'/u01/app/oracle/oradata/hkrt/redo2_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 2 thread 1: \'/u01/app/oracle/oradata/hkrt/redo2_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 3 of thread 2
ORA-00312: online log 3 thread 2: \'/u01/app/oracle/oradata/hkrt/redo3_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 3 thread 2: \'/u01/app/oracle/oradata/hkrt/redo3_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 3 of thread 2
ORA-00312: online log 3 thread 2: \'/u01/app/oracle/oradata/hkrt/redo3_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 3 thread 2: \'/u01/app/oracle/oradata/hkrt/redo3_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 4 of thread 2
ORA-00312: online log 4 thread 2: \'/u01/app/oracle/oradata/hkrt/redo4_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 4 thread 2: \'/u01/app/oracle/oradata/hkrt/redo4_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 4 of thread 2
ORA-00312: online log 4 thread 2: \'/u01/app/oracle/oradata/hkrt/redo4_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 4 thread 2: \'/u01/app/oracle/oradata/hkrt/redo4_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 5 of thread 1
ORA-00312: online log 5 thread 1: \'/u01/app/oracle/oradata/hkrt/redo5_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 5 thread 1: \'/u01/app/oracle/oradata/hkrt/redo5_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 5 of thread 1
ORA-00312: online log 5 thread 1: \'/u01/app/oracle/oradata/hkrt/redo5_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 5 thread 1: \'/u01/app/oracle/oradata/hkrt/redo5_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 6 of thread 2
ORA-00312: online log 6 thread 2: \'/u01/app/oracle/oradata/hkrt/redo6_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 6 thread 2: \'/u01/app/oracle/oradata/hkrt/redo6_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 6 of thread 2
ORA-00312: online log 6 thread 2: \'/u01/app/oracle/oradata/hkrt/redo6_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 6 thread 2: \'/u01/app/oracle/oradata/hkrt/redo6_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
RESETLOGS after incomplete recovery UNTIL CHANGE 121279435
Resetting resetlogs activation ID 3199883568 (0xbeba5930)
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: \'/u01/app/oracle/oradata/hkrt/redo1_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 1 thread 1: \'/u01/app/oracle/oradata/hkrt/redo1_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: \'/u01/app/oracle/oradata/hkrt/redo1_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 1 thread 1: \'/u01/app/oracle/oradata/hkrt/redo1_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: \'/u01/app/oracle/oradata/hkrt/redo2_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 2 thread 1: \'/u01/app/oracle/oradata/hkrt/redo2_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: \'/u01/app/oracle/oradata/hkrt/redo2_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 2 thread 1: \'/u01/app/oracle/oradata/hkrt/redo2_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 3 of thread 2
ORA-00312: online log 3 thread 2: \'/u01/app/oracle/oradata/hkrt/redo3_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 3 thread 2: \'/u01/app/oracle/oradata/hkrt/redo3_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 3 of thread 2
ORA-00312: online log 3 thread 2: \'/u01/app/oracle/oradata/hkrt/redo3_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 3 thread 2: \'/u01/app/oracle/oradata/hkrt/redo3_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Wed Dec 12 01:13:12 2012
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 4 of thread 2
ORA-00312: online log 4 thread 2: \'/u01/app/oracle/oradata/hkrt/redo4_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 4 thread 2: \'/u01/app/oracle/oradata/hkrt/redo4_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 4 of thread 2
ORA-00312: online log 4 thread 2: \'/u01/app/oracle/oradata/hkrt/redo4_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 4 thread 2: \'/u01/app/oracle/oradata/hkrt/redo4_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 5 of thread 1
ORA-00312: online log 5 thread 1: \'/u01/app/oracle/oradata/hkrt/redo5_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 5 thread 1: \'/u01/app/oracle/oradata/hkrt/redo5_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 5 of thread 1
ORA-00312: online log 5 thread 1: \'/u01/app/oracle/oradata/hkrt/redo5_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 5 thread 1: \'/u01/app/oracle/oradata/hkrt/redo5_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 6 of thread 2
ORA-00312: online log 6 thread 2: \'/u01/app/oracle/oradata/hkrt/redo6_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 6 thread 2: \'/u01/app/oracle/oradata/hkrt/redo6_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 6 of thread 2
ORA-00312: online log 6 thread 2: \'/u01/app/oracle/oradata/hkrt/redo6_2.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 6 thread 2: \'/u01/app/oracle/oradata/hkrt/redo6_1.log\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Wed Dec 12 01:13:25 2012
Setting recovery target incarnation to 3
Wed Dec 12 01:13:25 2012
Assigning activation ID 3220640364 (0xbff7126c)
LGWR: STARTING ARCH PROCESSES
Wed Dec 12 01:13:25 2012
ARC0 started with pid=21, OS id=14930
ARC0: Archival started
LGWR: STARTING ARCH PROCESSES COMPLETE
ARC0: STARTING ARCH PROCESSES
Wed Dec 12 01:13:26 2012
ARC1 started with pid=25, OS id=14934
Wed Dec 12 01:13:26 2012
ARC2 started with pid=26, OS id=14938
Wed Dec 12 01:13:26 2012
ARC3 started with pid=27, OS id=14942
ARC1: Archival started
ARC2: Archival started
ARC1: Becoming the \'no FAL\' ARCH
ARC1: Becoming the \'no SRL\' ARCH
ARC2: Becoming the heartbeat ARCH
Thread 1 opened at log sequence 1
Current log# 1 seq# 1 mem# 0: /u01/app/oracle/oradata/hkrt/redo1_1.log
Current log# 1 seq# 1 mem# 1: /u01/app/oracle/oradata/hkrt/redo1_2.log
Successful open of redo thread 1
Wed Dec 12 01:13:26 2012
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Wed Dec 12 01:13:26 2012
SMON: enabling cache recovery
ARC3: Archival started
ARC0: STARTING ARCH PROCESSES COMPLETE
Redo thread 2 internally disabled at seq 1 (CKPT)
ARC3: Archiving disabled thread 2 sequence 1
Archived Log entry 1974 added for thread 2 sequence 1 ID 0x0 dest 1:
Successfully onlined Undo Tablespace 2.
Dictionary check beginning
Wed Dec 12 01:13:31 2012
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_dbw0_14440.trc:
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: \'/u01/app/oracle/oradata/hkrt/temp01.dbf\'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_dbw0_14440.trc:
ORA-01186: file 201 failed verification tests
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: \'/u01/app/oracle/oradata/hkrt/temp01.dbf\'
File 201 not verified due to error ORA-01157
Dictionary check complete
Verifying file header compatibility for 11g tablespace encryption..
Verifying 11g file header compatibility for tablespace encryption completed
SMON: enabling tx recovery
Re-creating tempfile /u01/app/oracle/oradata/hkrt/temp01.dbf
Database Characterset is AL32UTF8
No Resource Manager plan active
replication_dependency_tracking turned off (no async multimaster replication found)
Wed Dec 12 01:13:38 2012
Starting background process QMNC
Wed Dec 12 01:13:38 2012
QMNC started with pid=28, OS id=14950
LOGSTDBY: Validating controlfile with logical metadata
LOGSTDBY: Validation complete
Completed: alter database open resetlogs
Wed Dec 12 01:13:52 2012
Starting background process CJQ0
Wed Dec 12 01:13:52 2012
CJQ0 started with pid=34, OS id=14982
12.后续检查
到这里RAC到单实例备份恢复已经完毕,我们可以简单检查下
到这里RAC到单实例备份恢复已经完毕,我们可以简单检查下
SQL> select thread#,status,enabled from v$thread;
THREAD# STATUS ENABLED
---------- ------------ ----------------
1 OPEN PUBLIC
2 CLOSED PUBLIC
SQL> select group#,thread#,archived,status from v$log;
GROUP# THREAD# ARCHIV STATUS
---------- ---------- ------ --------------------------------
1 1 NO CURRENT
2 1 YES UNUSED
3 2 YES ACTIVE
4 2 YES UNUSED
5 1 YES UNUSED
6 2 YES UNUSED
6 rows selected.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/arch
Oldest online log sequence 1
Next log sequence to archive 1
Current log sequence 1
最后聊一下从full backupset里如何找出参数文件和控制文件备份集的方法
[oracle@luocs bak]$ ls -l
total 10951248
-rw-r--r-- 1 oracle oinstall 3393916104 Dec 11 08:22 ArchFile20121211.tgz
-rw-r----- 1 oracle oinstall 1953459712 Dec 11 01:06 arch_HKRT_1nnsi78j_1_1
-rw-r----- 1 oracle oinstall 1887318528 Dec 11 01:06 arch_HKRT_1onsi78l_1_1
-rw-r----- 1 oracle oinstall 32256 Dec 11 01:06 arch_HKRT_1pnsi7ha_1_1
-rw-r--r-- 1 oracle oinstall 569727216 Dec 11 08:21 fulldb20121211.tgz
-rw-r----- 1 oracle oinstall 1928757248 Dec 11 01:01 full_HKRT_1jnsi76k_1_1
-rw-r----- 1 oracle oinstall 1450770432 Dec 11 01:01 full_HKRT_1knsi76k_1_1
-rw-r----- 1 oracle oinstall 18972672 Dec 11 01:01 full_HKRT_1lnsi77o_1_1
-rw-r----- 1 oracle oinstall 98304 Dec 11 01:01 full_HKRT_1mnsi77q_1_1
这里以full开头的就是数据文件+参数文件+控制文件的备份集,分辨方法非常简单,看大小即可。
一般最小的为参数文件备份集,大的是数据文件备份集。
如果你难以确定,直接到RMAN里尝试下就可以。
引用:
https://www.talkwithtrend.com/Article/255435
以上是关于oracle rac rman 备份 怎么恢复到另外的rac的主要内容,如果未能解决你的问题,请参考以下文章