Oracle 12c同步Data Guard口令文件步骤 ORA-16191

3250阅读 0评论2019-12-27 brjl
分类:Oracle

前提知识:
从12.2 开始,DG环境,主库修改密码后可以自动同步到备库,不需要手工处理(Doc ID 2307365.1 )
12.1 版本,DG环境,主库修改sys密码,需要手工同步( Doc ID 1984091.1 )

但有时候也会遇到问题。

配置好的ADG,过了一段时间,看alert日志不断报错
------------------------------------------------------------
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
------------------------------------------------------------
那么需要重新同步口令文件了?


搭建RAC对RAC DG时需要保持各节点的口令文件一致,在11g中需要把节点1的口令文件复制到节点2,然后传输到RAC DG的两个节点上。在12c中更复杂些,因为口令文件放在了ASM中。

主库上grid:
查看当前的口令文件
srvctl config database -d ORCL|grep Password
  Password file: +DATADG/ORCL/PASSWORD/pwdORCL.291.1026246847 注意看这一行


asmcmd -p
pwget --dbuniquename xxx 应该跟上面的结果一样鸭,12c才有的命令
pwcopy +DATADG/ORCL/PASSWORD/pwdORCL.291.1026246847 /tmp  拷贝出来
exit


scp /tmp/pwdORCL.291.1026246847   root@192.168.1.170:/tmp/pwdORCLDG  传到dg的备库


在备库root:
chown grid:oinstall /tmp/pwdORCLDG


oracle:
srvctl config database -db ORCLDG 最好先看一下当前的口令文件,以便后面确认是否更改了
  +DG1/ORCLDG/password/pwdORCLDG
  
grid:
asmcmd -p
pwcopy /tmp/pwdORCLDG '+DG1/ORCLDG/password/'


srvctl modify database -db ORCLDG -pwfile '+DG1/ORCLDG/password/pwdORCLDG'
这样alert就不再报错了。
如果还报错呢?
那就在备库上先删除口令文件,停止应用归档的进程msp,然后再拷贝一遍。

上一篇:指定oracle用户口令有效期
下一篇:linux 7 改主机名