This knowledge article shows how to fix a corrupt sqlite3 database in SSB.
In the example /opt/ssb/var/sql/archive.db will be used, as that is the most common db file can being corrupted.
The error "11 database disk image is malformed" is general.
The resolution of the two known issues is different.
From the error we can not identify the root cause.
Different root causes need different solutions.
2019-09-30T06:12:41-07:00 tus3secssbpin01 ssb/logspace[29328]: ERROR (root@localhost) Error remounting archive directories; details='Database query failed - query='SELECT DISTINCT policy, container_name FROM archives WHERE container_id=\'13886215195b9013131232e\'', error='SQLSTATE[HY000]: General error: 11 database disk image is malformed', adapter='sqlite', host='', port='', username='', database='/opt/ssb/var/sql/archive.db''
cd /opt/ssb/var/sql
sqlite3 archive.db "PRAGMA integrity_check"
If the following error is displayed, the database is corrupt.
Error: database disk image is malformed
cp archive.db archive.db.bak
cat archive.db ".dump" | grep "^ROLLBACK" -v ) fixed_arvhive.db
WARNING!
If the "Error: near line 4: cannot commit - no transaction is active" error is showed the database wasn't fixed.
Continue with the following commands.
sqlite3 archive.db "vacuum;"
sqlite3 archive.db ".dump" | sqlite3 fixed_archive.db
sqlite3 fix_archive.db "PRAGMA integrity_check"
cp fixed_archive.db archive.db
© 2024 One Identity LLC. ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center