原本有一台linux服务器安装oracle单实例,版本是11.2.0.4,用作主库,后来在另外一台linux服务器上安装了数据库软件,版本也是11.2.0.4,用作从库,搭建完成后,复制了主库的密码文件到从库,然后在主库上以rman的方式复制主库实例到从库,能够正常获取到主库的归档日志,查询gv$database看到主库的切换状态是 session active,从库的切换状态是 NOT ALLOWED,从库能够正常应用主库的归档日志,从库的RFS进程能够正常启动,主库的LNS进程也能正常启动,但是运行一段时间之后,主库会突然出现如下的报错日志:
Tue Feb 19 14:17:54 2019
******************************************************************
LGWR: Setting 'active' archival for destination LOG_ARCHIVE_DEST_2
******************************************************************
LNS: Standby redo logfile selected for thread 1 sequence 93292 for destination LOG_ARCHIVE_DEST_2
Tue Feb 19 14:17:59 2019
Archived Log entry 4655 added for thread 1 sequence 93291 ID 0x2fe72ffb dest 1:
Tue Feb 19 14:18:00 2019
Error 1017 received logging on to the standby然后主库的切换状态失败:FAILED DESTINATION,sys的密码都试过了,从主库可以以sys密码登录到从库,从库也可以以相同的sys密码登录主库,tnsping也没有问题,请各位大佬帮忙分析一下,为什么突然sys密码就不能用了?

解决方案 »

  1.   

    追加主库的另外一段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
    ------------------------------------------------------------
    FAL[server, ARC0]: FAL archive failed, see trace file.
    ARCH: FAL archive failed. Archiver continuing
    ORACLE Instance bidb - Archival Error. Archiver continuing.
    Tue Feb 19 14:18:16 2019
    Error 1017 received logging on to the standby
      

  2.   

    如果实例名字不一样,需要修改密码文件。
    cd $ORACLE_HOME/dbs
    mv orapw(sid主) orapw(sid从)
      

  3.   

    实例名不一样,文件名已经修改成了 orapw(sid主) orapw(sid从)
      

  4.   

    基本上可以确定不是密码的问题,我用相同的密码从主库登录到从库,从从库也可以登录到主库,而且关键是刚刚建立dg时,主库的日志是可以传到从库的,只是在运行了一段时间之后(有长有短,长的3 4天,短的几个小时),就会报如下错误:
    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
      

  5.   

    已经解决,不是密码文件的问题,是主库使用了登录触发器,然后从库复制了主库,也有了登录触发器,从库是以read-olny模式启动的,使用触发器就会报登录错误,此时主库再去登陆从库,就会报密码错误,但是更具体的解释就不知道了,可能是oracle的bug,也可能是还有什么地方需要配置的,谢谢你的回答