When you try to start the listener service and it gives you the below message and stops automatically.
The OracleOraDb10g_home1TNSListener service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service.
Solution which worked for me:
1) listener.ora file was missing under the NETWORK/ADMIN folder so I have added the file to this folder with the below content.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = <IPADDRESS>)(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)
2) Made sure the sqlnet.ora file has the below entry.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
3) Made sure the tnsnames.ora has the proper entry as shown below
orcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = <IPADDRESS>)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
4) Restart the machine and manually start the oracle service. This time it will start properly and you can able to connect to it via any oracle developer tools.
Note: Even-though the listener is not running you will be able to connect to database via sqlplus available under oracle home application development utility.