Lỗi ora-12154 tns could not resolve service name năm 2024

This error is an Oracle error referencing a problem with the TNSNAMES.ORA file. Confirm the following and if the error persists contact Oracle support for further assistance.

1. Verify that a TNSNAMES.ORA files exists and is in the proper place and accessible. See Oracle operating system specific manual for details on the required name and location.

2. Check to see that the service name is mapped to a connect descriptor in the TNSNAMES.ORA file and add or correct it if necessary.

3. Confirm there are no syntax errors anywhere in the file. Particularly look for unmatched parentheses, blank spaces in the connect string or stray characters. Any error in a TNSNAMES.ORA file makes it unusable. Do not edit this file unless you know what this should contain. If you are unsure contact your DBA. Back up this file before making any changes.

4. Check with Oracle/SQL*NET Administrator, and confirm a successful connection can be made through SQL*Plus. Also test with NETTEST.

5. Confirm that there are not two aliases that have the same name.

6. If attempting to connect in Powerplay Server, confirm the connection string being used is the same as the one detailed in the tnsnames on the Server.

7. Verify that the database definition is listed in the cognos.ini. Check the cognos.ini in the [Databases] section, under the entry for the database definition for the Oracle connection, and see if the SQL*Net connect string is the same as the entry in the tnsnames.ora. If it is not, change the entry in the cognos.ini file to show the proper "SQL*Net connect string" for the database. Once this is changed, save the file, restart Impromptu and test the connection.

8. If this error is occurring with Oracle 8, add the following 2 lines to the cogdmor.ini file:

OR80-Win32=ORA804.DLL,8.0 <- **ADD** OR73-Win32=ORA73.DLL,7.3

OR80=ORA804.DLL,8.0 <- **ADD** OR73=ORA73WIN.DLL,7.3 Problem Description:

9. Remove ORAWIN95\bin from the path. Reboot the machine and add ORWAWIN95\bin back to the path. Reboot the machine.

[{"Product":{"code":"SSTQPQ","label":"IBM Cognos Series 7 PowerPlay"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Impromptu","Platform":[{"code":"PF025","label":"Platform Independent"},{"code":"PF033","label":"Windows"}],"Version":"Cognos 8 BI Cognos Connection 8.2;Cognos 8 BI Framework Manager 8.2;Impromptu 2.0;Impromptu 3.0;Impromptu 3.04;Impromptu 3.5;Impromptu 4.0;Impromptu 4.01;Impromptu 5.0;Impromptu 5.5;Impromptu 7.3;Impromptu 7.4;Impromptu Web Reports 7.0;PowerPlay Transformer 5.21;Scheduler 5.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Product":{"code":"SSEP7J","label":"Cognos Business Intelligence"},"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Component":"Cognos Connection","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}},{"Product":{"code":"SSEP7J","label":"Cognos Business Intelligence"},"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Component":"Framework Manager","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}},{"Product":{"code":"SSTQPQ","label":"IBM Cognos Series 7 PowerPlay"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Impromptu","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Product":{"code":"SSTQPQ","label":"IBM Cognos Series 7 PowerPlay"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Impromptu Web Reports","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Product":{"code":"SSTQPQ","label":"IBM Cognos Series 7 PowerPlay"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Transformer","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Product":{"code":"SSTQPQ","label":"IBM Cognos Series 7 PowerPlay"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Scheduler","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

The “ORA-12154: TNS:could not resolve the connect identifier specified” Oracle error is a commonly seen message for database administrators. When this occurs, there’s an issue with creating a connection with one of your Oracle services or database instances. In some Oracle database versions, this error may be called “ORA-12154: TNS:could not resolve service name.” The connect identifier is not able to resolve and may be caused by one or more of the following issues:

  • Inability to connect to the repository due to unplanned server and network outages
  • The entry is missing from tnsnames.ora
  • The entry in tnsnames.ora is malformed
  • The program is using tnsnames.ora from the wrong ORACLE_HOME
  • The program is not using a fully qualified service name, but no default domain is enabled in sqlnet.ora

Because there is more than one cause of the ORA-12154 error, you need to troubleshoot precisely what’s going on with your database connections. You’ll typically see this error in the Oracle client application during the connection process, not the server itself. While it can be frustrating to see this error when you’re working on an application, the fix is relatively straightforward.

Resolving ORA-12154 Error Codes

The Oracle client code uses one of three ways to look up connect data:

  • A flat file named tnsnames.ora
  • Oracle Names service
  • LDAP

When the complete ORA-12154 error appears with the text line, your program has found a working Oracle client install. However, the specified Oracle service is not listed in tnsnames.ora, Oracle Names or LDAP.

The first step in the troubleshooting process is to determine which name resolution method is deployed at your site. Most sites use tnsnames.ora, but enough use Oracle Names and LDAP, so it’s best to confirm this information.

If you are not the database administrator, get in touch with the people managing your Oracle systems and find out which method you should be using. They may be able to guide you in fixing the problem in accordance with your site’s standards.

The client code decides which mechanism to use based on the file sqlnet.ora. This file and tnsnames can usually both be found in the Oracle install directory (“ORACLE_HOME”), under network/admin/. This location may be overridden with the environment variable TNS_ADMIN.

If the sqlnet.ora file does not exist or does not specify a resolution method, then Oracle Net uses tnsnames.ora.

Example locations of Oracle networking files include:

Windows

  • ORANTNET80ADMIN
  • ORACLEORA81NETWORKADMIN
  • ORAWIN95NETWORKADMIN
  • ORAWINNETWORKADMIN

UNIX / Linux

  • $ORACLE_HOME/network/admin/
  • /etc/
  • /var/opt/oracle/

If you fix the naming issues, but you still see the ORA-12154 error, check the Oracle service to confirm that it’s available for connections. A power outage, server failure, or network connectivity issue will make this resource inaccessible. It’s also possible that scheduled maintenance or repairs of an unrelated Oracle issue may take that resource temporarily offline.

Get Expert Help with Resolving Your ORA-12154 Errors

Datavail’s Oracle experts have an average of 15 years of experience and are well-versed in resolving common connection problems with this database technology. We offer Oracle services tailored to your needs, whether you need occasional assistance with troubleshooting or end-to-end solutions for your business.

Don’t let Oracle errors get in the way of creating high-availability, stable applications that your organization depends on. Get the most out of your technology investments by contacting us today.