LAST ACCESS control
Posted in 2019
Topics: General Discussion
Hi,
I am having some problems to identify last access on my databases;
I am trying with:
oncheck -pT to know last disk access;
or with
select max(ustlowts) form systables.
But, I have some doubts about these results, is this correct? is there any
other way to know when the last connection was made? other than through the
logs as we don't use them?
Thanks for any help,
SP
I am not clear about what you're trying to achieve here. You suggest using:
select max(ustlowts) from systables
The above shows the last time UPDATE STATISTICS (LOW) ran for a table, not
sure that is what you want. I guess this could sort of work if you have
AUTO_STAT_MODE 1 and STATCHANGE 0 preventing statistics being updated on
tables with no changes.
Some methods you could use:
1. For updates look for entries in the logical log using the 'onlog' tool,
assuming the db is logged. You'll need to know the table part number in hex
for this.
2. Create a public.sysdbopen procedure to record connections (or audit STSN
event).
3. Use onaudit to record table access events such as ACTB, INRW, UPRW, DLRW
etc.
4. Use database triggers.
Ben.