问题描述
客户在配置DATA GUARD过程中碰到ORA-1031和ORA-16032错误。
其中ORA-1031错误很直观,直接报错在归档时没有权限:
Wed Sep 28 15:43:26 2011 ALTER SYSTEM SET log_archive_dest_2='service=db1st lgwr async valid_for=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=db1st' SCOPE=BOTH; Wed Sep 28 15:43:26 2011 ALTER SYSTEM SET log_archive_dest_state_1='enable' SCOPE=BOTH; Wed Sep 28 15:43:26 2011 ALTER SYSTEM SET log_archive_dest_state_2='enable' SCOPE=BOTH; Wed Sep 28 15:43:26 2011 ALTER SYSTEM SET log_archive_config='DG_CONFIG=(db1,db1st)' SCOPE=BOTH; Wed Sep 28 15:43:26 2011 ALTER SYSTEM SET fal_client='db1' SCOPE=BOTH; Wed Sep 28 15:43:26 2011 ALTER SYSTEM SET fal_server='db1st' SCOPE=BOTH; Wed Sep 28 15:43:26 2011 ALTER SYSTEM SET standby_file_management='auto' SCOPE=BOTH; Wed Sep 28 15:43:26 2011 ARC0: STARTING ARCH PROCESSES Wed Sep 28 15:43:26 2011 ALTER SYSTEM SET log_archive_max_processes=3 SCOPE=BOTH; ARC2: Archival started ARC0: STARTING ARCH PROCESSES COMPLETE ARC2 started WITH pid=242, OS id=925904 Wed Sep 28 15:43:26 2011 ALTER SYSTEM SET db_file_name_convert='/dev/','/dev/' SCOPE=SPFILE; Wed Sep 28 15:43:26 2011 ALTER SYSTEM SET log_file_name_convert='/dev/','/dev/' SCOPE=SPFILE; Wed Sep 28 15:44:02 2011 Error 1031 received logging ON TO the standby Wed Sep 28 15:44:02 2011 Errors IN file /oracle/admin/db1/bdump/db1_arc0_90394.trc: ORA-01031: insufficient privileges PING[ARC0]: Heartbeat failed TO CONNECT TO standby 'db1st'. Error IS 1031. Wed Sep 28 15:49:03 2011 Error 1031 received logging ON TO the standby Wed Sep 28 15:49:03 2011 Errors IN file /oracle/admin/db1/bdump/db1_arc0_90394.trc: ORA-01031: insufficient privileges PING[ARC0]: Heartbeat failed TO CONNECT TO standby 'db1st'. Error IS 1031. Wed Sep 28 15:54:03 2011 Error 1031 received logging ON TO the standby Wed Sep 28 15:54:03 2011 Errors IN file /oracle/admin/db1/bdump/db1_arc0_90394.trc: ORA-01031: insufficient privileges PING[ARC0]: Heartbeat failed TO CONNECT TO standby 'db1st'. Error IS 1031. Wed Sep 28 15:57:29 2011 Archivelog restore complete. Elapsed TIME: 0:00:00 Wed Sep 28 15:59:03 2011 Error 1031 received logging ON TO the standby Wed Sep 28 15:59:03 2011 Errors IN file /oracle/admin/db1/bdump/db1_arc0_90394.trc: ORA-01031: insufficient privileges PING[ARC0]: Heartbeat failed TO CONNECT TO standby 'db1st'. Error IS 1031.
在归档的详细日志中,错误如下:
/oracle/admin/db1/bdump/db1_arc0_90394.trc Oracle DATABASE 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production WITH the Partitioning, OLAP AND DATA Mining options ORACLE_HOME = /oracle/product/db10gr2 System name: AIX Node name: ser1 Release: 3 Version: 5 Machine: 00C23C4F4C00 Instance name: db1 Redo thread mounted BY this instance: 1 Oracle process NUMBER: 14 Unix process pid: 90394, image: oracle@ser1 (ARC0) *** 2011-09-28 15:42:05.012 *** SERVICE NAME:(SYS$BACKGROUND) 2011-09-28 15:42:05.006 *** SESSION ID:(541.1) 2011-09-28 15:42:05.006 Redo shipping client performing standby login OCISessionBegin failed -1 .. Detailed OCI error val IS 1031 AND errmsg IS 'ORA-01031: insufficient privileges ' *** 2011-09-28 15:42:05.101 61287 kcrr.c Error 1031 received logging ON TO the standby Error 1031 connecting TO destination LOG_ARCHIVE_DEST_1 standby host 'db1st' kcrrwupirfs KCRROCIS Handle 0xfffffffffffb608 has NULL OCI servicehandle - Returning success Error 1031 attaching TO destination LOG_ARCHIVE_DEST_1 standby host 'db1st' ORA-01031: insufficient privileges *** 2011-09-28 15:42:05.101 59530 kcrr.c kcrrfail: dest:1 err:1031 force:0 blast:1 kcrrwupirfs KCRROCIS Handle 0xfffffffffffb608 has NULL OCI servicehandle - Returning success kcrrwkx: UNKNOWN error:1031 ORA-16055: FAL request rejected ARCH: Connecting TO console port... ARCH: Connecting TO console port... Redo shipping client performing standby login OCISessionBegin failed -1 .. Detailed OCI error val IS 1031 AND errmsg IS 'ORA-01031: insufficient privileges ' *** 2011-09-28 15:42:05.565 61287 kcrr.c Error 1031 received logging ON TO the standby Error 1031 connecting TO destination LOG_ARCHIVE_DEST_1 standby host 'db1st' kcrrwupirfs KCRROCIS Handle 0xfffffffffffb608 has NULL OCI servicehandle - Returning success Error 1031 attaching TO destination LOG_ARCHIVE_DEST_1 standby host 'db1st' ORA-01031: insufficient privileges *** 2011-09-28 15:42:05.565 59530 kcrr.c kcrrfail: dest:1 err:1031 force:0 blast:1 kcrrwupirfs KCRROCIS Handle 0xfffffffffffb608 has NULL OCI servicehandle - Returning success kcrrwkx: UNKNOWN error:1031 ORA-16055: FAL request rejected ARCH: Connecting TO console port... ARCH: Connecting TO console port... Redo shipping client performing standby login OCISessionBegin failed -1 .. Detailed OCI error val IS 1031 AND errmsg IS 'ORA-01031: insufficient privileges ' *** 2011-09-28 15:42:05.679 61287 kcrr.c Error 1031 received logging ON TO the standby Error 1031 connecting TO destination LOG_ARCHIVE_DEST_1 standby host 'db1st' kcrrwupirfs KCRROCIS Handle 0xfffffffffffb608 has NULL OCI servicehandle - Returning success Error 1031 attaching TO destination LOG_ARCHIVE_DEST_1 standby host 'db1st' ORA-01031: insufficient privileges
专家解答
导致ORA-1031错误的问题很简单,归档进程没有权限将归档日志写到远端,只需要将主库的密码文件拷贝到远端的对应位置上既可。
不过权限问题解决后,归档又出现新的错误:
Thu Sep 29 00:06:19 2011 ARC0: Attempting destination LOG_ARCHIVE_DEST_2 network reconnect (16032) ARC0: Destination LOG_ARCHIVE_DEST_2 network reconnect abandoned Thu Sep 29 00:06:19 2011 Errors IN file /oracle/admin/db1/bdump/db1_arc0_90394.trc: ORA-16032: parameter destination string cannot be translated FAL[server, ARC0]: Error 16032 creating remote archivelog file 'db1st' Thu Sep 29 00:06:19 2011 ARC2: Attempting destination LOG_ARCHIVE_DEST_2 network reconnect (16032) ARC2: Destination LOG_ARCHIVE_DEST_2 network reconnect abandoned Thu Sep 29 00:06:19 2011 Errors IN file /oracle/admin/db1/bdump/db1_arc2_925904.trc: ORA-16032: parameter destination string cannot be translated FAL[server, ARC2]: Error 16032 creating remote archivelog file 'db1st' FAL[server, ARC2]: FAL archive failed, see trace file. Thu Sep 29 00:06:19 2011 Errors IN file /oracle/admin/db1/bdump/db1_arc2_925904.trc: ORA-16055: FAL request rejected ARCH: FAL archive failed. Archiver continuing Thu Sep 29 00:06:19 2011 ORACLE Instance db1 - Archival Error. Archiver continuing.
对应的归档进程的详细错误:
*** 2011-09-29 00:06:19.480 Redo shipping client performing standby login *** 2011-09-29 00:06:19.583 65194 kcrr.c Logged ON TO standby successfully Client logon AND security negotiation successful! tkcrrsarc: (WARN) Failed TO find ARCH FOR message (message:0xa) tkcrrpa: (WARN) Failed initial attempt TO send ARCH message (message:0xa) tkcrrsarc: (WARN) Failed TO find ARCH FOR message (message:0xa) tkcrrpa: (WARN) Failed initial attempt TO send ARCH message (message:0xa) tkcrrsarc: (WARN) Failed TO find ARCH FOR message (message:0xa) tkcrrpa: (WARN) Failed initial attempt TO send ARCH message (message:0xa) tkcrrsarc: (WARN) Failed TO find ARCH FOR message (message:0x2) tkcrrpa: (WARN) Failed initial attempt TO send ARCH message (message:0x2) Error 16032 creating standby archive log file at host 'db1st' *** 2011-09-29 00:06:19.843 61287 kcrr.c ARC0: Attempting destination LOG_ARCHIVE_DEST_2 network reconnect (16032) *** 2011-09-29 00:06:19.843 61287 kcrr.c ARC0: Destination LOG_ARCHIVE_DEST_2 network reconnect abandoned ORA-16032: parameter destination string cannot be translated *** 2011-09-29 00:06:19.852 59530 kcrr.c kcrrfail: dest:2 err:16032 force:0 blast:1 kcrrwkx: UNKNOWN error:16032 ORA-16055: FAL request rejected ARCH: Connecting TO console port... ARCH: Connecting TO console port... FAL[server]: Selected inactive destination; resetting temporarily Redo shipping client performing standby login *** 2011-09-29 00:06:22.106 65194 kcrr.c Logged ON TO standby successfully Client logon AND security negotiation successful! Error 16032 creating standby archive log file at host 'db1st' *** 2011-09-29 00:06:22.157 61287 kcrr.c ARC0: Attempting destination LOG_ARCHIVE_DEST_2 network reconnect (16032) *** 2011-09-29 00:06:22.157 61287 kcrr.c ARC0: Destination LOG_ARCHIVE_DEST_2 network reconnect abandoned ORA-16032: parameter destination string cannot be translated *** 2011-09-29 00:06:22.157 59530 kcrr.c kcrrfail: dest:2 err:16032 force:0 blast:1 kcrrwkx: UNKNOWN error:16032 ORA-16055: FAL request rejected ARCH: Connecting TO console port... ARCH: Connecting TO console port... FAL[server]: Selected inactive destination; resetting temporarily Redo shipping client performing standby login
其实导致这个ORA-16032错误的原因也很简单,从最前面的代码可以看出,在配置初始化参数的时候先配置了LOG_ARCHIVE_DEST_N,然后才配置LOG_ARCHIVE_CONFIG参数,这就使得LOG_ARCHIVE_DEST_N参数生效的时候无法从DG_CONFIG中获取到响应的配置,导致了ORA-16032的错误。
要避免这个错误很简单,只需要先配置LOG_ARCHIVE_CONFIG,然后再配置LOG_ARCHIVE_DEST_N参数既可。对于已经出现的这个错误,只需要通过参数LOG_ARCHIVE_DEST_STATE_N暂停日志,随后在启用,Oracle就会重新分析LOG_ARCHIVE_DEST_N中的配置:
Thu Sep 29 12:40:42 2011 Errors IN file /oracle/admin/db1/bdump/db1_arc0_90394.trc: ORA-16032: parameter destination string cannot be translated Thu Sep 29 12:40:42 2011 FAL[server, ARC0]: FAL archive failed, see trace file. Thu Sep 29 12:40:42 2011 Errors IN file /oracle/admin/db1/bdump/db1_arc0_90394.trc: ORA-16055: FAL request rejected ARCH: FAL archive failed. Archiver continuing Thu Sep 29 12:40:42 2011 ORACLE Instance db1 - Archival Error. Archiver continuing. Thu Sep 29 12:46:24 2011 ALTER SYSTEM SET log_archive_dest_state_2='DEFER' SCOPE=BOTH; Thu Sep 29 13:57:56 2011 FAL[server, ARC2]: FAL archive failed, see trace file. Thu Sep 29 13:57:56 2011 Errors IN file /oracle/admin/db1/bdump/db1_arc2_925904.trc: ORA-16055: FAL request rejected ARCH: FAL archive failed. Archiver continuing Thu Sep 29 13:57:56 2011 ORACLE Instance db1 - Archival Error. Archiver continuing. Thu Sep 29 13:57:56 2011 ARCH: Possible network disconnect WITH PRIMARY DATABASE Thu Sep 29 13:57:56 2011 ORACLE Instance db1 - Archival Error. Archiver continuing. Thu Sep 29 13:58:26 2011 FAL[server]: Fail TO queue the whole FAL gap GAP - thread 1 SEQUENCE 3357-3363 DBID 1488093310 branch 682019072 Thu Sep 29 14:09:42 2011 FAL[server, ARC0]: FAL archive failed, see trace file. Thu Sep 29 14:09:42 2011 Errors IN file /oracle/admin/db1/bdump/db1_arc0_90394.trc: ORA-16055: FAL request rejected ARCH: FAL archive failed. Archiver continuing Thu Sep 29 14:09:42 2011 ORACLE Instance db1 - Archival Error. Archiver continuing. Thu Sep 29 14:09:42 2011 FAL[server, ARC2]: FAL archive failed, see trace file. Thu Sep 29 14:09:42 2011 Errors IN file /oracle/admin/db1/bdump/db1_arc2_925904.trc: ORA-16055: FAL request rejected ARCH: FAL archive failed. Archiver continuing Thu Sep 29 14:09:57 2011 ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=BOTH; FAL[server]: Fail TO queue the whole FAL gap GAP - thread 1 SEQUENCE 3361-3363 DBID 1488093310 branch 682019072 LNS1 started WITH pid=128, OS id=667772 Thu Sep 29 16:14:17 2011 Thread 1 advanced TO log SEQUENCE 3366 CURRENT log# 2 seq# 3366 mem# 0: /dev/rredo02 Thu Sep 29 16:14:18 2011 ****************************************************************** LGWR: Setting 'active' archival FOR destination LOG_ARCHIVE_DEST_2 ****************************************************************** LNS: Standby redo logfile selected FOR thread 1 SEQUENCE 3366 FOR destination LOG_ARCHIVE_DEST_2 Thu Sep 29 16:14:23 2011 FAL[server]: Fail TO queue the whole FAL gap GAP - thread 1 SEQUENCE 3365-3365 DBID 1488093310 branch 682019072 Thu Sep 29 16:14:25 2011 ARC2: Standby redo logfile selected FOR thread 1 SEQUENCE 3365 FOR destination LOG_ARCHIVE_DEST_2
将参数重置后,错误消失,远端归档顺利开始。
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。