Hi. I need to trace on Unix level number of connections to an Oracle database. The listener runs on port 1521.
The following is run:
oracle@server03 >lsof -Pni |grep ".1521" |grep IPv4 | awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1
87 IPv4
oracle@server03 >
I need to append these values into a text file every 5 mins through cron. That part works. The problem I am having is getting rid of the "IPv4" string. I just need number of connections and nothing else:
87
88
87
How do I change the statement so it only returns the numbers?
Thanks.