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

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
SkippyDo
Posts: 227
Joined: Mon Nov 20, 2017 6:49 pm

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

Post 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!
Last edited by SkippyDo on Tue Apr 09, 2024 3:31 pm, edited 1 time in total.
dougmccrary
Posts: 1322
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

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

Post 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.
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

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

Post 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
SkippyDo
Posts: 227
Joined: Mon Nov 20, 2017 6:49 pm

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

Post 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.)
Post Reply