Oracle主库修改sys密码备库不能传输归档
转载请注明文章转载自:Dbabc.Net [http://dbabc.net]
本文链接:http://dbabc.net/archives/2010/09/25/orapw-standby-database.shtml
今天在点检数据库的时候发现alert日志出现如下错误。
Mon Dec 1 14:00:42 2008
Error 12541 received logging on to the standby
Check whether the listener is up and running.
Mon Dec 1 14:00:42 2008
Errors in file /u01/product/admin/wind/bdump/wind_arc0_8921.trc:
ORA-12541: TNS:no listener
PING[ARC0]: Heartbeat failed to connect to standby ‘standby’. Error is 12541.
Mon Dec 1 14:05:42 2008
Error 12541 received logging on to the standby
Check whether the listener is up and running.
Mon Dec 1 14:05:42 2008
Errors in file /u01/product/admin/wind/bdump/wind_arc0_8921.trc:
ORA-12541: TNS:no listener
PING[ARC0]: Heartbeat failed to connect to standby ‘standby’. Error is 12541.
Mon Dec 1 14:10:42 2008
Error 12541 received logging on to the standby
Check whether the listener is up and running.
Mon Dec 1 14:10:42 2008
Errors in file /u01/product/admin/wind/bdump/wind_arc0_8921.trc:
ORA-12541: TNS:no listener
当时看到错误信息第一印象就是standby DB监听没起来,
在standby 通过$lsnrctl status查看监听运行良好,
pdmsty</data/wind/arch>$lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 – Production on 01-DEC-2008 14:43:03
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.3)(PORT=1521)))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 – Production
Start Date 20-NOV-2008 15:06:32
Uptime 10 days 23 hr. 36 min. 31 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/product/oracle/network/admin/listener.ora
Listener Log File /u01/product/oracle/network/log/listener.log
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.2)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary…
Service “PLSExtProc” has 1 instance(s).
Instance “PLSExtProc”, status UNKNOWN, has 1 handler(s) for this service…
Service “wind” has 1 instance(s).
Instance “wind”, status READY, has 1 handler(s) for this service…
Service “wind_XPT” has 1 instance(s).
Instance “wind”, status READY, has 1 handler(s) for this service…
The command completed successfully
通过 tnsping standby 可以ping的通
ydcpdm</data/wind/arch>$tnsping standby
TNS Ping Utility for Linux: Version 10.2.0.1.0 – Production on 01-DEC-2008 14:34:59
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.3)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = wind)))
OK (10 msec)
奇怪,能ping通,不能传数据,难道是参数设置有问题,g.cn一下,
后来发现是主从库(PrimaryDB& Standby DB SYS的密码不一致),后来想起来是主库的sys修改了~~·
在主库上使用如下命令不能登陆sql
ydcpdm</data/wind/arch>$sqlplus ‘sys/password@standby as sysdba’
SQL*Plus: Release 10.2.0.1.0 – Production on Mon Dec 1 14:47:45 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:
解决方法如下:
在从库(standby DB)上重建密码文件$orapwd file=orapwwind password=password entries=10
在主库(Primary)上测试sqlplus ‘sys/password@standby as sysdba’
ydcpdm</data/wind/arch>$sqlplus ‘sys/super#ora@standby as sysdba’
SQL*Plus: Release 10.2.0.1.0 – Production on Mon Dec 1 14:37:54 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
SQL>
ok登陆成功了。然后再在从库上查看归档是否已经传过来。
总结,dataguard修改密码文件生效的方法。
1、ARCH方式传送日志时,如果主备库密码文件不一致,在重新设置密码文件后,必须重启主库才能使日志传送恢复正常。
2、LGWR方式传送日志时,如果主备库密码文件不一致,在重新设置密码文件后,只需可以重启主库或重启备库就可使日志传送恢复正常。