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, what connection parameters are used for the connection attempt, and what communication links are being used.