15 Upgrading to numeric values of extended range

Overview

Since Zabbix 5.0, numeric (float) data type supports precision of approximately 15 digits and range from approximately -1.79E+308 to 1.79E+308. The old numeric type was disabled but still supported. As of Zabbix 6.4, it was deprecated, and starting with Zabbix 7.0, it has been fully removed.

If your installation has not been upgraded to use numeric values of extended range, the following warning is displayed in ReportsSystem information: "Database history tables upgraded: No. Support for the old numeric type is deprecated. Please upgrade to numeric values of extended range".

When upgrading to Zabbix 7.0, the following databases are upgraded automatically:

  • MySQL
  • PostgreSQL/TimescaleDB (without compression)
  • Oracle

However, for Oracle, older MySQL versions, and large installations, it is recommended to upgrade the data type manually before upgrading to Zabbix 7.0. For instructions, see MySQL, PostgreSQL/TimescaleDB (without compression), Oracle.

If using TimescaleDB with compression, the database must be upgraded manually before upgrading to Zabbix 7.0. For instructions, see TimescaleDB (with compression).

Since Zabbix 7.0, manually upgrading tables to primary keys also upgrades the tables to use double precision data types. For instructions on upgrading to primary keys, see Database upgrade to primary keys.

MySQL, PostgreSQL/TimescaleDB (without compression), Oracle

The upgrade patch alters data columns of history and trends tables, which usually contain lots of data; for this reason, the upgrade may take some time to complete. The exact estimate cannot be predicted and depends on server performance, database management system configuration and version. Therefore, it is recommended to first test the patch outside the production environment. For example, with MySQL 8.0 and MariaDB 10.5 (default configuration), the patch is known to be executed instantly for large tables due to efficient algorithm and the fact that previously the same double type was used but with limited precision, meaning that data itself does not need to be modified.

To upgrade MySQL, PostgreSQL/TimescaleDB (without compression), or Oracle before upgrading to Zabbix 7.0:

1. Stop Zabbix server.

2. Back up your database.

3. Run the appropriate patch (SQL file) for your Zabbix 6.4 database:

Run the scripts for the server database only. The proxy will not benefit from this upgrade.

  • /usr/share/zabbix-sql-scripts/mysql/double.sql
  • /usr/share/zabbix-sql-scripts/postgresql/double.sql (for PostgreSQL/TimescaleDB)
  • /usr/share/zabbix-sql-scripts/oracle/double.sql

If using sources, see the MySQL, PostgreSQL/TimescaleDB, or Oracle patch for Zabbix 6.4 in Zabbix GIT repository.

4. Start Zabbix server.

5. Update or set the $DB['DOUBLE_IEEE754'] parameter value to true in /ui/conf/zabbix.conf.php.

TimescaleDB (with compression)

To upgrade TimescaleDB (with compression) before upgrading to Zabbix 7.0:

1. Disable TimescaleDB compression in Zabbix frontend.

2. Reload Zabbix server configuration cache using runtime control: zabbix_server -R config_cache_reload

3. Stop Zabbix server.

4. Back up your database.

5. Run the appropriate patch (SQL file) for TimescaleDB:

  • /usr/share/zabbix-sql-scripts/postgresql/double.sql

If using sources, see the PostgreSQL/TimescaleDB patch for Zabbix 6.4 in Zabbix GIT repository.

6. Start Zabbix server.

7. Update or set the $DB['DOUBLE_IEEE754'] parameter value to true in /ui/conf/zabbix.conf.php.