Rman Backup&ORA-00245/RMAN-08132

本文详细描述了数据库文件、归档日志、SPFILE 和控制文件的备份过程,并指出控制文件快照备份失败的问题。通过分析错误日志,发现控制文件备份失败的原因在于控制文件快照备份文件未放置在共享存储上。文章提供了配置控制文件快照备份到共享存储的解决方案,最终成功解决了备份问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

日常监控备份发现,有个库归档备份报错信息如下:
channel ch01: finished piece 1 at 2015-08-04 09:42:46
piece handle=al_4171_1_886843941 tag=TAG20150804T093221 comment=API Version 2.0,MMS Version 5.0.0.0
channel ch01: backup set complete, elapsed time: 00:10:25
channel ch00: finished piece 1 at 2015-08-04 09:45:56
piece handle=al_4170_1_886843941 tag=TAG20150804T093221 comment=API Version 2.0,MMS Version 5.0.0.0
channel ch00: backup set complete, elapsed time: 00:13:35
Finished backup at 2015-08-04 09:45:56

Starting Control File and SPFILE Autobackup at 2015-08-04 09:45:57
piece handle=c-233800172-20150804-02 comment=API Version 2.0,MMS Version 5.0.0.0
Finished Control File and SPFILE Autobackup at 2015-08-04 09:46:22
ORA-00245: control file backup failed; target is likely on a local file system

RMAN-08132: WARNING: cannot update recovery area reclaimable file list

released channel: ch00
released channel: ch01
allocated channel: ch00
channel ch00: SID=295 instance=sscpdb2 device type=SBT_TAPE
channel ch00: Veritas NetBackup for Oracle - Release 7.6 (2014042414)

Starting backup at 2015-08-04 09:46:27
channel ch00: starting full datafile backup set
channel ch00: specifying datafile(s) in backup set
including current control file in backup set
channel ch00: starting piece 1 at 2015-08-04 09:46:30
channel ch00: finished piece 1 at 2015-08-04 09:46:56
piece handle=cntrl_4173_1_886844787 tag=TAG20150804T094627 comment=API Version 2.0,MMS Version 5.0.0.0
channel ch00: backup set complete, elapsed time: 00:00:26
Finished backup at 2015-08-04 09:46:56

Starting Control File and SPFILE Autobackup at 2015-08-04 09:46:56
piece handle=c-233800172-20150804-03 comment=API Version 2.0,MMS Version 5.0.0.0
Finished Control File and SPFILE Autobackup at 2015-08-04 09:47:21

released channel: ch00
ORA-00245: control file backup failed; target is likely on a local file system
RMAN-08132: WARNING: cannot update recovery area reclaimable file list

RMAN> RMAN> 

Recovery Manager complete.
Script /usr/openv/nbuscripts/sscp-db2_oracle_db_arch_backup.sh
==== ended successfully on Tue Aug 4 09:47:25 CST 2015 ====


从报错日志可以看出数据库文件,归档日志,spfile和controlfile都备份完成,后面又出现一个controlfile失败,确实是控制文件快照备份失败的报错。


错误原因
RMAN creates a copy of the control file for read consistency, this is the snapshot controlfile. 
Due to the changes made to the controlfile backup mechanism in 11gR2 any instances 
in the cluster may write to the snapshot controlfile. Therefore, 
the snapshot controlfile file needs to be visible to all instances.
 
The same happens when a backup of the controlfile is created directly from 
sqlplus any instance in the cluster may write to the backup controfile file.
 
In 11gR2 onwards, the controlfile backup happens without holding the control file enqueue. 
For non-RAC database, this doesn't change anything. 
 
But, for RAC database, the snapshot controlfile location 
must be in a shared file system that will be accessible from all the nodes.
 
The snapshot controlfile MUST be  accessible by all nodes of a RAC database. 
文档表述rman的snapshot controlfile必须放在共享存储之上。


于是检查当前rman config环境:
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name SSCPDB are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/orabackup/sscpdb1/rman/20150316/sscpdb1_lev1_201503160300_%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0.4/db_1/dbs/snapcf_sscpdb1.f'; # default


RMAN> 


解决方法
The snapshot controlfile MUST be accessible by all nodes of a RAC database, 
if the snapshot controlfile does not reside in on a shared device this error will raise.
 
1. Check the snapshot controlfile location:
RMAN> show all;
2. Configure the snapshot controlfile to a shared disk:
RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '<shared_disk>/snapcf_<DBNAME>.f';


处理结果:
RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/orabackup/snpcontrlfile/snapcf_sscpdb.f';
new RMAN configuration parameters:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/orabackup/snpcontrlfile/snapcf_sscpdb.f';
new RMAN configuration parameters are successfully stored


RMAN>  show all;
RMAN configuration parameters for database with db_unique_name SSCPDB are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/orabackup/sscpdb1/rman/20150316/sscpdb1_lev1_201503160300_%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/orabackup/snpcontrlfile/snapcf_sscpdb.f';


参考我2013年的帖子:
http://blog.itpub.net/13750068/viewspace-1064577/
Starting backup at 2015-08-04 10:05:23
current log archived
skipping archived logs of thread 1 from sequence 9157 to 9191; already backed up
skipping archived logs of thread 2 from sequence 9619 to 9653; already backed up
channel ch00: starting archived log backup set
channel ch00: specifying archived log(s) in backup set
input archived log thread=1 sequence=9192 RECID=18846 STAMP=886845932
channel ch00: starting piece 1 at 2015-08-04 10:05:33
channel ch01: starting archived log backup set
channel ch01: specifying archived log(s) in backup set
input archived log thread=2 sequence=9654 RECID=18845 STAMP=886845927
channel ch01: starting piece 1 at 2015-08-04 10:05:33
channel ch01: finished piece 1 at 2015-08-04 10:06:28
piece handle=al_4179_1_886845933 tag=TAG20150804T100533 comment=API Version 2.0,MMS Version 5.0.0.0
channel ch01: backup set complete, elapsed time: 00:00:55

channel ch00: finished piece 1 at 2015-08-04 10:07:48
piece handle=al_4178_1_886845933 tag=TAG20150804T100533 comment=API Version 2.0,MMS Version 5.0.0.0
channel ch00: backup set complete, elapsed time: 00:02:15
Finished backup at 2015-08-04 10:07:48

Starting Control File and SPFILE Autobackup at 2015-08-04 10:07:48
released channel: ch00
released channel: ch01
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of Control File and SPFILE Autobackup command on ch00 channel at 08/04/2015 10:07:49
ORA-01580: error creating control backup file /orabackup/snpcontrlfile/snapcf_sscpdb.f
ORA-27054: NFS file system where the file is created or resides is not mounted with correct options
Additional information: 3
Additional information: 1


检查主机:
[root@sscp-db2 ~]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup01-LogVol00
                     153724820  38539792 107250260  27% /
/dev/cciss/c0d0p1       101086     21972     73895  23% /boot
tmpfs                 65977152    450044  65527108   1% /dev/shm
/dev/mapper/arch_mpath2
                     206424760  27722528 168216472  15% /arch2
135.148.73.45:/arch1 206424768  29320640 166618368  15% /arch1
135.148.73.45:/orabackup
                     464455456    202880 440659616   1% /orabackup
[root@sscp-db2 ~]# cat /etc/fstab
/dev/VolGroup01/LogVol00 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/VolGroup01/LogVol01 swap                    swap    defaults        0 0
/dev/mapper/arch_mpath2 /arch2                  ext3    defaults        0 0
[root@sscp-db2 ~]# cat /etc/exports
/arch2 135.148.73.45(rw,sync)
[root@sscp-db2 ~]# umount /orabackup
umount: /orabackup: device is busy
umount: /orabackup: device is busy
[root@sscp-db2 ~]# fuser -cuv /orabackup
                     USER        PID ACCESS COMMAND
/orabackup:          root      15379 ..c.. (root)bash
                     root      27441 ..c.. (root)bash
                     root      27656 ..c.. (root)su
                     root      32497 ..c.. (root)bash
[root@sscp-db2 ~]# fuser -ck /orabackup
/orabackup:          15379c 27441c 27656c 32497c
[root@sscp-db2 ~]# 
[root@sscp-db2 ~]# umount /orabackup
[root@sscp-db2 ~]# df 
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup01-LogVol00
                     153724820  38545720 107244332  27% /
/dev/cciss/c0d0p1       101086     21972     73895  23% /boot
tmpfs                 65977152    450044  65527108   1% /dev/shm
/dev/mapper/arch_mpath2
                     206424760  27722528 168216472  15% /arch2
135.148.73.45:/arch1 206424768  30184288 165754720  16% /arch1
[root@sscp-db2 ~]# 
[root@sscp-db2 ~]# mount -t nfs -o rw,bg,hard,nointr,rsize=32768,wsize=32768,nolock,proto=tcp,actimeo=0,vers=3,timeo=600 135.148.73.45:/orabackup /orabackup
[root@sscp-db2 ~]# 
[root@sscp-db2 ~]# df 
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup01-LogVol00
                     153724820  38547676 107242376  27% /
/dev/cciss/c0d0p1       101086     21972     73895  23% /boot
tmpfs                 65977152    450044  65527108   1% /dev/shm
/dev/mapper/arch_mpath2
                     206424760  27722528 168216472  15% /arch2
135.148.73.45:/arch1 206424768  30184288 165754720  16% /arch1
135.148.73.45:/orabackup
                     464455456    202880 440659616   1% /orabackup
[root@sscp-db2 ~]# exit
logout


重新配置rman:
RMAN>  CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/orabackup/spcontf/snapcf_sscpdb.f';
old RMAN configuration parameters:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/orabackup/snpcontrlfile/snapcf_sscpdb.f';
new RMAN configuration parameters:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/orabackup/spcontf/snapcf_sscpdb.f';
new RMAN configuration parameters are successfully stored
RMAN> 
RMAN> show all;
RMAN configuration parameters for database with db_unique_name SSCPDB are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/orabackup/sscpdb1/rman/20150316/sscpdb1_lev1_201503160300_%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/orabackup/spcontf/snapcf_sscpdb.f';
Starting backup at 2015-08-04 10:46:17
channel ch00: starting full datafile backup set
channel ch00: specifying datafile(s) in backup set
including current control file in backup set
channel ch00: starting piece 1 at 2015-08-04 10:46:20
channel ch00: finished piece 1 at 2015-08-04 10:46:35
piece handle=cntrl_4184_1_886848377 tag=TAG20150804T104617 comment=API Version 2.0,MMS Version 5.0.0.0
channel ch00: backup set complete, elapsed time: 00:00:15
Finished backup at 2015-08-04 10:46:35


Starting Control File and SPFILE Autobackup at 2015-08-04 10:46:35
piece handle=c-233800172-20150804-05 comment=API Version 2.0,MMS Version 5.0.0.0
Finished Control File and SPFILE Autobackup at 2015-08-04 10:47:00
released channel: ch00
RMAN> RMAN> 
Recovery Manager complete.
Script /usr/openv/nbuscripts/sscp-db2_oracle_db_arch_backup.sh
==== ended successfully on Tue Aug 4 10:47:08 CST 2015 ====

参考:
Mount Options for Oracle files when used with NFS on NAS devices (文档 ID 359515.1)

Applies to:

Oracle Database - Enterprise Edition - Version 10.1.0.2 to 12.1.0.1 [Release 10.1 to 12.1]
Solaris Cluster - Version 3.3U1 5/11 to 3.3U1 5/11 [Release 3.3]
Information in this document applies to any platform.
Oracle Clusterware, Oracle Real Application Clusters, NAS

Purpose

The options with which the NAS systems should be mounted are described. This note does not cover the new dNFS feature that was introduced in 11g.

Scope

This document is relevant to all environments using Oracle Clusterware & RAC.

Details

RAC including RACone and single instance RAC

In the table below
  • Binaries is the shared mount points where the Oracle Home and CRS_HOME is installed.
  • Datafiles includes Online Logs, Controlfile and Datafiles
  • nfsvers and vers are identical on those OS platforms that has nfsvers.  The ver option is an alternative to the nfsvers option. It is included for compatibility with other operating systems
  • Please note that the mount options on each of the following cells are applicable only to those type of files listed in the column heading.
  • For RMAN backup sets, image copies, and Data Pump dump files, the "NOAC" mount option should not be specified - that is because RMAN and Data Pump do not check this option and specifying this can adversely affect performance.

 

Operating System

Mount options for    Binaries ##

Mount options for Oracle Datafiles Mount options for CRS Voting Disk and OCR
Sun Solaris *

rw,bg,hard,nointr,rsize=32768,
wsize=32768,proto=tcp,noac,

vers=3,suid

rw,bg,hard,nointr,rsize=32768,
wsize=32768,proto=tcp,noac,
forcedirectio, vers=3
rw,bg,hard,nointr,rsize=32768,
wsize=32768,proto=tcp,vers=3,
noac,forcedirectio
AIX (5L) **

rw,bg,hard,nointr,rsize=32768,
wsize=32768,proto=tcp,

vers=3,timeo=600

cio,rw,bg,hard,nointr,rsize=32768,
wsize=32768,proto=tcp,noac,
vers=3,timeo=600

cio,rw,bg,hard,intr,rsize=32768,
wsize=32768,tcp,noac,
vers=3,timeo=600

HPUX 11.23 ***  -- rw,bg,vers=3,proto=tcp,noac,
hard,nointr,timeo=600,
rsize=32768,wsize=32768,suid
rw,bg,vers=3,proto=tcp,noac,
forcedirectio,hard,nointr,timeo=600,
rsize=32768,wsize=32768
rw,bg,vers=3,proto=tcp,noac,
forcedirectio,hard,nointr,timeo=600
,rsize=32768,wsize=32768
Windows Not Supported Not Supported Not Supported
Linux x86
#
****

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp, vers=3,
timeo=600, actimeo=0

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,actimeo=0,
vers=3,timeo=600

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,noac,actimeo=0,
vers=3,timeo=600

Linux x86-64 #
****
rw,bg,hard,nointr,rsize=32768,
 wsize=32768,tcp,vers=3,
timeo=600, actimeo=0
rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,actimeo=0,
vers=3,timeo=600
rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,noac,vers=3,
timeo=600,actimeo=0
Linux - Itanium rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,vers=3,
timeo=600, actimeo=0
rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,actimeo=0,
vers=3,timeo=600
rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,noac,vers=3,
timeo=600,actimeo=0

* NFS mount option “forcedirectio” is required on Solaris platforms when mounting the OCR/CRS files when using Oracle 10.1.0.4 or 10.2.0.2 or later (Oracle unpublished bug 4466428)
** AIX is only supported with NAS on AIX 5.3 TL04 and higher with Oracle 10.2.0.1 and later
*** NAS devices are only supported with HPUX 11.23 or higher ONLY 


# These mount options are for Linux kernels 2.6 and above. For older kernels please check Note 279393.1

## The stated mount options for binaries are applicable only if the ORACLE HOME is shared.

Due to Unpublished bug 5856342, it is necessary to use the following init.ora parameter when using NAS with all versions of RAC on Linux (x86 & X86-64 platforms) until 10.2.0.4. This bug is fixed and included in 10.2.0.4 patchset.
filesystemio_options = DIRECTIO

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

转载于:http://blog.itpub.net/13750068/viewspace-1761109/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值