How to extract information from listener.log?

The listener.log contains useful information for example hosts that connect to a database, frequency of connections, remote OS User which can be used in cases to determine when an instance is being moved to another server to identify the impact of the change.

So using a script the contents can be parsed, the example below is a simple case so depending on the scenario it can be changed to customize to your needs.

# in this case the db name is TESTDB and the scenario there were connections through JDBC so the value of host field varied
# the script assumes “(” as a separator and prints unique hostnames
$ grep -i testdb listener.log | grep -v service_update | awk -F'(‘
‘{if($6==”HOST=__jdbc__)”)
print $10
else
print $6}’ | sort -u

HOST=CAL-GLIDDON)
HOST=CAL-JTURNBULL)
HOST=CAL_LGLAZ)
HOST=callocdb02)
HOST=calora1db01d)
HOST=calora2db01d)
HOST=calora4db01d)
HOST=calora5db01q)
HOST=calwebdbdev01)
USER=))
USER=oracle))

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.