tnsnames.ora配置不当导致严重问题
时间:2010-08-31 来源:osdba
若tnsname.ora配置不当,比如:
mytest.db.my.com =
(DESCRIPTION =
( ADDRESS_LIST =
ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.1.2)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID = oratest)
)
)
多了一行ADDRESS_LIST = ,这行地址会被认为指向了一个空。这个时候如果做 tnsping donny.db.alibaba.com 这个操作,会一直不返回。但主机 cpu和内存会被消耗掉大量资源,可能导致应用连接数据库出现异常,甚至数据库异常。
Linux:
top - 13:46:52 up 53 days, 12:43, 2 users, load average: 0.63, 0.17, 0.05
Tasks: 111 total, 2 running, 109 sleeping, 0 stopped, 0 zombie
Cpu(s): 15.6% us, 11.5% sy, 0.0% ni, 72.8% id, 0.2% wa, 0.0% hi, 0.0% si
Mem: 2074864k total, 1630516k used, 444348k free, 101932k buffers
Swap: 8393920k total, 30028k used, 8363892k free, 712056k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2467 oracle 25 0 736m 727m 1948 R 100 35.9 0:45.51 tnsping
68 root 16 0 0 0 0 S 8 0.0 2:40.72 kswapd0
1 root 16 0 3172 552 472 S 0 0.0 0:00.99 init
Aix:
Name PID CPU% PgSp Owner
tnsping 98446 25.0 832.8 oracle
lrud 1032 1.3 0.0 root
topas 687836 0.4 14.0 root