对归档日志的验证失败-rman语言显示的一个”异常”

在客户现场,帮忙查看rman备份的信息,在做crosscheck archivelog all时收到如下的信息,于是咨询客户是否在os上做了删除归档日志的操作,客户反馈没有。

—————————————————–
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001829_0765458436.0001 记录 ID=1805 时间戳 =791704822
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001830_0765458436.0001 记录 ID=1806 时间戳 =791719618
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001831_0765458436.0001 记录 ID=1807 时间戳 =791751623
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001832_0765458436.0001 记录 ID=1808 时间戳 =791771151
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001833_0765458436.0001 记录 ID=1809 时间戳 =791778305
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001834_0765458436.0001 记录 ID=1810 时间戳 =791822474
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001835_0765458436.0001 记录 ID=1811 时间戳 =791848825
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001836_0765458436.0001 记录 ID=1812 时间戳 =791857576
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001837_0765458436.0001 记录 ID=1813 时间戳 =791863234
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001838_0765458436.0001 记录 ID=1814 时间戳 =791906945
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001839_0765458436.0001 记录 ID=1815 时间戳 =791935222
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001840_0765458436.0001 记录 ID=1816 时间戳 =791944004
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001841_0765458436.0001 记录 ID=1817 时间戳 =791944007
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001842_0765458436.0001 记录 ID=1818 时间戳 =791982026
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001843_0765458436.0001 记录 ID=1819 时间戳 =792021613
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001844_0765458436.0001 记录 ID=1820 时间戳 =792021652
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001845_0765458436.0001 记录 ID=1821 时间戳 =792030432
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001846_0765458436.0001 记录 ID=1822 时间戳 =792049858
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001847_0765458436.0001 记录 ID=1823 时间戳 =792093621
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001848_0765458436.0001 记录 ID=1824 时间戳 =792108026
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001849_0765458436.0001 记录 ID=1825 时间戳 =792116856
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001850_0765458436.0001 记录 ID=1826 时间戳 =792122166
对归档日志的验证失败
存档日志文件名 =D:ORADATAARCHARC0000001851_0765458436.0001 记录 ID=1827 时间戳 =792165652
已交叉检验的 75 对象

———————————————–

那还真是奇怪了…..突然脑子里闪出rman语言相关的一个异常显示问题,于是设置环境变量,改成英文显示。

oracle@gongwenServer ~]$ export NLS_LANG=”american_america.zhs16gbk”

字符集不变,设置为american_america,再次crosscheck,你看…….还真是一个“翻译错误”…..

RMAN> crosscheck archivelog all;

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1158 devtype=DISK
validation succeeded for archived log
archive log filename=D:ORADATAARCHARC0000001777_0765458436.0001 recid=1753 stamp=790701106
validation succeeded for archived log
archive log filename=D:ORADATAARCHARC0000001778_0765458436.0001 recid=1754 stamp=790725626
validation succeeded for archived log
archive log filename=D:ORADATAARCHARC0000001779_0765458436.0001 recid=1755 stamp=790733192
validation succeeded for archived log
archive log filename=D:ORADATAARCHARC0000001780_0765458436.0001 recid=1756 stamp=790733194
validation succeeded for archived log
archive log filename=D:ORADATAARCHARC0000001781_0765458436.0001 recid=1757 stamp=790772102
validation succeeded for archived log
archive log filename=D:ORADATAARCHARC0000001782_0765458436.0001 recid=1758 stamp=790812015
validation succeeded for archived log
archive log filename=D:ORADATAARCHARC0000001783_0765458436.0001 recid=1759 stamp=790815646
validation succeeded for archived log
archive log filename=D:ORADATAARCHARC0000001784_0765458436.0001 recid=1760 stamp=790819620
validation succeeded for archived log
archive log filename=D:ORADATAARCHARC0000001785_0765458436.0001 recid=1761 stamp=790837252
validation succeeded for archived log
archive log filename=D:ORADATAARCHARC0000001786_0765458436.0001 recid=1762 stamp=790873567
validation succeeded for archived log
archive log filename=D:ORADATAARCHARC0000001787_0765458436.0001 recid=1763 stamp=790898421
validation succeeded for archived log
archive log filename=D:ORADATAARCHARC0000001788_0765458436.0001 recid=1764 stamp=790906044
validation succeeded for archived log
archive log filename=D:ORADATAARCHARC0000001789_0765458436.0001 recid=1765 stamp=790906687
validation succeeded for archived log
archive log filename=D:ORADATAARCHARC0000001790_0765458436.0001 recid=1766 stamp=790945223
validation succeeded for archived log
archive log filename=D:ORADATAARCHARC0000001791_0765458436.0001 recid=1767 stamp=790984816
validation succeeded for archived log
archive log filename=D:ORADATAARCHARC0000001792_0765458436.0001 recid=1768 stamp=790989334
validation succeeded for archived log
archive log filename=D:ORADATAARCHARC0000001793_0765458436.0001 recid=1769 stamp=790993315
validation succeeded for archived log
archive log filename=D:ORADATAARCHARC0000001794_0765458436.0001 recid=1770 stamp=791013622

oracle rac srvctl create service

oracle rac创建service的另外一个方法是使用srvctl工具,使用srvctl工具的好处是无需gui的配合,直接在命令行即可搞定了。

//先看看srvctl add service的使用方法
[oracle@rac1 ~]$ srvctl add service -h
Usage: srvctl add service -d <name> -s <service_name> -r “<preferred_list>” [-a “<available_list>”] [-P <TAF_policy>]
-d <name> Unique name for the database
-s <service> Service name
-r “<pref_list>” List of preferred instances
-a “<avail_list>” List of available instances
-P <TAF_policy> TAF policy (NONE, BASIC, or PRECONNECT)
Usage: srvctl add service -d <name> -s <service_name> -u {-r “<new_pref_inst>” | -a “<new_avail_inst>”}
-d <name> Unique name for the database
-s <service> Service name
-u Add a new instance to service configuration
-r <new_pref_inst> Name of new preferred instance
-a <new_avail_inst> Name of new available instance
-h Print usage
//添加一个service,名字叫service2,rac1作为pre_list成员,rac2作为avail_list成员,TAF policy配置为PRECONNECT
[oracle@rac1 ~]$ srvctl add service -d rac -s service2 -r “rac1” -a “rac2” -P PRECONNECT

//crs_stat 查看一下添加的结果,有两个状态为offline的。
[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
————————————————————
ora.rac.db application ONLINE ONLINE rac1
ora….c1.inst application ONLINE ONLINE rac1
ora….c2.inst application ONLINE ONLINE rac2
ora….ice1.cs application ONLINE ONLINE rac1
ora….ac1.srv application ONLINE ONLINE rac1
ora….ice2.cs application OFFLINE OFFLINE
ora….ac1.srv application OFFLINE OFFLINE
ora….C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora….C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
//新增加的两个offline的资源
NAME=ora.rac.service2.cs
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.rac.service2.rac1.srv
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE

//service创建完毕后,需要配置这个服务,将其激活,但此操作似乎是多余的,接下来会收到报错
[oracle@rac1 ~]$ srvctl enable service -d rac -s service2
PRKP-1018 : Service service2 already enabled.

//来启动enable完毕的service
[oracle@rac1 ~]$ srvctl start service -d rac -s service2
//刚才offline的两个服务自动被启动了,状态为online
[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
————————————————————
ora.rac.db application ONLINE ONLINE rac1
ora….c1.inst application ONLINE ONLINE rac1
ora….c2.inst application ONLINE ONLINE rac2
ora….ice1.cs application ONLINE ONLINE rac1
ora….ac1.srv application ONLINE ONLINE rac1
ora….ice2.cs application ONLINE ONLINE rac1
ora….ac1.srv application ONLINE ONLINE rac1
ora….C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora….C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
//使用srvctl config来查看service的状态,可以看到新创建的service2的一些信息,这里TAF选择的是PRECONNECT。
[oracle@rac1 ~]$ srvctl config service -d rac -a
service1 PREF: rac1 AVAIL: rac2 TAF: basic
service2 PREF: rac1 AVAIL: rac2 TAF: PRECONNECT
//srvctl工具创建的服务能够自动添加到spfile中,show parameter已经能够查到其踪迹了
SQL> show parameter service

NAME TYPE VALUE
———————————— ———– ——————————
service_names          string           service1,   rac.world,    service2
//service2的添加已经反应到了spfile参数文件中(不知道如果是pfile会如何)

//查看一下在数据字典中添加了什么内容?
1* select name,FAILOVER_METHOD,FAILOVER_TYPE,FAILOVER_RETRIES,FAILOVER_DELAY from dba_services
SQL> /

NAME FAILOVER_METHOD FAILOVER_TYPE FAILOVER_RETRIES FAILOVER_DELAY
—————————— —————————— —————————— —————- ————–
SYS$BACKGROUND
SYS$USERS
seeddataXDB
seeddata
racXDB
rac.world
service1                                        BASIC                                 SELECT                     170                           4
service2
service2_PRECONNECT

//可以看到在数据字典中,添加了两行与service2相关的内容,name字段中有service2、service2_PRECONNECT
//其中service2在创建过程中,TAF的method选择的是PRECONNECT,这里与之前的basic不同。
//与basic不同的是,可见在dba_services中,name字段多了两行,service2与service_PRECONNECT

//但是在TAF policy的4个选项(method,type,retry,delay)也同样没有配置上,需要借助dbms包来解决。

//使用dbms_service包来配置TAF的四个策略选项,method配置为PRECONNECT,type配置为session,retries=150,delay设置为5
//shit…正当我在模仿如下的脚本准备相应的脚本时,无意间查了一些dbms_service中关于method如何设置为PRECONNECT时,还自己意淫相应的方法为failover_method_preconnect是发现,如下一段文字:

//
Server side TAF method is BASIC. BASIC is the only value currently supported.
This means that a new connection is established at failure time.
It is not possible to pre-establish a backup connection. (which is to say, PRECONNECT is not supported)
//


begin
dbms_service.modify_service(
service_name=>’service2′,
failover_method=>dbms_service.failover_method_basic,
failover_type=>dbms_service.failover_type_session,
failover_retries=>160,
failover_delay=>5,
);
end;
/

//我日….悲催啊。。。”basic is the only value current supported…..”

//得,srvctl更改service为的method为basic,重新来
[oracle@rac1 ~]$ srvctl modify service -d rac -s service2 -h
Usage: srvctl modify service -d <name> -s <service_name> -i <old_inst_name> -t <new_inst_name> [-f]
-d <name> Unique name for the database
-s <service> Service name
-i <old_inst> Old instance name
-t <new_inst> New instance name
-f Disconnect all sessions during stop or relocate service operations
Usage: srvctl modify service -d <name> -s <service_name> -i <avail_inst_name> -r [-f]
-d <name> Unique name for the database
-s <service> Service name
-i <inst> Instance name
-r Upgrade instance to preferred
-f Disconnect all sessions during stop or relocate service operations
Usage: srvctl modify service -d <name> -s <service_name> -n -i <prefered_inst> [-a <available_list>] [-f]
-d <name> Unique name for the database
-s <service> Service name
-n Modify service configuration
-r “<pref_list>” List of preferred instances
-a “<avail_list>” List of available instances
-f Disconnect all sessions during stop or relocate service operations
Usage: srvctl modify service -d <name> -s <service_name> -P <TAF_policy> [-f]
-d <name> Unique name for the database
-s <service> Service name
-P <TAF_policy> TAF policy (NONE, BASIC, or PRECONNECT)
-f Disconnect all sessions during stop or relocate service operations
-h Print usage

//执行更改
[oracle@rac1 ~]$ srvctl modify service -d rac -s service2 -P BASIC
//查看状态
[oracle@rac1 ~]$ srvctl config service -d rac -a
service1 PREF: rac1 AVAIL: rac2 TAF: basic
service2 PREF: rac1 AVAIL: rac2 TAF: BASIC
//crs stack中注册的service相关的两个resource都依旧是online的。
[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
————————————————————
ora.rac.db application ONLINE ONLINE rac1
ora….c1.inst application ONLINE ONLINE rac1
ora….c2.inst application ONLINE ONLINE rac2
ora….ice1.cs application ONLINE ONLINE rac1
ora….ac1.srv application ONLINE ONLINE rac1
ora….ice2.cs application ONLINE ONLINE rac1
ora….ac1.srv application ONLINE ONLINE rac1
ora….C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora….C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2

//再看看spfile中的参数,spfile中的记录并没有什么变化。
SQL> show parameter service

NAME TYPE VALUE
———————————— ———–     ——————————
service_names                string               service1,   rac.world,    service2

//看看dba_services中,数据字典中的记录。
SQL> l
1* select name,FAILOVER_METHOD,FAILOVER_TYPE,FAILOVER_RETRIES,FAILOVER_DELAY from dba_services
SQL> /

NAME FAILOVER_METHOD FAILOVER_TYPE FAILOVER_RETRIES FAILOVER_DELAY
—————————— —————————— —————————— —————- ————–
SYS$BACKGROUND
SYS$USERS
seeddataXDB
seeddata
racXDB
rac.world
service1 BASIC SELECT 170 4
service2
service2_PRECONNECT
//dba_services中似乎没有什么反应,依旧存在一个service2_PRECONNECT的东西,再看看lsnrctl中的记录信息
LSNRCTL> set current_listener listener_rac1
Current Listener is listener_rac1
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.201.149)(PORT=1521)(IP=FIRST)))
STATUS of the LISTENER
————————
Alias LISTENER_RAC1
Version TNSLSNR for Linux: Version 10.2.0.5.0 – Production
Start Date 20-AUG-2012 18:13:34
Uptime 3 days 19 hr. 11 min. 7 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /opt/app/oracle/product/10.2.0/db_1/network/log/listener_rac1.log
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.201.149)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.201.128)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Services Summary…
Service “rac.world” has 2 instance(s).
Instance “rac1”, status READY, has 2 handler(s) for this service…
Instance “rac2”, status READY, has 1 handler(s) for this service…
Service “racXDB.world” has 2 instance(s).
Instance “rac1”, status READY, has 1 handler(s) for this service…
Instance “rac2”, status READY, has 1 handler(s) for this service…
Service “rac_XPT.world” has 2 instance(s).
Instance “rac1”, status READY, has 2 handler(s) for this service…
Instance “rac2”, status READY, has 1 handler(s) for this service…
Service “service1.world” has 1 instance(s).
Instance “rac1”, status READY, has 2 handler(s) for this service…
Service “service2.world” has 1 instance(s).
Instance “rac1”, status READY, has 2 handler(s) for this service…
Service “service2_PRECONNECT.world” has 1 instance(s).
Instance “rac2”, status READY, has 1 handler(s) for this service…
The command completed successfully
//监听中还是记录了一些service2相关的信息,但是service2以及service2_PRECONNECT多少让人有些疑惑,不知道是modify service之前的状态还是之后的状态。

//即使reload listener之后,还是如下的状态(lsnrctl services查看)
Service “service2.world” has 1 instance(s).
Instance “rac1”, status READY, has 2 handler(s) for this service…
Handler(s):
“DEDICATED” established:0 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=rac1-vip.localdomain)(PORT=1521))
“DEDICATED” established:0 refused:0 state:ready
LOCAL SERVER
Service “service2_PRECONNECT.world” has 1 instance(s).
Instance “rac2”, status READY, has 1 handler(s) for this service…
Handler(s):
“DEDICATED” established:0 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=rac2-vip.localdomain)(PORT=1521))
The command completed successfully

//也罢,继续使用dbms包完成剩下在数据字典中的更改工作。method=basic,type=session,retry=150,delay=5

begin
dbms_service.modify_service(
service_name=>’service2′,
failover_method=>dbms_service.failover_method_basic,
failover_type=>dbms_service.failover_type_session,
failover_retries=>160,
failover_delay=>5
);
end;
/

//查看dba_services中的状态
SQL> select name,FAILOVER_METHOD,FAILOVER_TYPE,FAILOVER_RETRIES,FAILOVER_DELAY from dba_services;

NAME FAILOVER_METHOD FAILOVER_TYPE FAILOVER_RETRIES FAILOVER_DELAY
—————————— —————————— —————————— —————- ————–
SYS$BACKGROUND
SYS$USERS
seeddataXDB
seeddata
racXDB
rac.world
service1                     BASIC SELECT                                    170                        4
service2                  BASIC SESSION                                    160                          5
service2_PRECONNECT

–EOF—