【kingsql分享】将RAC数据库异机恢复到单实例(Ⅰ)
本文将陆续讲述如何将一个RAC数据库,异机恢复到单实例
1.创建测试用户
SYS@testora2%10gR2> create user hongzhuohui identified by oracle;
User created.
SYS@testora2%10gR2> grant dba to hongzhuohui;
Grant succeeded.
2.查看实例名
SYS@testora2%10gR2> select instance_name from v$instance;
INSTANCE_NAME
----------------
testora2
3.创建测试表
SYS@testora2%10gR2> conn hongzhuohui/oracle
Connected.
SYS@testora2%10gR2> create table test001 (x int);
Table created.
SYS@testora2%10gR2> insert into test001 values (99);
1 row created.
SYS@testora2%10gR2> commit;
Commit complete.
SYS@testora2%10gR2> select * from test001;
X
----------
99
SYS@testora2%10gR2> show user;
USER is "hongzhuohui"
4.备份数据库
[oracle@rac2 ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Sun Nov 9 22:18:58 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: TESTORA (DBID=676818789)
RMAN> run
{
allocate channel d1 type disk maxpiecesize 4000m ;
backup as compressed backupset incremental level = 0 database
format ‘/home/oracle/xpg/db_%d_%s_%p_%T‘
plus archivelog skip inaccessible delete all input
format ‘/home/oracle/xpg/log_%d_%s_%p_%T‘;
SYS@testora2%10gR2 ‘alter system archive log current‘;
release channel d1;
}2> 3> 4> 5> 6> 7> 8> 9> 10>
using target database control file instead of recovery catalog
allocated channel: d1
channel d1: sid=141 instance=testora2 devtype=DISK
Starting backup at 09-NOV-14
current log archived
channel d1: starting compressed archive log backupset
channel d1: specifying archive log(s) in backup set
input archive log thread=1 sequence=42 recid=27 stamp=863192962
input archive log thread=1 sequence=43 recid=30 stamp=863216434
input archive log thread=2 sequence=15 recid=28 stamp=863192967
input archive log thread=2 sequence=16 recid=29 stamp=863216065
input archive log thread=2 sequence=17 recid=31 stamp=863216438
channel d1: starting piece 1 at 09-NOV-14
channel d1: finished piece 1 at 09-NOV-14
piece handle=/home/oracle/xpg/log_TESTORA_5_1_20141109 tag=TAG20141109T222038 comment=NONE
channel d1: backup set complete, elapsed time: 00:00:02
channel d1: deleting archive log(s)
archive log filename=+DATA/testora/1_42_854718629.dbf recid=27 stamp=863192962
archive log filename=+DATA/testora/1_43_854718629.dbf recid=30 stamp=863216434
archive log filename=+DATA/testora/2_15_854718629.dbf recid=28 stamp=863192967
archive log filename=+DATA/testora/2_16_854718629.dbf recid=29 stamp=863216065
archive log filename=+DATA/testora/2_17_854718629.dbf recid=31 stamp=863216438
Finished backup at 09-NOV-14
Starting backup at 09-NOV-14
channel d1: starting compressed incremental level 0 datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00001 name=+DATA/testora/datafile/system.259.854718649
input datafile fno=00002 name=+DATA/testora/datafile/undotbs1.260.854718659
input datafile fno=00003 name=+DATA/testora/datafile/sysaux.261.854718665
input datafile fno=00004 name=+DATA/testora/datafile/undotbs2.263.854718673
input datafile fno=00005 name=+DATA/testora/datafile/users.264.854718679
channel d1: starting piece 1 at 09-NOV-14
channel d1: finished piece 1 at 09-NOV-14
piece handle=/home/oracle/xpg/db_TESTORA_6_1_20141109 tag=TAG20141109T222042 comment=NONE
channel d1: backup set complete, elapsed time: 00:01:05
channel d1: starting compressed incremental level 0 datafile backupset
channel d1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel d1: starting piece 1 at 09-NOV-14
channel d1: finished piece 1 at 09-NOV-14
piece handle=/home/oracle/xpg/db_TESTORA_7_1_20141109 tag=TAG20141109T222042 comment=NONE
channel d1: backup set complete, elapsed time: 00:00:05
Finished backup at 09-NOV-14
Starting backup at 09-NOV-14
current log archived
channel d1: starting compressed archive log backupset
channel d1: specifying archive log(s) in backup set
input archive log thread=1 sequence=44 recid=32 stamp=863216513
input archive log thread=2 sequence=18 recid=33 stamp=863216513
channel d1: starting piece 1 at 09-NOV-14
channel d1: finished piece 1 at 09-NOV-14
piece handle=/home/oracle/xpg/log_TESTORA_8_1_20141109 tag=TAG20141109T222153 comment=NONE
channel d1: backup set complete, elapsed time: 00:00:02
channel d1: deleting archive log(s)
archive log filename=+DATA/testora/1_44_854718629.dbf recid=32 stamp=863216513
archive log filename=+DATA/testora/2_18_854718629.dbf recid=33 stamp=863216513
Finished backup at 09-NOV-14
SQL statement: alter system archive log current
released channel: d1
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。