ORA-12154: TNS:could not resolve service name无法解析指定的连接标志符

tnsnames.ora

中假如没有所需要的SID名 

ORCL=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 202.113.13.84)(PORT = 1521))
)
(CONNECT_DATA =
(SID = orcl)
(SERVER = DEDICATED)
)
)

而你需要用SID ORCL

就会发生这个错误。

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

I see the error "HTTP-503 ORA-12154" in the file ORACLE_HOME/Apache/Apache/conf/error_log. What does this mean?

This error means that mod_plsql is unable to connect to the database.

Ensure that:

  1. The database is up and running.

  2. The username and password information in the DAD is correct.

  3. The middle-tier is able to connect to the database using the PlsqlDatabaseConnectString parameter in the DAD.

In most situations, the problem occurs because SQL*Net is not able to resolve the connect string parameter using the configuration information under ORACLE_HOME/network/admin.

  • For entries configured with TNSFormat or NetServiceNameFormat, validate the connect string information by using tnsping dad_connect_string. For example:

    tnsping "cn=iasdb,cn=oraclecontext"
    
    

    or

    tnsping iasdb.us.oracle.com
    
    
  • For entries configured with SIDFormat and ServiceNameFormat, ensure that the hostname, port, and SID/service_name information match for the database listener. After verifying this, confirm that SQL*Plus can connect to the database using the DAD username, password, and connect string.

If this does not work, refer to the Oracle SQL*Net documentation on how to troubleshoot this further.

 

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

解决过程

ORA-12154: TNS:could not resolve service name
Cause: Oracle Net could not locate the net service name specified in the tnsnames.ora configuration file.
Action: Perform these steps:
  1. Verify that a tnsnames.ora file exists.

    See Also:

    "Localized Configuration File Support" for configuration file location information
  2. Verify that there are not multiple copies of the tnsnames.ora file.

  3. In the tnsnames.ora file, verify that the net service name specified in your connect string is mapped to a connect descriptor.

  4. Verify that there are no duplicate copies of the sqlnet.ora file.

  5. If you are using domain names, verify that your sqlnet.ora file contains a NAMES.DEFAULT_DOMAIN parameter. If this parameter does not exist, you must specify the domain name in your connect string.

  6. If you are not using domain names, and this parameter exists, delete it or disable it by commenting it out.

  7. If you are connecting from a login dialog box, verify that you are not placing an "@" symbol before your connect net service name.

  8. Activate client tracing and repeat the operation.

Cause: Oracle Net could not locate the database service name or net service name specified in the directory server.
Action: Perform these steps:
  1. Verify that the database service or net service name entry exists in the directory that this computer was configured to use.

    See Also:

    Oracle Internet Directory Administrator's Guide for directory setup instructions
  2. Verify that the sqlnet.ora file includes the following entry:

    NAMES.DIRECTORY_PATH=(ldap, other_naming_methods)
    

你可能感兴趣的:(ORA-12154: TNS:could not resolve service name无法解析指定的连接标志符)