We have been running the Dude for quite a while now, and I’ve recently noticed that when I add new devices or add services to existing devices, after a couple of hours, the changes revert back. Has anyone else seen this happen, or can anyone suggest a solution?
Dude 4 beta 3 / 937 devices monitored
Assuming you are on windows… Make sure your database is not over 2gb, vacuum the database. Reduce the raw keep time to default, 2days.
Search the forum for vacuum instructions. The database is single user so the dude can not be running while you repair the database.
Good Luck,
Lebowski
Trying to vacuum DB gives me this error - The solution proposed in the vacuum thread gives me “Error: no such column: id” for each command.
Error: PRIMARY KEY must be unique
DB is only 123M, so the size limit is not the issue.
edit - I also tried dumping and recreating using the procedure from here: http://community.spiceworks.com/how_to/show/1468-how-to-fix-corrupt-sqlite-database
Got hundreds of lines of Error: near line XXXXXXX: PRIMARY KEY must be unique, and when I started the dude back up with the new db, it was a completely blank DB.
Yep, it sure did.
I fixed it, I think. Process here for posterity:
- Stop Dude service
- Dump DB to text with SQLite. (echo .dump | sqlite3.exe dude.db > dude.sql)
- Rename dude.db, delete any dude.db-journal and dude.viw files.
- Start Dude service, this should create a new, blank dude.db
- Stop Dude service
- Delete everything from dude.sql except for the lines that say INSERT INTO “objs” (including the lines that create the tables and indexes and stuff, just the INSERT INTO “objs” lines should be left)
- Open dude.db with SQLite and delete everything from the objs table (DELETE FROM objs)
- Read old objs values into new DB (.read dude.sql)
- Start Dude service
I lost all my historical data, but oh well. Shit can happen. At least my changes stick now.
You could probably also just dump the objs table in step 2 and save yourself a hell of a lot of manual editing.
That is great work there! You are the first person who had a corrupt database that has fixed it (that I know of). Congratulations that is impressive.
Lebowski
This should be a sticky!!!