ORA-16191: Primary log shipping client not logged on standby

本文针对Oracle数据库中出现的ORA-16191错误进行了解析,并提供了详细的解决步骤,包括检查主备库密码文件一致性、设置初始化参数及验证SYS用户密码。

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

ORA-16191:
Primary log shipping client not logged on standby
Cause: An attempt to ship redo to standby without logging on to standby or with invalid user credentials.
Action: Check that primary and standby are using password files and that both primary and standby have the same SYS password. Restart primary and/or standby after ensuring
 that password file is accessible and REMOTE_LOGIN_PASSWORDFILE initialization parameter is set to SHARED or EXCLUSIVE.




错误:
standby报的错误:
FAL[client, ARC3]: Error 16191 connecting to primary2 for fetching gap sequence
Errors in file /oracle/diag/rdbms/ztsta2/ztpri2/trace/ztpri2_arc3_24458.trc:
ORA-16191: Primary log shipping client not logged on standby
Errors in file /oracle/diag/rdbms/ztsta2/ztpri2/trace/ztpri2_arc3_24458.trc:
ORA-16191: Primary log shipping client not logged on standby




primary报的错误:
Check that the primary and standby are using a password file
and remote_login_passwordfile is set to SHARED or EXCLUSIVE,
and that the SYS password is same in the password files.
      returning error ORA-16191
------------------------------------------------------------
Errors in file /oracle/diag/rdbms/ztpri2/ztpri2/trace/ztpri2_arc2_24844.trc:
ORA-16191: Primary log shipping client not logged on standby
PING[ARC2]: Heartbeat failed to connect to standby 'standby2'. Error is 16191.




解决方案:
其实日志和错误提示已经很明显了
1、the primary and standby are using a password file
2、 remote_login_passwordfile is set to SHARED or EXCLUSIVE
3、the SYS password is same in the password files




1、主库和备库的密码文件要一致,一般情况先是主库创建密码文件,然后把密码文件拷贝到备库,我遇到的问题集就是备库密码文件貌似过期了,然后从主库拷贝一份就好了
eg:orapwd file=$ORACLE_HOME/db_1/dbs/orapwSID password=****** force=y


2、看主库和备库的初始化参数:remote_login_passwordfile='EXCLUSIVE' 或 shared


3、主库的系统用户密码和密码文件的一样









### 解决ORA-01012 错误并正确执行 `archive log list` 命令 当遇到 `ORA-01012: not logged on` 的错误提示时,这通常意味着当前会话未成功连接到数据库实例。为了有效解决问题并顺利执行 `archive log list` 命令,需遵循以下建议: 对于无法通过常规方式登录的情况,可以尝试使用操作系统认证的方式强制关闭实例后再启动[^3]。 ```bash sqlplus "/ as sysdba" shutdown abort; startup; ``` 上述操作能够终止所有活动进程,并重启数据库服务,从而恢复正常状态下的登录功能。 一旦成功以SYSDBA身份登录之后,就可以安全地运行 `archive log list` 来查看归档日志的信息了: ```sql ARCHIVE LOG LIST; ``` 此命令用于显示有关数据库归档模式的状态以及归档目的地等重要详情。如果之前因为权限不足或其他原因未能正常工作,则现在应该可以看到预期的结果。 #### 关于可能引起该问题的原因分析 有时即使是以 SYS 用户的身份也无法完成正常的查询动作,比如试图从视图 `v$log` 中获取数据却遇到了 `ORA-01034: ORACLE not available` 的情况[^2]。这类现象往往暗示着更深层次的问题存在——可能是由于实例尚未完全初始化或者是处于挂起状态下造成的。因此,在尝试任何诊断或修复措施前,请先确认目标环境中的Oracle实例确实已经稳定运行。 另外需要注意的是,如果系统中活跃的用户数量过多以至于超过了预设的最大并发量(`processes`)参数设定的话,也会导致新建立的连接请求被拒绝,进而引发类似的登录失败状况。针对这种情况,除了等待现有用户的减少外还可以考虑调整配置文件来增加允许的同时在线人数上限或是清理不必要的后台作业以释放资源。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值