"Failed to connect to database: ODBC error: (08004)" error in vpxd.log in vCenter Server
search cancel

"Failed to connect to database: ODBC error: (08004)" error in vpxd.log in vCenter Server

book

Article ID: 328104

calendar_today

Updated On:

Products

VMware

Issue/Introduction

Symptoms:
In the vpxd.log file, there are entries similar to:

2016-11-24T15:06:33.141Z info vpxd[7FE6E78537A0] [Originator@6876 sub=vpxdVdb] [VpxdVdb::SetDBType] Logging in to DSN: VMware VirtualCenter with username VPXADMIN
2016-11-24T15:06:33.170Z info vpxd[7FE6E78537A0] [Originator@6876 sub=vpxdVdb] [VpxdVdb::SetDBType] Logging in to DSN: VMware VirtualCenter with username VPXADMIN
2016-11-24T15:06:33.198Z error vpxd[7FE6E78537A0] [Originator@6876 sub=vpxdVdb] [VpxdVdb::SetDBType] Failed to connect to database: ODBC error: (08004) - [unixODBC][Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve the connect identifier specified
.
.
.
Services start up shows failure of Inventory Service to start:
Stdout = Starting VMware Inventory Service...
Waiting for VMware Inventory Service.................
WARNING: VMware Inventory Service may have failed to start.

The vpxd.log file is located at:
  • Windows installed vCenter Server 6.5: %ALLUSERSPROFILE%\VMWare\vCenterServer\logs\vmware-vpx\
  • vCenter Server Appliance: /var/log/vmware/vmware-vpx/
Note: This log excerpt is an example. Date, time, and environmental variables may vary depending on your environment.



Cause

This issue occurs when the connection identifier cannot be resolved using the configured naming method.

For example:

Using net service name that cannot be found in a naming method repository, or the repository could not be located or reached.

Resolution

The ORA-12154 error is a common error relating to the local copy of the tnsnames.ora file, listener configuration, and the database name aliases that support the vCenter Server Oracle Database.

To resolve this issue, ensure the following:

  • Ensure that the listener is listening for the same service name
    1. The service name might have an alias, open the $ORACLE_HOME/network/admin/tnsnames.ora file and search for global (world) entries and local entries.
    2. Run this command to check the global_name setting:

      select * from global_name;

      The query value should match the init.ora parameters for db_name and db_domain.

    3. If the global_name does not match, run this command to correct it:

      alter database rename global_name to new_name;
  • Ensure that the database configuration is correct
    • Ensure that TNSNAMES is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).
    • Ensure that the TNSNAMES.ORA file exists in the proper directory and is accessible.
    • Check that the net service name used as the connect identifier exists in the TNSNAMES.ORA file.
    • Ensure sure there are no syntax errors anywhere in the TNSNAMES.ORA file. Search for unmatched parentheses or stray characters.

  • If using directory naming ensure that
    1. LDAP is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).
    2. The LDAP directory server is up and that it is accessible.
    3. The net service name or database name used as the connect identifier is configured in the directory.
    4. The default context being used is correct by specifying a fully qualified net service name or a full LDAP DN as the connect identifier
  • If using easy connect naming ensure that
    1. EZCONNECT is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).
    2. The host, port and service name specified are correct.
    3. Try enclosing the connect identifier in quotation marks.
  • Also ensure on the vCenter Server:


Additional Information

vCenter Server installation fails with ODBC and DSN errors