Oracle ora-12541:tns: No Listener

Source: Internet
Author: User
Tags goto


Oracle ora-12541:tns: No Listener


Tags: Oracle DataBase



Today, using the Oracle database, using the Visual connection tool to connect to the database of the test environment prompt no listener, and finally with the help of the teacher finally done! ^ ( ̄︶ ̄) ^


Problem:
ORA-12541:TNS:无监听程序
Workaround:
  1. To check if the listener is starting normally, use "Windows+r" to entercmd, 
    Enterlsnrctl starton the command line to check if the listener is working properly, Prompt if normal: 
    TNS-01106: Listener with Name Listener has started



    If it is not running, you can use the 
    lsnrctl statuscommand to view service status, 
    lsnrctl reloadto restart the listening service 
    lsnrctl stopto turn off the monitoring service 
    Lsnrctl Startto turn on the listening service

    If the listener service is still not restarted and prompts: 
    is connected to (description= (address= (PROTOCOL=IPC) (key= EXTPROC1521)) Tns-12541:tns: No listener tns-12560:tns: Protocol Adapter Error TNS-00511: No listener 64-bit Windows error:2: No such file or dir Ectory is connecting to (description= (address= (protocol=tcp) (Host=localhost) (port=1521)) Tns-12541:tns: No listener tns-12560:tns: Protocol Adapter Error TNS-00511: No listener 64-bit Windows error:61:unknown error
    Run cmd asAdministrator(cmd location: C:\Windows \system32) 
    Restart the monitoring service by entering the following command in CMD;

     net start "Oracleoradb11g_home1tnslistener"
  2. Use commands at the command linetnsping IP address to see if the IP Listening service is healthy (eg:tnsping 192.168.20.181)
    To check that the Tnsnames.ora service is configured correctly


  3. Check for firewall issues.
  4. Root cause: Listener.ora file. (Remember to back up before modifying!!!) )
# listener.ora Network Configuration File: D:\Oracle11g\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = D:\Oracle11g\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:D:\Oracle11g\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = D:\Oracle11g
Oracle Related service Settings


Finally, because Oracle's database service is too expensive for system resources (Computer Configuration is not ...). It then wrote a batch to set up how Oracle-related services are started (set to manual) and to turn on or turn off Oracle's related services.
Save the following code to double-click toOracle Related service settings.batOpen the related service each time you connect to Oracle with a visualizer, and then double-click to close the service after you have finished using it.



@echo off
Title Oracle Service Setup Tool By Ryanjie
Mode con lines=38 cols=88
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
Cd /d "%~dp0"


:main
Color 2f
Echo.------------------------------------------------ ---------------------------------------+
Echo %date% %time:~0,8%
::echo %date年~0,4%:%date月~5,2%:%date日~8,2%
::echo %time%
Echo.
Echo TODO: Oracle Service Setup Tool
Echo.
Echo Author: Ryanjie
Echo.
Echo Function: This batch will automatically set, start and stop the Oracle service.
Echo.
Echo WARNING: If there are 360, computer butler and other security software reminders, please check the trust permission and no longer remind!
Echo.
Pause
Echo.
Echo Oracle related services (can be changed according to the service name of your computer, note that the "service name" is not the "display name")
Echo 『OracleOraDb11g_home1ClrAgent』
Echo 『OracleOraDb11g_home1TNSListener』
Echo 『OracleServiceORCL』
Echo 『Oracle ORCL VSS Writer Service』
Echo 『OracleDBConsoleorcl』
Echo 『OracleJobSchedulerORCL』
Echo 『OracleMTSRecoveryService』
Echo
Echo
Echo.------------------------------------------------ ---------------------------------------+
Echo.
Echo Please choose to use:
Echo.
Echo 1. Set the Oracle related service to start manually (ie enter 1 below)
Echo.
Echo 2. Start the Oracle related service (ie enter 2 below)
Echo.
Echo 3. Stop the Oracle related service (ie enter 3 below)
Echo.
Echo.------------------------------------------------ ---------------------------------------+
If exist "%SystemRoot%\System32\choice.exe" goto Win7Choice
Set /p choice=Please enter a number and press Enter to confirm:
Echo.
If %choice%==1 goto sc
If %choice%==2 goto start
If %choice%==3 goto stop
"set choice="
Echo You entered incorrectly, please re-select.
Ping 127.0.1 -n "2">nul
Cls
Goto main


:Win7Choice
Choice /c 123 /n /m "Please enter the corresponding number:"
If errorlevel 3 goto stop
If errorlevel 2 goto start
If errorlevel 1 goto sc
Cls
Goto main


:sc
Cls
Color 2f
Echo.------------------------------------------------ ---------------------------------------+
Echo.
Sc config "OracleOraDb11g_home1ClrAgent" start=demand
Sc config "OracleOraDb11g_home1TNSListener" start=demand
Sc config "OracleServiceORCL" start=demand
Sc config "Oracle ORCL VSS Writer Service" start=demand
Sc config "OracleDBConsoleorcl" start=demand
Sc config "OracleJobSchedulerORCL" start=demand
Sc config "OracleMTSRecoveryService" start=demand
Echo.------------------------------------------------ ---------------------------------------+
Echo.
Echo %date% %time:~0,8%
::echo %date年~0,4%:%date月~5,2%:%date日~8,2%
::echo %time%
Echo.
Congratulations, Oracle related services
Echo. 『OracleOraDb11g_home1ClrAgent』
Echo. 『OracleOraDb11g_home1TNSListener』
Echo. 『OracleServiceORCL』
Echo. "Oracle ORCL VSS Writer Service"
Echo. "OracleDBConsoleorcl"
Echo. "OracleJobSchedulerORCL"
Echo. "OracleMTSRecoveryService"
Echo.
Echo. Successfully set to start manually!
Echo.
Echo.------------------------------------------------ ---------------------------------------+
Goto end


:start
Cls
Color 2f
Echo.------------------------------------------------ ---------------------------------------+
Echo.
::The following four services are opened according to individual needs
Net start "OracleOraDb11g_home1ClrAgent"
Net start "OracleOraDb11g_home1TNSListener"
Net start "OracleServiceORCL"
::net start "Oracle ORCL VSS Writer Service"
::net start "OracleDBConsoleorcl"
::net start "OracleJobSchedulerORCL"
::net start "OracleMTSRecoveryService"
Echo.------------------------------------------------ ---------------------------------------+
Echo.
Echo %date% %time:~0,8%
::echo %date年~0,4%:%date月~5,2%:%date日~8,2%
::echo %time%
Echo.
Congratulations, Oracle related services
Echo. 『OracleOraDb11g_home1ClrAgent』
Echo. 『OracleOraDb11g_home1TNSListener』
Echo. 『OracleServiceORCL』
Echo.
Echo.
Echo. Successfully started!
Echo.
Echo.------------------------------------------------ ---------------------------------------+
Goto end


:stop
Cls
Color 2f
Echo.------------------------------------------------ ---------------------------------------+
Echo.
Net stop "OracleOraDb11g_home1ClrAgent"
Net stop "OracleOraDb11g_home1TNSListener"
Net stop "OracleServiceORCL"
::If the following four services are already open, delete the previous "rem"
Net stop "Oracle ORCL VSS Writer Service"
Net stop "OracleDBConsoleorcl"
Net stop "OracleJobSchedulerORCL"
Net stop "OracleMTSRecoveryService"
Echo.------------------------------------------------ ---------------------------------------+
Echo.
Echo %date% %time:~0,8%
::echo %date年~0,4%:%date月~5,2%:%date日~8,2%
::echo %time%
Echo.
Congratulations, Oracle related services
Echo. 『OracleOraDb11g_home1ClrAgent』
Echo. 『OracleOraDb11g_home1TNSListener』
Echo. 『OracleServiceORCL』
Echo.
Echo. Has been successfully closed!
Echo.
Echo.------------------------------------------------ ---------------------------------------+
Goto end


:end
Echo, please press any key to retreat
Out.
@Pause>nul  


『』『』



Oracle ora-12541:tns: No Listener


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.