Tag Archives: check services register

ORA-12154 / TNS-12154 TNS:could not resolve service name

ORA-12154 / TNS-12154 TNS:could not resolve service name

1. Check the tnsnames.ora and sqlnet.ora file is present on the location.

On windows: ORACLE_HOME\network\admin\

ON LINUX: ORACLE_HOME/network/admin.

2. Check the entries in tnsnames.ora is correct.

ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (Host = 192.168.1.56)(Port = 1521) ) )
CONNECT_DATA = (SERVICE_NAME = ORCL) ) )
Check Tnsping command with ORCL alias, if it working or giving error

3. Check the listener on the server with listener command and check service name is present as you mentioned in above service name.

lsnrctl service

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
The command completed successfully

Note: in this case ORCL service is not present.
1. Check database is started if not start the database first may service is register dynamically with listener it will fixed issue when database started.
2. Tried to register the service name manually by editing listener.ora file/ management console and reload the listener after changes.

4. If tnsnames having domain name as alias then check sqlnet.ora file also

ORCL.ORACLE = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (Host = 92.168.1.56)(Port = 1521)) )
(CONNECT_DATA = (SERVICE_NAME = ORCL) ) )

Check SQLNET file support domain as:
Parameter NAMES.DEFAULT_DOMAIN=oracle need to look into the SQLNET.ORA file.
Case 1: IF parameter NAMES.DEFAULT_DOMAIN and alias.domain in tnsnames.ora present then its OK
Case 2: IF parameter NAMES.DEFAULT_DOMAIN not present and alias.domain present in tnsnames.ora then need to add NAMES.DEFAULT_DOMAIN=oracle in SQLNET.ora file.
Case 3: IF parameter NAMES.DEFAULT_DOMAIN is present and alias only used for connection as TNS entries then remove the parameter NAMES.DEFAULT_DOMAIN from SQLNET.ora
Case 4: IF parameter NAMES.DEFAULT_DOMAIN is not present and alias only used as tns entries then its OK.

5. Check after setting the Environment Variable

TNS_ADMIN environment variable.
Third: ORACLE_HOME\network\admin

Advertisements