我配置了一个备用数据库,它工作了一段时间,但现在我注意到备用数据库上的重做日志线程远远落后于主数据库。在研究了警报日志和跟踪文件后,我发现与备用服务器的连接存在问题。
当我在主服务器上键入时:
sqlplus sys/manager@TESTSTAN as sysdba
输出是:
SQL*Plus: Release 11.2.0.1.0 Production on Fri Jan 29 13:36:17 2016
Copyright (c) 1982, 2009, Oracle. All rights reserved.
ERROR: ORA-01031: insufficient privileges
但我能够从备用连接到主:
[oravis@standbysrv bin]$ sqlplus sys/manager@TESTPROD as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Fri Jan 29 13:46:18 2016
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup mount
ORACLE instance started.
Total System Global Area 422670336 bytes
Fixed Size 1336960 bytes
Variable Size 335546752 bytes
Database Buffers 79691776 bytes
Redo Buffers 6094848 bytes
Database mounted.
SQL> select instance_name, status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
testprod MOUNTED
两台主机上的密码文件相同。此外,我已经重新创建了几次,但这并没有帮助。remote_login_passwordfile参数在两台服务器上都是独占的。
备用服务器上的 listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = teststan)
(ORACLE_HOME = /u01/app/oravis/product/11.2.0/dbhome_1)
(SID_NAME = test) ) )
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = standbysrv)(PORT = 1521))
) )
DYNAMIC_REGISTRATION_LISTENER=off
主节点上的 tnsnames.ora:
TESTSTAN =
(DESCRIPTION =
(ADDRESS_LIST = (ADDRESS =
(PROTOCOL = TCP)
(HOST = standbysrv)
(PORT = 1521)) )
(CONNECT_DATA = (SERVICE_NAME = teststan) )
)
TESTPROD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = oratest)
(PORT = 1521)) )
(CONNECT_DATA =
(SID = test)
(SERVICE_NAME = testprod)
) )
根据
ps -ef|grep pmon
已经显示备库实例名称的命令输出teststan
。但是在备用数据库上的监听器的描述中,
SID_NAME
被定义为“测试”。Oracle 尝试使用从未存在的密码文件 (orapwtest) 验证 sys 用户。
因此,将备用站点上 listener.ora 文件上的 SID_NAME 参数设置为“teststan”。