windows,oracle,dg报错:ORA-12528,ORA-12154,ORA-10456 ,PING[ARC1]: Heartbeat failed to connect to standby 'orclbk'. Error is 12154
windows,oracle,dg报错:ORA-12528,ORA-12154,ORA-10456
最近有需求在windows的2台oracle服务器上搭建dg,在过程中遇到了一些错误,跟在linux上不一样
如下:
环境:11.2.0.4
主库
ip:*
sid:ORCL
db_unique_name:ORCL
安装路径:C:\app\Administrator\product\11.2.0\dbhome_1\
数据文件路径:C:\app\Administrator\oradata\ORCL
本地归档路径:C:\app\Administrator\fast_recovery_area\ORCL\ARCHIVELOG
备库
ip:*
sid:orclbk
db_unique_name:orclbk
安装路径:C:\app\Administrator\product\11.2.0\dbhome_1\
数据文件路径:C:\app\Administrator\oradata\orclbk
本地归档路径:C:\app\Administrator\fast_recovery_area\orclbk\ARCHIVELOG
dg的搭建过程就不详细描述,只针对错误进行处理,总体在windows下搭建dg跟再linux下类似,只有一处,一会回讲到
--使用rman auxiliary
主库:
SQL> archive log list
SQL> shutdown immediate
SQL> startup mount
SQL> alter database archivelog;
SQL> archive log list;
SQL> select name , open_mode, log_mode,force_logging from gv$database;
SQL> show parameter db_recover
SQL> alter database force logging;
SQL> alter system switch logfile;
--添加standby redo log
alter database add standby logfile group 4 ('C:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO04.LOG') size 50m;
--tns监听配置文件
orclbk_* =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = *)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orclbk)
(UR=A)
)
) orcl_* =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = *)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
--修改参数文件
alter system set log_archive_config='dg_config=(ORCL,orclbk)' scope=spfile sid='*';
alter system set log_archive_dest_1='location=C:\app\Administrator\fast_recovery_area\ORCL\ARCHIVELOG valid_for=(all_logfiles,all_roles) db_unique_name=ORCL' scope=spfile sid='*';
alter system set log_archive_dest_2='service=orclbk_* valid_for=(online_logfiles,primary_role) db_unique_name=orclbk' scope=spfile sid='*';
alter system set log_archive_dest_state_1=enable scope=spfile sid='*';
alter system set log_archive_dest_state_2=enable scope=spfile sid='*';
alter system set standby_file_management='auto' scope=spfile sid='*';
alter system set fal_server='orclbk_*' scope=spfile sid='*';
alter system set fal_client='orcl_*' scope=spfile sid='*';
alter system set db_file_name_convert='C:\app\Administrator\oradata\ORCL','C:\app\Administrator\oradata\orclbk' scope=spfile sid='*';
alter system set log_file_name_convert='C:\app\Administrator\oradata\ORCL','C:\app\Administrator\oradata\orclbk' scope=spfile sid='*';
alter system set log_archive_format='%t_%s_%r.arch' scope=spfile sid='*';
### scope=spfile 后面主库要重启才生效
备库
注意:在windows上(linux略过),由于cadbk实例没有创建,所以需要ORADIM -NEW -SID cadbk
创建目录
比如
cd C:\app\Administrator\admin
mkdir orclbk
修改备库参数文件
*.audit_file_dest='C:\app\Administrator\admin\orclbk\adump'
*.audit_trail='db'
*.compatible='11.2.0.4.0'
*.control_files='C:\app\Administrator\oradata\orclbk\control01.ctl','C:\app\Administrator\fast_recovery_area\orclbk\control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_file_name_convert='C:\app\Administrator\oradata\ORCL','C:\app\Administrator\oradata\orclbk'
*.db_name='ORCL'
*.service_names='orclbk'
*.db_unique_name='orclbk'
*.db_recovery_file_dest='C:\app\Administrator\fast_recovery_area'
*.db_recovery_file_dest_size=4385144832
*.diagnostic_dest='C:\app\Administrator'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=CADXDB)'
*.fal_server='orcl_192.168.19.197'
*.fal_client='orclbk_192.168.19.194'
*.log_archive_config='dg_config=(ORCL,orclbk)'
*.log_archive_dest_1='location=C:\app\Administrator\fast_recovery_area\orclbk\ARCHIVELOG valid_for=(all_logfiles,all_roles) db_unique_name=orclbk'
*.log_archive_dest_2='service=cad_1* valid_for=(online_logfiles,primary_role) db_unique_name=ORCL'
*.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_format='%t_%s_%r.arch'
*.log_file_name_convert='C:\app\Administrator\oradata\ORCL','C:\app\Administrator\oradata\orclbk'
--备库tns
orclbk_* =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = *)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orclbk)
(UR=A)
)
) orcl_* =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = *)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
tnsping orcl_*
tnsping orclbk_*
1 报错ORA-12528: TNS:listener: all appropriate instances are blocking new connections
由于cadbk实例是手工ORADIM -NEW -SID orclbk命令添加的,在lsnrctl status的时候,状态为blocked,数据库实例orclbk状态为nomount,因为动态监听的问题,对辅助数据库没法注册,这里修改为静态注册
或者在tns文件中增加
(UR=A)(主库备库的tns对应都要增加)
在主备执行
sqlplus /nolog
conn sys/*@orcl_* as sysdba
conn sys/*@orclbk_1* as sysdba
正常就可以
2
rror 12154 received logging on to the standby
FAL[server, ARC3]: Error 12154 creating remote archivelog file 'orclbk'
FAL[server, ARC3]: FAL archive failed, see trace file.
ARCH: FAL archive failed. Archiver continuing
Tue Jun 25 15:47:46 2019
Error 12154 received logging on to the standby
PING[ARC1]: Heartbeat failed to connect to standby 'orclbk'. Error is 12154.
Tue Jun 25 15:47:50 2019
Error 12154 received logging on to the standby
Tue Jun 25 15:47:50 2019
Error 12154 received logging on to the standby
Error 12154 for archive log file 3 to 'orclbk'
FAL[server, ARC0]: Error 12154 creating remote archivelog file 'orclbk'
FAL[server, ARC0]: FAL archive failed, see trace file.
ARCH: FAL archive failed. Archiver continuing
Errors in file C:\APP\ADMINISTRATOR\diag\rdbms\orcl\orcl\trace\orcl_nsa2_15224.trc:
ORA-12154: TNS:could not resolve the connect identifier specified
Tue Jun 25 15:49:44 2019
Tue Jun 25 15:49:48 2019
Archived Log entry 17 added for thread 1 sequence 1840 ID 0x5e779e7a dest 1:
Tue Jun 25 15:52:09 2019
Starting background process SMCO
Tue Jun 25 15:52:09 2019
SMCO started with pid=49, OS id=11840
Tue Jun 25 15:53:42 2019
Error 12154 received logging on to the standby
PING[ARC1]: Heartbeat failed to connect to standby 'orclbk'. Error is 12154.
Tue Jun 25 15:55:23 2019
Tue Jun 25 16:02:00 2019
Warning: VKTM detected a time drift.
Time drifts can result in an unexpected behavior such as time-outs. Please check trace file for more details.
Tue Jun 25 16:02:07 2019
Error 12154 received logging on to the standby
PING[ARC1]: Heartbeat failed to connect to standby 'orclbk'. Error is 12154.
查询主备库
select message from v$dataguard_status;
select dest_name,error,status from v$archive_dest;
LOG_ARCHIVE_DEST_2 ORA-12154: TNS: 无法解析指定的连接标识符 ERROR
主库报错,这里参数LOG_ARCHIVE_DEST_2错误,之前的值是orclbk
alter system set log_archive_dest_2='service=orclbk valid_for=(online_logfiles,primary_role) db_unique_name=orclbk' scope=both sid='*';
但是在tns文件中定义的orclbk_*,所以要修改--上面贴出的文件中已修改,所以如果按照上面参数文件是不会遇到此错误的。
alter system set log_archive_dest_2='service=orclbk_* valid_for=(online_logfiles,primary_role) db_unique_name=orclbk' scope=both sid='*';
alter system set fal_server='orclbk_*' scope=both sid='*';
alter system set fal_client='orcl_*' scope=both sid='*';
SQL> select * from v$archive_gap; THREAD# LOW_SEQUENCE# HIGH_SEQUENCE#
---------- ------------- --------------
1 1836 1840
SQL> alter database register physical logfile 'C:\app\Administrator\fast_recovery_area\orclbk\ARCHIVELOG\1_1837_976879612.ARCH';
3
alter database open
ORA-10456 signalled during: alter database open...
SQL> select max(sequence#) from v$archived_log; MAX(SEQUENCE#)
--------------
1842
SQL> select DBID,NAME,OPEN_MODE,DATABASE_ROLE from v$database; DBID NAME OPEN_MODE DATABASE_ROLE
---------- --------- -------------------- ----------------
1584932730 ORCL MOUNTED PHYSICAL STANDBY
SQL> alter database open;
alter database open
*
第 1 行出现错误:
ORA-10456: cannot open standby database; media recovery session may be in
progress
SQL> select DBID,NAME,OPEN_MODE,DATABASE_ROLE from v$database; DBID NAME OPEN_MODE DATABASE_ROLE
---------- --------- -------------------- ----------------
1584932730 ORCL MOUNTED PHYSICAL STANDBY SQL> alter database recover managed standby database cancel; 数据库已更改。
SQL> alter database open; 数据库已更改。
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT; 数据库已更改。
SQL> select DBID,NAME,OPEN_MODE,DATABASE_ROLE from v$database; DBID NAME OPEN_MODE DATABASE_ROLE
---------- --------- -------------------- ----------------
1584932730 ORCL READ ONLY WITH APPLY PHYSICAL STANDBY
windows,oracle,dg报错:ORA-12528,ORA-12154,ORA-10456 ,PING[ARC1]: Heartbeat failed to connect to standby 'orclbk'. Error is 12154的更多相关文章
- Oracle Data Guard PING[ARC2]: Heartbeat failed to connect to standby ''. Error is 12514 故障分析
朋友搭建的一套DG,折腾了很长时间,一直都是报如下错误: ORA-12514: TNS:listener does not currentlyknow of service requested in ...
- oracle dg 报错提示 涉及硬盘错误
###oracle dg 报错提示 涉及硬盘错误 Dec 23 03:28:01 xhisdg rsyslogd: [origin software="rsyslogd" swVe ...
- windows 8 安装 oracle 11g 报错:command line option syntax error,type command/? for help
windows 8 安装 oracle 11g 报错:command line option syntax error,type command/? for help 在windows8操作系统上安装 ...
- windows下oracle数据库报错ORA-12705解决方法
转自:http://blog.sina.com.cn/s/blog_16eaf6b940102x66q.html 有个朋友,他们那边windows虚拟机重启后,数据库不能起来报错ORA-12705无法 ...
- TNS-12532: TNS:invalid argument,Oracle的报错信息太让人无语
TNS-12532: TNS:invalid argument,Oracle的报错信息太让人无语 现象: Tnsping报错: [oracle@unicomGZ01 admin]$ ../../bin ...
- Oracle 12c报错:ORA-01078和LRM-00109的解决办法
Oracle 12c报错:ORA-01078和LRM-00109的解决办法 2017-12-17 10:25:30 lemon_love1 阅读数 4336 收藏 更多 分类专栏: oracle ...
- Oracle启动报错ORA-27102解决
环境:RHEL5.5 + Oracle 10.2.0.4 此错误一般是因为数据库的初始化参数文件的内存设置不当导致.本例是因为操作系统参数设置问题导致. 当前现象:Oracle启动报错ORA-2710 ...
- oracle之报错:ORA-00054: 资源正忙,要求指定 NOWAIT
oracle之报错:ORA-00054: 资源正忙,要求指定 NOWAIT 问题如下: SQL> conn scott/tiger@vm_database Connected to Oracle ...
- openfl关于windows平台编译报错解决办法
报错信息: 无法打开程序数据库“e:\newproj\mainclient\bin\windows\cpp\obj\obj\msvc-debug-ncxp\vc.pdb”:如果要将多个 CL.EXE ...
随机推荐
- sed 的用法
sed 的语法: sed `样式命令` 文件 意思是:如果文件中的某一行符合”样式”,就执行指定的 sed 命令,如删除(d)或替换(s) “样式”使用一对//含括,表示寻找的意思.也可以指定数据行的 ...
- MYSQL安装相关知识
将mysql安装为winsow服务 1.执行命令: mysqld-nt.exe --install (安装到windows的服务) 或者是mysqld -install 2.执行命令: net sta ...
- centos7部署nagios(二)
一.Nagios简介 分类: 监控 undefined Nagios是一款开源的电脑系统和网络监视工具,能有效监控Windows.Linux和Unix的主机状态,交换机路由器等网络设置,打印机等.在系 ...
- Instr()函数用法
返回 Variant (Long),指定一字符串在另一字符串中最先出现的位置. 语法 InStr([start, ]string1, string2[, compare]) InStr 函数的语法具有 ...
- multi gpu inference with tfserving or keras
在tfserving上,目测只能在每个gpu上起docker https://github.com/tensorflow/serving/issues/311#issuecomment-4801 ...
- 洛谷P1412 经营与开发题解
题目链接QWQ这里就不阐述了: 题解部分: 从题面上来看,这是个dp(递推)的题目. 但是dp要满足无后效性,但这个题为了取最值,得考虑从当前开始一直持续到结束的p的影响. 这让我们怎么满足无后效性? ...
- 数据可视化--> numpy
一.NumPy 1.简介: 官网链接:http://www.numpy.org/ NumPy是Python语言的一个扩充程序库.支持高级大量的维度数组与矩阵运算,此外也针对数组运算提供大量的数学函数库 ...
- 第十二章 学习 shell脚本之前的基础知识
http://www.92csz.com/study/linux/12.htm [什么是shell] 简单点理解,就是系统跟计算机硬件交互时使用的中间介质,它只是系统的一个工具.实际上,在shell和 ...
- NOIP2016提高A组五校联考1总结
第一题二分,在比赛上明明想到的方法,结果考虑的时候似乎漏了什么,被否决掉了. 只打了个水法,10分. 第二题,最长不上升子序列,原题,类似的题目做过两道,直接搞定. 第三题,一开始想了一种通过在树上打 ...
- 《转》从系统和代码实现角度解析TensorFlow的内部实现原理 | 深度
from https://www.leiphone.com/news/201702/n0uj58iHaNpW9RJG.html?viewType=weixin 摘要 2015年11月9日,Google ...