Community discussions

MikroTik App
 
0ldman
Forum Guru
Forum Guru
Topic Author
Posts: 1465
Joined: Thu Jul 27, 2006 5:01 am

Recovering the Dude after db corruption.

Wed Jan 10, 2018 1:15 am

The directions on the wiki don't work. It looks like the tools have been updated and the commands are different now.

https://wiki.mikrotik.com/wiki/Manual:T ... _db_repair

I poked around at it until I figured it out. Database repair is a bit out of my skillset, so this took too long.

These directions work with sqlite-tools-win32-x86-3210000.

Download sqlite from here, unzip to where ever you tend to put files you work with temporarily. I used my desktop.

https://www.sqlite.org/download.html

Copy the dude.db from the file folder in your routerboard to the same fold you've extracted sqlite3. Best to rename the dude.db to dude.orig.db so you won't have to change it later when you copy the newly created file back from the router.

sqlite3.exe dude.orig.db
.output objs.sql
.dump
.exit

Delete dude.db from the routerboard, start the dude back up to create a new, blank dude.db file. Copy that to the same folder you were working with previously.

sqlite3.exe dude.db
pragma integrity_check
delete from objs;
.read objs.sql
.quit
 
User avatar
amt
Long time Member
Long time Member
Posts: 529
Joined: Fri Jan 16, 2015 2:05 pm

Re: Recovering the Dude after db corruption.

Tue Feb 06, 2018 12:39 pm

this is not worked for me.. can you explain more ? I could not do this, it gives me an error. did i made mistake ?
here is output;

C:\test2>sqlite3.exe dude.orig.db
SQLite version 3.21.0 2017-10-24 18:55:49
Enter ".help" for usage hints.
sqlite> .output objs.sql
sqlite> .dump
sqlite> .exit

C:\test2>sqlite3.exe dude.db
SQLite version 3.21.0 2017-10-24 18:55:49
Enter ".help" for usage hints.
sqlite> pragma integrity_check;
ok
sqlite> delete from objs;
sqlite> .read objs.sql
Error: near line 3: table objs already exists
Error: near line 8320: table outages already exists
Error: near line 55843: table chart_values_raw already exists
Error: near line 1607798: UNIQUE constraint failed: chart_values_raw.sourceIDand
Time
Error: near line 1607946: UNIQUE constraint failed: chart_values_raw.sourceIDand
Time
Error: near line 1607948: table chart_values_10min already exists
Error: near line 23445783: table chart_values_2hour already exists
Error: near line 32580225: UNIQUE constraint failed: chart_values_2hour.sourceID
andTime
Error: near line 32580227: table chart_values_1day already exists
Error: near line 34018504: index outages_idx_serviceID_time already exists
Error: near line 34018505: index outages_idx_deviceID_time already exists
Error: near line 34018506: index outages_idx_mapID_time already exists
sqlite> .quit

C:\test2>


after finish this job objs.sql created and nearly 2.2gb . what should i do after this job ? dude.orig and dude database files still in same folder. which file should i use ?
 
User avatar
amt
Long time Member
Long time Member
Posts: 529
Joined: Fri Jan 16, 2015 2:05 pm

Re: Recovering the Dude after db corruption.

Wed Feb 07, 2018 11:49 am

anyone to help ?_
 
eriitguy
Member Candidate
Member Candidate
Posts: 197
Joined: Thu Jan 26, 2017 1:16 pm

Re: Recovering the Dude after db corruption.

Wed Feb 07, 2018 5:48 pm

Hello, amt!

Did you try to ask support from Mikrotik?
normis sometime mention that they may not read all forum topics.

Thank you!
 
User avatar
amt
Long time Member
Long time Member
Posts: 529
Joined: Fri Jan 16, 2015 2:05 pm

Re: Recovering the Dude after db corruption.

Thu Feb 08, 2018 8:29 am

Hello eriitguy,

Yes I asked to support but I think they are so busy,they not answer me yet.

Thank you
 
User avatar
mac86
Member Candidate
Member Candidate
Posts: 124
Joined: Sat Nov 25, 2006 12:52 am
Location: bahia blanca - argentina
Contact:

Re: Recovering the Dude after db corruption.

Thu Mar 28, 2019 3:50 am

I've fixed my dude db with

https://wiki.mikrotik.com/wiki/Manual:T ... _db_repair

thank you!

Who is online

Users browsing this forum: No registered users and 5 guests