原因:
rhel5.4 x64,两节点的oracle10204 rac,安装完成后反复重启服务器进行测试都能正常使用,今天用户打电话说因机房停电,所有设备掉电,来电后设备自动开机,需要我重新将数据库服务器启动起来。
过程:
首先重启一遍2台数据库服务器,因为来电后存储和数据库服务器会同时启动,所以重启一次,以便使数据库服务器能够连上共享存储。然后启动数据库:
cd /dev/raw
chmod 660 *
chown oracle:dba *
crsctl start crs
数据库集群所有服务都正常启动,启动后使用plsql软件无法连接到实例1,可以连接到实例2。直接登录到实例2服务器上登录,报错ora-12520:
[oracle@dbb admin]$ hostname
dbb
[oracle@dbb admin]$ pwd
/u01/rdbms/network/admin
[oracle@dbb admin]$ more tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/rdbms/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
LISTENERS_DZDB =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dba-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = dbb-vip)(PORT = 1521))
)
DB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.61.175.27)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dzdb)
(INSTANCE_NAME = dzdb1)
)
)
[oracle@dbb admin]$ sqlplus ga/htjs1@db1
SQL*Plus: Release 10.2.0.4.0 - Production on Sun May 4 15:17:49 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
ERROR:
ORA-12520: TNS:listener could not find available handler for requested type of
server
Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
解决:
上网查找解决方法,原因是在oracle10G RAC建库时,无论是使用dbca还是使用脚本手工建库,数据库的参数local_listener都为空,需要后期修改一下,将local_listener=vip就可以了。
[oracle@dba log]$ hostname
dba
[oracle@dba log]$ sqlplus '/as sysdba'
SQL*Plus: Release 10.2.0.4.0 - Production on Sun May 4 15:18:54 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> Alter system set LOCAL_LISTENER="(address=(protocol=tcp)(host=10.61.175.27)(port=1521))" scope=both sid='dzdb1';
System altered.
SQL>
再次登录,问题解决:
[oracle@dbb admin]$ hostname
dbb
[oracle@dbb admin]$ sqlplus ga/htjs1@db1
SQL*Plus: Release 10.2.0.4.0 - Production on Sun May 4 15:21:40 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL>