Okay I uploaded the scripts to the file storage you can find the here:
These are scripts written for personal use so you may have to modify them to suit your purposes, but they will likely save you a couple hours of futzing.
magic numbers are at the top of the files, edit them to taste.
The replacement for ns_db:
http://sdm.openacs.org/new-file-storage/one-file?file_id=461
The log parser
http://sdm.openacs.org/new-file-storage/one-file?file_id=462
The query analyzer
http://sdm.openacs.org/new-file-storage/one-file?file_id=463