Page 1 of 1

Corrupted Stats table (dropped - need to recreate?) [SOLVED]

Posted: Tue Apr 09, 2024 3:01 am
by SkippyDo
Zoneminder 1.36.33
Debian 11

Zoneminder decided to puke on me. Poking around I found that the ZM "Stats" table was corrupted such that any administrative functions on it would result in DB timeouts. Nothing I could do would resolve. Sadly, ALL of my backups had managed to be taken with this corrupted table- ALL gnu-zipped database dumps were corrupted (unable to unzip).

All tables checked fine except this one. On a gamble I dropped the Stats table and Zoneminder is now functional. Do I need the Stats table? If so, how can I recreate it?

Thanks!

Re: Corrupted Stats table (dropped - need to recreate?)

Posted: Tue Apr 09, 2024 9:07 am
by dougmccrary
Pretty sure you can just run zmupdate.pl
It reads the db and adds, renames or deletes tables to match the present version.

Re: Corrupted Stats table (dropped - need to recreate?)

Posted: Tue Apr 09, 2024 1:35 pm
by iconnor
You can likely do without it, but you will want to turn off trying to write to it under Options->Logging->RECORD_EVENT_STATS

You can find the table definitions in /usr/share/zoneminder/db/zm_create.sql

Re: Corrupted Stats table (dropped - need to recreate?)

Posted: Tue Apr 09, 2024 3:30 pm
by SkippyDo
Awesome! Many thanks for the replies. (I have disabled the logging as it's really of no use to me and has, obviously, caused problems.)