13.35 PING
Syntax
PING [[LISTENER] connect_identifier]
Pings the database or database network listener to check availability. The PING
command will fail with an error if either the database or the network listener are unavailable. It indicates that either the network listener or the database needs to be restarted, or that the database connection is not usable and needs to be recreated.
PING
command is executed without a connect identifier, then a round-trip message is sent through the network listener to the currently connected database. When it is executed with a connect identifier, then a round-trip message is sent to the specified network listener to verify if it is able to handle the database connections.
Terms
LISTENER
Determines whether the target listener specified in the connect identifier is reachable and displays the total time taken for a round trip to ping the listener. This is similar to Oracle Database's TNSPING utility. The output also displays the location of the tnsnames.ora
file, if it is used.
connect_identifier
Refers to an Oracle Net connect identifier.
Examples
In the following example, the PING
command is executed to ping the database of the current connection:
PING
Ok (2.669 msec)
In the following example, the PING
command is executed to ping the network listener with the specified alias:
PING INST1
Network service name mapping file: /opt/oracle/tnsnames.ora
Attempting to contact: (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=cdb1_pdb1))(ADDRESS=(PROTOCOL=tcp)(HOST=host1.customer.domain.com)(PORT=1521)))
Ok (1.588 msec)
In the following example, the PING
command fails with an error message:
PING INST2
Local Net Naming configuration file: /opt/oracle/tnsnames.ora
Attempting to contact: (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=cdb1_pdb1))(ADDRESS=(PROTOCOL=tcp)(HOST=host1.customer.domain.com)(PORT=1521)))
SP2-1683: Ping failed with error TNS-12560.