DescriptionOccasionally an upgrade does not correctly update the SQL database and reporting will cease to function properly due to missing/misnamed columns and/or indexes.
“exec sql-local rebuild-db” is the first option, but if that does not resolve the issue then deleting and rebuilding the database is the next step.
ScopeFortiManager with FAZ feature enabled.
SolutionRemove and re-create the SQL db:
1) Turn off faz-status
config system global
set faz-status disable
end
[REBOOT]
2) Disable SQL and remove the current database
config system sql
set status disable
end
execute sql-local remove-db
3) Re-enable SQL
config system sql
set status local
end
4) Turn on faz-status
config system global
set faz-status enable
end
[REBOOT]
5) Rebuild database:
exec sql-local rebuild-db
[REBOOT]
Notes:
(1) Although this procedure does not remove any log files it is recommended to backup log files beforehand as a precaution.
(2) The rebuild-db command causes the unit to reboot and the rebuild starts when the unit comes back up.
(3) Use the command 'diag sql status rebuild-db' to show the status of the rebuild.
(4) The time required to rebuild the database depends on the amount of logs stored on the unit.