Re: Freeing logical logs (log usage script)
Posted in 1996
Topics: Performance & Tuning, Stored Procedures & SPL, Server Administration, Logging & Checkpoints
Barry Lemrow wrote to Jason Fry:
:
: I seem to remember a side issue in a recent INFORMIX Performance Tuning class.
: One of the other students mentioned a situation similar to yours. The response
: given by the instructor was that this is a recent change to OnLine to allow
: ONLOG the ability to look back at these files. The logs will be marked free
: when the system needs to use them. Apparently this is documented in the "New
: Features Guide", since I am on the road, I don't have mine with me to verify.
This is correct. The following script will let you see which logs are free. You
will need to strip off the first two characters on each line and set the
environment variables INFORMIXDIR and INFORMIXSERVER appropriately. It uses
dbaccess for the sql.
# #!/bin/sh
# #
# # logusage: Displays the logical log usage for Online 7 similar to
# # Online 5. The envionment variables INFORMIXDIR and
# # INFORMIXSERVER must be supplied to the script.
# #
# INFORMIXDIR=/usr/informix; export INFORMIXDIR
# INFORMIXSERVER=xxxxxx; export INFORMIXSERVER
# #
# echo 'Logical Log Usage for '${INFORMIXSERVER}
# date
# ## # execute the query
# $INFORMIXDIR/bin/dbaccess sysmaster - <<! 2>/dev/null
# select number log, uniqid, size, used, (used/size*100) percent_used
# from sysmaster@${INFORMIXSERVER}:syslogs
# where uniqid >=
# (select min(tx_loguniq)
# from sysmaster@${INFORMIXSERVER}:systrans where tx_loguniq > 0)
# union
# select number log, uniqid, size, 0, 0.00 percent_used
# from sysmaster@${INFORMIXSERVER}:syslogs
# where uniqid <
# (select min(tx_loguniq)
# from sysmaster@${INFORMIXSERVER}:systrans where tx_loguniq > 0);
# !
# #
# exit 0
The 'standard out' file looks like:
Logical Log Usage for xxxxxx
Thu Mar 7 16:18:47 CST 1996
log uniqid size used percent_used
27 5825 2500 0 0.00
28 5826 2500 0 0.00
29 5827 2500 2344 93.76
30 5728 2500 0 0.00
31 5729 2500 0 0.00
--
Chuck Johnson
DBA
Sprint North Supply
chuck.johnson@nsc.sprint.com