Use logging

Specifying the -z database server option displays diagnostic communication messages, and other messages to the database server messages window for troubleshooting purposes. These messages can help you diagnose how a connection is failing and what connection parameters are used for the connection attempt, as well as identify what communication links are being used.