Fortinet black logo

CLI Reference

sql-local

sql-local

Use these commands to remove the SQL database and logs from the FortiManager system and to rebuild the database and devices:

sql-local rebuild-adom

sql-local rebuild-adom

sql-local rebuild-adom

sql-local remove-db

sql-local remove-logs

When rebuilding the SQL database, new logs will not be available until the rebuild is complete. The time required to rebuild the database is dependent on the size of the database. Please plan a maintenance window to complete the database rebuild. You can use the diagnose sql status rebuild-db command to display the SQL log database rebuild status.

The following features will not be available until after the SQL database rebuild has completed: FortiView, Log View, Event Management, and Reports.

sql-local rebuild-adom

Rebuild the log SQL database from log data for particular ADOMs.

Syntax

execute sql-local rebuild-adom

Variable

Description

<adom>

The ADOM name. Multiple ADOM names can be entered.

sql-local rebuild-db

Rebuild the entire local SQL database. This operation will remove the SQL database and rebuild from log data. This operation will also reboot the device.

Syntax

execute sql-local rebuild-db

sql-local rebuild-index

Rebuild the index from log data for particular ADOMs.

Syntax

execute sql-local rebuild-index

Variable

Description

<adom>

The ADOM name. Multiple ADOM names can be entered.

<start-time>

The start date and time of the rebuild ( a time stamp, or in the format: yyyy-mm-dd hh:mm:ss).

<end-time>

The end date and time of the rebuild (a timestamp, or in the format: yyyy-mm-dd hh:mm:ss).

sql-local remove-db

Remove entire local SQL database.

Syntax

execute sql-local remove-db

sql-local remove-logs

Remove SQL logs within a time period.

Syntax

execute sql-local remove-logs <Device ID>

Variable

Description

<Device ID>

Enter the device ID. Example: FG300A3907552101

sql-local

Use these commands to remove the SQL database and logs from the FortiManager system and to rebuild the database and devices:

sql-local rebuild-adom

sql-local rebuild-adom

sql-local rebuild-adom

sql-local remove-db

sql-local remove-logs

When rebuilding the SQL database, new logs will not be available until the rebuild is complete. The time required to rebuild the database is dependent on the size of the database. Please plan a maintenance window to complete the database rebuild. You can use the diagnose sql status rebuild-db command to display the SQL log database rebuild status.

The following features will not be available until after the SQL database rebuild has completed: FortiView, Log View, Event Management, and Reports.

sql-local rebuild-adom

Rebuild the log SQL database from log data for particular ADOMs.

Syntax

execute sql-local rebuild-adom

Variable

Description

<adom>

The ADOM name. Multiple ADOM names can be entered.

sql-local rebuild-db

Rebuild the entire local SQL database. This operation will remove the SQL database and rebuild from log data. This operation will also reboot the device.

Syntax

execute sql-local rebuild-db

sql-local rebuild-index

Rebuild the index from log data for particular ADOMs.

Syntax

execute sql-local rebuild-index

Variable

Description

<adom>

The ADOM name. Multiple ADOM names can be entered.

<start-time>

The start date and time of the rebuild ( a time stamp, or in the format: yyyy-mm-dd hh:mm:ss).

<end-time>

The end date and time of the rebuild (a timestamp, or in the format: yyyy-mm-dd hh:mm:ss).

sql-local remove-db

Remove entire local SQL database.

Syntax

execute sql-local remove-db

sql-local remove-logs

Remove SQL logs within a time period.

Syntax

execute sql-local remove-logs <Device ID>

Variable

Description

<Device ID>

Enter the device ID. Example: FG300A3907552101