TNS-12541,TNS-12560,TNS-00511,TNS-12542,TNS-12560,TNS-00512資料庫啟動監聽報錯,tns-12541tns-00512

來源:互聯網
上載者:User

TNS-12541,TNS-12560,TNS-00511,TNS-12542,TNS-12560,TNS-00512資料庫啟動監聽報錯,tns-12541tns-00512

第 1章   資料庫伺服器監聽錯誤

1.1.1資料庫監聽錯誤

1.1.1.1 問題及現象

伺服器環境為ORACLE11G RAC環境,系統啟動後,監聽沒起來。

[oracle@RAC4 ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 29-JUN-2015 10:44:45
Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused

1.1.1.2 檢查思路

 

當時同事已經檢查過CRS、也嘗試過使用命令啟動監聽等步驟。但是啟動監聽的時候會有以下報錯

 

[oracle@RAC4 ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 29-JUN-2015 10:51:46
Copyright (c) 1991, 2011, Oracle.  All rights reserved.
Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Log messages written to /u01/app/oracle/diag/tnslsnr/RAC4/listener/alert/log.xml
Error listening on: (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12542: TNS:address already in use
 TNS-12560: TNS:protocol adapter error
  TNS-00512: Address already in use
   Linux Error: 98: Address already in use

Listener failed to start. See the error message(s) above...

 

居然說系統已使用,那麼理所當然的就去查看1521連接埠和lsn進程

 

[root@RAC4 ~]# ps-ef | grep lsn

grid     52181     1  0 10:04?        00:00:11/u01/*/*/bin/tnslsnrLISTENER_SCAN1 -inherit

root    101600 100759  0 22:30 pts/0    00:00:00 grep lsn

[root@RAC4 ~]#netstat-anp | grep 1521

tcp       0     0xxx.xxx.xxx.xxx:1521          0.0.0.0:*                  LISTEN      52181/tnslsnr     (有些內容不便列出) 

 

發現1521連接埠和/u01/11.2.0/grid/bin/tnslsnrLISTENER_SCAN1-inherit進程存在,所以嘗試殺掉此進程

 

[root@RAC4 ~]#kill -9 52181

-bash: kill:(52181) - No suchprocess

 

殺掉後發現系統提示沒有這個進程,重新查詢

 

 

[root@RAC4 ~]# ps-ef |grep lsn

grid    104147     1  0 23:23?        00:00:00/u01/*/*/bin/tnslsnrLISTENER_SCAN1 -inherit

root    104379 104353  0 23:28 pts/0    00:00:00 grep lsn

 

又有了,應該是父進程自動又給他啟動了,查看其父進程是init進程。

 

[grid@RAC4 ~]$pstree 1

init─┬─MBADataMover───MBADataMover───MBADataMover

    ├─2*[tnslsnr───2*[{tnslsnr}]]

 

 

 

1.1.1.3 出現問題的原因

 

因為我記得在書上看到過,11G的RAC中SRVCTL可以管理監聽,於是嘗試使用此命令來啟動監聽。

 

1.1.1.4 解決方案

[grid@RAC4 ~]$srvctl start listener -n RAC4

 

[grid@RAC4~]$ exit

logout

[root@RAC4~]# su -oracle

[oracle@RAC4~]$lsnrctl status;

 

LSNRCTLfor Linux:Version 11.2.0.3.0 - Production on 01-JUL-2015 11:32:45

 

Copyright(c) 1991,2011, Oracle.  All rightsreserved.

 

Connectingto(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUSof theLISTENER

------------------------

Alias                    LISTENER

Version                  TNSLSNR for Linux: Version11.2.0.3.0 - Production

StartDate               01-JUL-2015 10:38:57

Uptime                   0 days 0 hr. 53 min. 47 sec

TraceLevel              off

Security                 ON: Local OS Authentication

SNMP                     OFF

ListenerParameterFile  /u01/11.2.0/grid/network/admin/listener.ora

ListenerLogFile        /u01/app/oracle/diag/tnslsnr/RAC4/listener/alert/log.xml

ListeningEndpointsSummary...

 (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))

 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=11.10.110.23)(PORT=1521)))

 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=11.10.110.25)(PORT=1521)))

ServicesSummary...

Service"+ASM"has 1 instance(s).

  Instance"+ASM2", status READY, has1 handler(s) for this service...

Service"RAC3"has 1 instance(s).

  Instance"RAC32", status READY, has1 handler(s) for this service...

Service"RAC3XDB"has 1 instance(s).

  Instance"RAC32", status READY, has1 handler(s) for this service...

Service"RACDB007"has 1 instance(s).

  Instance "RACDB0072",status READY, has1 handler(s) for this service...

Service"RACDB007JL_BJ"has 1 instance(s).

  Instance"RACDB007JL2", status READY,has 1 handler(s) for this service...

Service"RACDB007JL_BJXDB"has 1 instance(s).

  Instance"RACDB007JL2", status READY,has 1 handler(s) for this service...

Service"RACDB007XDB"has 1 instance(s).

  Instance"RACDB0072", status READY, has1 handler(s) for this service...

The commandcompleted successfully

1.1.1.5 知識點

經過這次問題的解決,發現oracle 11G的RAC中有很多功能都通過叢集命令來控制,而不能單一的通過單機管理的方法來控制叢集的某些功能

 

著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.