10g RAC 通过NFS进行备份和恢复

10g RAC 通过NFS进行备份和恢复

1.先设好NFS,备份与恢复与单机基本没有差别了!下面是过程,记下来,以备查阅:
rac1-> rman target / nocatalog

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Nov 25 23:36:24 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: RACDB (DBID=667104169)
using target database control file instead of recovery catalog

RMAN> run{
2>  backup database    format '/rmanset/full_%d%t%s%p'         tag 'fullbackup';
3>  sql 'alter system archive log current';
4>  BACKUP FORMAT '/rmanset/%d_arch_%s_%p_%h' ARCHIVELOG ALL;                                        
5>  backup format '/rmanset/cf_%d' current controlfile;                                                    
6>  }

Starting backup at 25-NOV-08
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=117 instance=racdb1 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=+RACDATA/racdb/datafile/system.259.669487425
input datafile fno=00003 name=+RACDATA/racdb/datafile/sysaux.261.669487497
input datafile fno=00002 name=+RACDATA/racdb/datafile/undotbs1.260.669487479
input datafile fno=00004 name=+RACDATA/racdb/datafile/undotbs2.263.669487539
input datafile fno=00006 name=+RACDATA/racdb/datafile/rman_backup.268.671103645
input datafile fno=00005 name=+RACDATA/racdb/datafile/users.264.669487561
channel ORA_DISK_1: starting piece 1 at 25-NOV-08
channel ORA_DISK_1: finished piece 1 at 25-NOV-08
piece handle=/rmanset/full_RACDB6717585971871 tag=FULLBACKUP comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:46
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 25-NOV-08
channel ORA_DISK_1: finished piece 1 at 25-NOV-08
piece handle=/rmanset/full_RACDB6717587631881 tag=FULLBACKUP comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:09
Finished backup at 25-NOV-08

sql statement: alter system archive log current

Starting backup at 25-NOV-08
current log archived
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 11/25/2008 23:39:45
RMAN-06059: expected archived log not found, lost of archived log compromises recoverability
ORA-19625: error identifying file /racdb2_arch/2_2_671755092.dbf
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3

RMAN> run{
2>   sql 'alter system archive log current';
3>  BACKUP FORMAT '/rmanset/%d_arch_%s_%p_%h' ARCHIVELOG ALL;                                        
4>  backup format '/rmanset/cf_%d' current controlfile;                                                    
5>  }

sql statement: alter system archive log current

Starting backup at 25-NOV-08
current log archived
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 11/25/2008 23:41:43
RMAN-06059: expected archived log not found, lost of archived log compromises recoverability
ORA-19625: error identifying file /racdb2_arch/2_2_671755092.dbf
ORA-27054: NFS file system where the file is created or resides is not mounted with correct options
Additional information: 3

 


---从杨版主之摘之。。。。
从Metalink的查询看,这个错误还比较普遍。在文章Note:424785.1里面进行了比较详细的描述。

解决方法包括设置事件10298 level 32,打补丁:5146667,或者在mount的时候设置参数:rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,vers=3,timeo=600,actimeo=0。

注意metalink上给出的参数并非对所有系统都适用,比如在Solaris8上就要去掉tcp参数。而去掉了tcp之后,似乎这种方法就不生效了。

剩下两种方式,打补丁需要将数据库关闭,而且一般使用NFS都是用在Rac的环境,补丁还需要在两个节点上同时打,比较麻烦。

而设置EVENT虽然简单,只是要重启系统才能生效。

设置Oracle的事件10298,并重启数据库:

$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.3.0 - Production on 星期二 5月 29 16:06:32 2007

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options

SQL> alter system set event='10298 trace name context forever, level 32' scope = spfile;

系统已更改。

SQL> exit 从 Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production

----------


rac1-> vi /etc/fstab

# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/                 /                       ext3    defaults        1 1
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /dev/shm                tmpfs   defaults        0 0
none                    /proc                   proc    defaults        0 0
none                    /sys                    sysfs   defaults        0 0
LABEL=SWAP-sda2         swap                    swap    defaults        0 0
rac2:/racdb2_arch /racdb2_arch  nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,vers=3,timeo=600,actimeo=0
/dev/hdc                /media/cdrecorder       auto    pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0
/dev/fd0                /media/floppy           auto    pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0
~

rac1-> umount /racdb2_arch
rac1-> mount -all

 

rac1-> rman target / nocatalog

Recovery Manager: Release 10.2.0.1.0 - Production on Wed Nov 26 00:16:52 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database (not started)

RMAN> startup nomount

Oracle instance started

Total System Global Area     171966464 bytes

Fixed Size                     1218340 bytes
Variable Size                121637084 bytes
Database Buffers              46137344 bytes
Redo Buffers                   2973696 bytes

RMAN> restore controlfile from '/rmanset/cf_RACDB'; 

Starting restore at 26-NOV-08
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=147 instance=racdb1 devtype=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:11
output filename=+RACDATA/racdb/controlfile/current.256.669487407
Finished restore at 26-NOV-08

 

RMAN> sql 'alter database mount';

sql statement: alter database mount
released channel: ORA_DISK_1

RMAN> run{
2> restore database;
3> recover database;
4> }

Starting restore at 26-NOV-08
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=147 instance=racdb1 devtype=DISK

channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to +RACDATA/racdb/datafile/system.259.669487425
restoring datafile 00002 to +RACDATA/racdb/datafile/undotbs1.260.669487479
restoring datafile 00003 to +RACDATA/racdb/datafile/sysaux.261.669487497
restoring datafile 00004 to +RACDATA/racdb/datafile/undotbs2.263.669487539
restoring datafile 00005 to +RACDATA/racdb/datafile/users.264.669487561
restoring datafile 00006 to +RACDATA/racdb/datafile/rman_backup.268.671103645
channel ORA_DISK_1: reading from backup piece /rmanset/full_RACDB6717585971871
channel ORA_DISK_1: restored backup piece 1
piece handle=/rmanset/full_RACDB6717585971871 tag=FULLBACKUP
channel ORA_DISK_1: restore complete, elapsed time: 00:02:17
Finished restore at 26-NOV-08

Starting recover at 26-NOV-08
using channel ORA_DISK_1

starting media recovery

archive log thread 1 sequence 7 is already on disk as file /racdb1_arch/1_7_671755092.dbf
archive log thread 1 sequence 8 is already on disk as file /racdb1_arch/1_8_671755092.dbf
archive log thread 1 sequence 9 is already on disk as file /racdb1_arch/1_9_671755092.dbf
archive log thread 1 sequence 10 is already on disk as file /racdb1_arch/1_10_671755092.dbf
archive log thread 1 sequence 11 is already on disk as file /racdb1_arch/1_11_671755092.dbf
archive log thread 1 sequence 12 is already on disk as file /racdb1_arch/1_12_671755092.dbf
archive log thread 1 sequence 13 is already on disk as file /racdb1_arch/1_13_671755092.dbf
archive log thread 1 sequence 14 is already on disk as file /racdb1_arch/1_14_671755092.dbf
archive log thread 1 sequence 15 is already on disk as file /racdb1_arch/1_15_671755092.dbf
archive log thread 1 sequence 16 is already on disk as file /racdb1_arch/1_16_671755092.dbf
archive log thread 1 sequence 17 is already on disk as file /racdb1_arch/1_17_671755092.dbf
archive log thread 1 sequence 18 is already on disk as file /racdb1_arch/1_18_671755092.dbf
archive log thread 1 sequence 19 is already on disk as file /racdb1_arch/1_19_671755092.dbf
archive log thread 1 sequence 20 is already on disk as file /racdb1_arch/1_20_671755092.dbf
archive log thread 1 sequence 21 is already on disk as file /racdb1_arch/1_21_671755092.dbf
archive log thread 1 sequence 22 is already on disk as file /racdb1_arch/1_22_671755092.dbf
archive log thread 1 sequence 23 is already on disk as file /racdb1_arch/1_23_671755092.dbf
archive log thread 1 sequence 24 is already on disk as file /racdb1_arch/1_24_671755092.dbf
archive log thread 1 sequence 25 is already on disk as file /racdb1_arch/1_25_671755092.dbf
archive log thread 1 sequence 26 is already on disk as file /racdb1_arch/1_26_671755092.dbf
archive log thread 1 sequence 27 is already on disk as file +RACDATA/racdb/onlinelog/group_1.257.669487411
archive log thread 1 sequence 28 is already on disk as file +RACDATA/racdb/onlinelog/group_2.258.669487419
archive log thread 2 sequence 6 is already on disk as file /racdb2_arch/2_6_671755092.dbf
archive log thread 2 sequence 7 is already on disk as file /racdb2_arch/2_7_671755092.dbf
archive log thread 2 sequence 8 is already on disk as file /racdb2_arch/2_8_671755092.dbf
archive log thread 2 sequence 9 is already on disk as file /racdb2_arch/2_9_671755092.dbf
archive log thread 2 sequence 10 is already on disk as file /racdb2_arch/2_10_671755092.dbf
archive log thread 2 sequence 11 is already on disk as file /racdb2_arch/2_11_671755092.dbf
archive log thread 2 sequence 12 is already on disk as file /racdb2_arch/2_12_671755092.dbf
archive log thread 2 sequence 13 is already on disk as file /racdb2_arch/2_13_671755092.dbf
archive log thread 2 sequence 14 is already on disk as file /racdb2_arch/2_14_671755092.dbf
archive log thread 2 sequence 15 is already on disk as file /racdb2_arch/2_15_671755092.dbf
archive log thread 2 sequence 16 is already on disk as file /racdb2_arch/2_16_671755092.dbf
archive log thread 2 sequence 17 is already on disk as file /racdb2_arch/2_17_671755092.dbf
archive log thread 2 sequence 18 is already on disk as file /racdb2_arch/2_18_671755092.dbf
archive log thread 2 sequence 19 is already on disk as file /racdb2_arch/2_19_671755092.dbf
archive log thread 2 sequence 20 is already on disk as file /racdb2_arch/2_20_671755092.dbf
archive log thread 2 sequence 21 is already on disk as file /racdb2_arch/2_21_671755092.dbf
archive log thread 2 sequence 22 is already on disk as file /racdb2_arch/2_22_671755092.dbf
archive log thread 2 sequence 23 is already on disk as file /racdb2_arch/2_23_671755092.dbf
archive log thread 2 sequence 24 is already on disk as file /racdb2_arch/2_24_671755092.dbf
archive log thread 2 sequence 25 is already on disk as file /racdb2_arch/2_25_671755092.dbf
archive log thread 2 sequence 26 is already on disk as file +RACDATA/racdb/onlinelog/group_3.265.669489319
archive log thread 2 sequence 27 is already on disk as file +RACDATA/racdb/onlinelog/group_4.266.669489327
archive log filename=/racdb1_arch/1_7_671755092.dbf thread=1 sequence=7
archive log filename=/racdb2_arch/2_6_671755092.dbf thread=2 sequence=6
archive log filename=/racdb2_arch/2_7_671755092.dbf thread=2 sequence=7
archive log filename=/racdb1_arch/1_8_671755092.dbf thread=1 sequence=8
archive log filename=/racdb2_arch/2_8_671755092.dbf thread=2 sequence=8
archive log filename=/racdb1_arch/1_9_671755092.dbf thread=1 sequence=9
archive log filename=/racdb1_arch/1_10_671755092.dbf thread=1 sequence=10
archive log filename=/racdb2_arch/2_9_671755092.dbf thread=2 sequence=9
archive log filename=/racdb2_arch/2_10_671755092.dbf thread=2 sequence=10
archive log filename=/racdb1_arch/1_11_671755092.dbf thread=1 sequence=11
archive log filename=/racdb1_arch/1_12_671755092.dbf thread=1 sequence=12
archive log filename=/racdb2_arch/2_11_671755092.dbf thread=2 sequence=11
archive log filename=/racdb1_arch/1_13_671755092.dbf thread=1 sequence=13
archive log filename=/racdb2_arch/2_12_671755092.dbf thread=2 sequence=12
archive log filename=/racdb2_arch/2_13_671755092.dbf thread=2 sequence=13
archive log filename=/racdb1_arch/1_14_671755092.dbf thread=1 sequence=14
archive log filename=/racdb2_arch/2_14_671755092.dbf thread=2 sequence=14
archive log filename=/racdb1_arch/1_15_671755092.dbf thread=1 sequence=15
archive log filename=/racdb2_arch/2_15_671755092.dbf thread=2 sequence=15
archive log filename=/racdb1_arch/1_16_671755092.dbf thread=1 sequence=16
archive log filename=/racdb1_arch/1_17_671755092.dbf thread=1 sequence=17
archive log filename=/racdb2_arch/2_16_671755092.dbf thread=2 sequence=16
archive log filename=/racdb2_arch/2_17_671755092.dbf thread=2 sequence=17
archive log filename=/racdb1_arch/1_18_671755092.dbf thread=1 sequence=18
archive log filename=/racdb1_arch/1_19_671755092.dbf thread=1 sequence=19
archive log filename=/racdb2_arch/2_18_671755092.dbf thread=2 sequence=18
archive log filename=/racdb1_arch/1_20_671755092.dbf thread=1 sequence=20
archive log filename=/racdb2_arch/2_19_671755092.dbf thread=2 sequence=19
archive log filename=/racdb1_arch/1_21_671755092.dbf thread=1 sequence=21
archive log filename=/racdb2_arch/2_20_671755092.dbf thread=2 sequence=20
archive log filename=/racdb2_arch/2_21_671755092.dbf thread=2 sequence=21
archive log filename=/racdb1_arch/1_22_671755092.dbf thread=1 sequence=22
archive log filename=/racdb1_arch/1_23_671755092.dbf thread=1 sequence=23
archive log filename=/racdb2_arch/2_22_671755092.dbf thread=2 sequence=22
archive log filename=/racdb2_arch/2_23_671755092.dbf thread=2 sequence=23
archive log filename=/racdb1_arch/1_24_671755092.dbf thread=1 sequence=24
archive log filename=/racdb2_arch/2_24_671755092.dbf thread=2 sequence=24
archive log filename=/racdb1_arch/1_25_671755092.dbf thread=1 sequence=25
archive log filename=/racdb1_arch/1_26_671755092.dbf thread=1 sequence=26
archive log filename=/racdb2_arch/2_25_671755092.dbf thread=2 sequence=25
archive log filename=+RACDATA/racdb/onlinelog/group_3.265.669489319 thread=2 sequence=26
archive log filename=+RACDATA/racdb/onlinelog/group_1.257.669487411 thread=1 sequence=27
archive log filename=+RACDATA/racdb/onlinelog/group_2.258.669487419 thread=1 sequence=28
archive log filename=+RACDATA/racdb/onlinelog/group_4.266.669489327 thread=2 sequence=27
media recovery complete, elapsed time: 00:00:21
Finished recover at 26-NOV-08

RMAN>

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10834762/viewspace-503310/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10834762/viewspace-503310/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值