FortiManager
FortiManager supports network operations use cases for centralized management, best practices compliance, and workflow automation to provide better protection against breaches.
amills
Staff
Staff
Article Id 191308
Description
Occasionally 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.

Scope
FortiManager with FAZ feature enabled.

Solution
Remove 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.

Contributors