Oracle 11g RAC环境下的ORA - 19606问题

在刚刚接手Oracle时,这个问题困扰了我一段时间,现在将问题的解决过程分享一下

Oracle版本:11gR2

OS环境:Centos6.4

问题重现:

1. 接手数据库是写了一个备份脚本,脚本内容如下:

-----------------------------------------------------------------------------------------------------------------------------------

# !/bin/bash
# Name: rmanbk_level0.sh
# Write by: Datura at 2014/11/11 v1.0
# Description: The script is used to make the zero level backup for the orcl Library

# The definition of the variable
lock_file=/tmp/rmanbk.lock
oracleid=`cat /etc/passwd|grep oracle|awk -F: ‘{print $3}‘`

# Check the script to run or not
if [ -f $lock_file ];then
        pid=`cat $lock_file`
        ps $pid &> /dev/null
        [ $? -eq 0 ] && echo "Script is running..." && exit 1
fi

# Create process lock
echo $$ > $lock_file

# Only allows the oracle to run
[ $UID -ne $oracleid ] && echo "Please run as oracle !!" && exit 4

# To set environment variables
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=orcl1
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8

echo on
rman target /  msglog=/storage/script/log/rmanbk_level0_`date +%Y‘-‘%m‘-‘%d‘-‘%H‘:‘%M‘:‘%S`.log <<EOF
RUN {
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
backup as compressed backupset incremental level 0 database format ‘/storage/arch/rman/rmanbk_level0_%d_%I_%s_%p_%T.bkp‘;
crosscheck archivelog all;
backup archivelog all format ‘/storage/arch/rman/rmanbk_archivelog_%d_%I_%s_%p_%T.bkp‘;
crosscheck backup;
delete noprompt obsolete;
delete noprompt expired backupset;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
}
exit
EOF
echo off

find /storage/arch/rman/ -mtime -0.5 -type f -exec zip /storage/arch/rman/rmanbk_level0`date +%F`.zip {} \;
scp /storage/arch/rman/rmanbk_level0`date +%F`.zip backup.demon.com:/home/oracle/orabackup
rm -rf /storage/arch/rman/rmanbk_level0`date +%F`.zip
find /storage/script/log -mtime +7 -exec rm -rf {} \;

2. 有一天在备份日志里出现了下面的报错信息

--------------------------------------------------------------------------------------------------------------------------------------------------

RMAN-06207: WARNING: 1 objects could not be deleted for DISK channel(s) due
RMAN-06208:          to mismatched status.  Use CROSSCHECK command to fix status
RMAN-06210: List of Mismatched objects
RMAN-06211: =========================================================
RMAN-06212:   Object Type   Filename/Handle
RMAN-06213: --------------- ---------------------------------------------------
RMAN-06214: Datafile Copy   +DATA/orcl/snapc_orcl.f

3. 报错信息处理过程

----------------------------------------------------------------------------------------------------------------------------------------------------

RMAN> crosscheck backupset;

RMAN> report obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 2 days
Report of obsolete backups and copies
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Control File Copy     5      12-DEC-14          +DATA/orcl/snapc_orcl.f

RMAN> delete noprompt obsolete;

RMAN-00571: ====================================================
RMAN-00569: ===============ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ====================================================
RMAN-03009: failure of delete command on c2 channel at 11/20/2014 09:03:14
ORA-19606: Cannot copy or restore to snapshot control file

RMAN> show snapshot controlfile name;

RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO ‘/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl1.f‘; # default

RMAN> configure snapshot controlfile name to ‘/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl1.f_bak‘;

new RMAN configuration parameters:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO ‘/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl1.f_bak‘;
new RMAN configuration parameters are successfully stored

RMAN> crosscheck controlfilecopy  ‘/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl1.f‘;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=80 instance=orcl1 device type=DISK
validation failed for control file copy
control file copy file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl1.f RECID=2 STAMP=863884566
Crosschecked 1 objects

RMAN> delete expired controlfilecopy ‘/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl1.f‘;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=80 instance=orcl1 device type=DISK
List of Control File Copies
=========================================================================================
Key     S Completion Time Ckp SCN    Ckp Time
------- - --------------- ---------- ---------------
2       X 17-NOV-14       67553950   17-NOV-14
        Name: /u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl1.f
        Tag: TAG20141117T155602

Do you really want to delete the above objects (enter YES or NO)? yes
deleted control file copy
control file copy file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl1.f RECID=2 STAMP=863884566
Deleted 1 EXPIRED objects

RMAN> configure snapshot controlfile name to ‘/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl1.f‘;

old RMAN configuration parameters:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO ‘/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl1.f_bak‘;
new RMAN configuration parameters:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO ‘/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl1.f‘;
new RMAN configuration parameters are successfully stored

RMAN> configure snapshot controlfile name clear;

old RMAN configuration parameters:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO ‘/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl1.f‘;
RMAN configuration parameters are successfully reset to default value

4. 通过上面的常规操作暂时解决了问题,但没几天就会再次出现相同的问题

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

RMAN-00571: ==========================================================
RMAN-00569: ================= ERROR MESSAGE STACK FOLLOWS ===================
RMAN-00571: ==========================================================
RMAN-03009: failure of Control File and SPFILE Autobackup command on c1 channel at 12/12/2014 01:05:19
ORA-00245: control file backup failed; target is likely on a local file system

5. 上面的常规操作只能暂时解决问题,不能解决根本问题,于是翻阅官方文档得到以下信息

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

从11gR2开始,在备份控制文件时不再需要锁住controlfile enqueue
对于非RAC环境的数据库没有任何的改变
但是对于RAC环境,因为控制文件备份机制的改变
集群中的所有节点都必须能够访问快照控制文件,所以快照控制文件要对所有实例可见
如果快照控制文件没有放到共享设备上,当rman备份快照控制文件时就会出现以上的错误

6. 根据得到的信息做出如下调整

------------------------------------------------------------------------------------------------------------------------------------------

RMAN> show snapshot controlfile name;

RMAN> configure snapshot controlfile name to ‘/storage/snap_control/snapcf_%d_%I_%s_%p_%T.f‘;

RMAN> configure snapshot controlfile name to ‘+DATA/orcl/snapcf_orcl.f‘;   --也可以指定到对应的ASM磁盘组(磁盘组不支持通配符命名)

将控制文件快照放到共享存储之后就没有再出现上面的错误了

在出现问题时我们都习惯用自己的经验采用常规的手法去解决问题

但有时候翻阅官档是个不错的选择

虽然官档不能告诉你具体的操作步骤

却可以给予解决根本问题的正确指引

-------------------------------------------------------以上为个人观点阐述,如有不妥,欢迎指点-----------------------------------------------------------------------

时间: 2024-10-08 06:50:19

Oracle 11g RAC环境下的ORA - 19606问题的相关文章

oracle linux 5.5安装oracle 11g rac环境

安装环境: 操作系统:oracle linux 5.5 64位 集群软件:linux.x64_11gR2_grid.zip 数据库:linux.x64_11gR2_database_1of1.zip,linux.x64_11gR2_database_1of2.zip asm软件:oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm       oracleasmlib-2.0.4-1.el5.x86_64.rpm       oracleasm-supp

Oracle 11g rac 生产环境部署详录

作者:田逸([email protected]) 基本规划 ◎设备选型 1.服务器:Dell R620 两台.cpu 8 core,内存64G,600G 15000转sas硬盘,双电源,hba卡一块,连接存储线缆一根(连接hba卡和共享存储). 2.存储:dell MD3200 一台.双控制器,12块600G 15000转sas硬盘.为追求最高可用性,使用的raid级别是raid10. 3.交换机:华为3com两台,型号为h3c S5048E.注意:网络端口最好是全千兆. 4.网线:2-3米机制

Oracle 11g RAC搭建(VMware环境)

Oracle 11g RAC搭建(VMware环境) Oracle 11g RAC搭建VMware环境 安装环境与网络规划 安装环境 网络规划 环境配置 通过SecureCRT建立命令行连接 关闭防火墙 创建必要的用户组和目录并授权 节点配置检查 系统文件设置 配置IP和hostshostname 配置grid和oracle用户环境变量 配置oracle用户ssh互信 配置裸盘 配置grid用户ssh互信 挂载安装软件文件夹 安装用于Linux的cvuqdisk 手动运行cvu使用验证程序验证O

Oracle RAC环境下如何更新patch(Rolling Patch)

Oracle RAC数据库环境与单实例数据库环境有很多共性,也有很多异性.对于数据库补丁的更新同样如此,都可以通过opatch来完成.但RAC环境的补丁更新有几种不同的更新方式,甚至于可以在零停机的情况下对所有节点实现滚动升级.本文主要是转述了Doc 244241.1,描述RAC环境下的patch更新方式以及在不同的情形下选择何种更新方式. 1.RAC patch的几种方式 OPatch supports 3 different patch methods on a RAC environmen

Oracle RAC 环境下的连接管理(转) --- 防止原文连接失效

崔华老师的文章!!! 这篇文章详细介绍了Oracle RAC环境下的连接管理,分别介绍了什么是 Connect Time Load Balancing.Runtime Connection Load Balancing.Connect Time Connection Failover 和 Runtime Connection Failover,以及里面所涉及到的 TAF.ONS.FCF.FAN.LBA 等诸多知识点.本文主要是针对 Oracle RAC 11gR2 环境下的连接管理,但同时也会对

Oracle RAC环境下配置statspack

Statspack是Oracle 9i时代的产物,对于监控与分析数据库性能有着跨里程碑的意义,是AWR的前身.在Oracle 10g后AWR取代了statspack.尽管如此,awr异常或者需要调试包license的情况下statpack依旧是不错的选择.然而在RAC环境中,statspack并不支持,需要单独的进行配置以及使用job来进行管理.本文描述的则是通过在RAC环境下创建service,以及job来达到各节点同时产生snapshot的效果. 一.演示环境 suse11a:oracle:

利用XAG在RAC环境下实现GoldenGate自动Failover

概述 在RAC环境下配置OGG,要想实现RAC节点故障时,OGG能自动的failover到正常节点,要保证两点: 1. OGG的checkpoint,trail,BR文件放置在共享的集群文件系统上,RAC各节点都能访问到 2. 需要有集群软件的来监测OGG进程,以及发生故障时,自动在正常节点重启OGG(failover) Oracle Grid Infrastructure Standalone Agents (XAG)搭配Oracle支持的集群文件系统,可以实现OGG的自动failover,本

Oracle 11g RAC oc4j/gsd Offline

Oracle 11g RAC中,发现oc4j以及gsd服务都处于offline状态,这是Oracle 11g RAC默认情形.即便如此,并不影响数据库的使用,因为 oc4j 是用于WLM 的一个资源, WLM在 11.2.0.2 才可用.GSD则是用于支持dbca,srvctl,oem等的交互工具.本文描述将这两个服务切换到online. [python] view plain copy print? 1.环境 [[email protected] ~]# cat /etc/issue Ente

oracle 11g rac 笔记(VMware 和esxi主机都可以使用)

这个只是笔记,防止丢失,没事见整理 在vmware安装目录 创建磁盘: vmware-vdiskmanager.exe -c -s 1000Mb -a lsilogic -t 2 D:\VMWARE\racsharedisk\ocr.vmdk vmware-vdiskmanager.exe -c -s 1000Mb -a lsilogic -t 2 D:\VMWARE\racsharedisk\ocr2.vmdk vmware-vdiskmanager.exe -c -s 1000Mb -a l