Checking the Oracle network name services
Ensure the creation of the database instance according to chapter Creation of a database beforehand. The listener must be running to verify a successful name resolution.
In the command line it can be checked whether the local name resolution works for the database instance as follows. Send a test query to the listener of the database instance:
tnsping imadb1
The output should be presented as follows:
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 17-JUN-2020 09:43:36
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/19.0.0/dbhome_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oracle)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ima9)))
OK (0 msec)
The output has to end with status “OK” and the duration of the transmission.
If the configured name resolution is wrong, however, an output as follows appears:
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 17-JUN-2020 09:44:16
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/19.0.0/dbhome_1/network/admin/sqlnet.ora
TNS-03505: Failed to resolve name
In this case the connection to the database will also fail.
In the case of problems with the configuration of the Oracle Network Listeners and the Name Services, consult the Oracle documentation that is delivered with the database software. You’ll find comprehensive advice there on the installation and configuration of databases in a network.