manual:appendix:install:db_scripts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:appendix:install:db_scripts [2019/01/25 10:14]
martins-v some rewording
manual:appendix:install:db_scripts [2020/03/06 08:07] (current)
martins-v fixing link target
Line 13: Line 13:
 UTF-8 is the only encoding supported by Zabbix. It is known to work without any security flaws. Users should be aware that there are known security issues if using some of the other encodings. UTF-8 is the only encoding supported by Zabbix. It is known to work without any security flaws. Users should be aware that there are known security issues if using some of the other encodings.
 === MySQL === === MySQL ===
 +
 +Character set utf8 and utf8_bin collation is required for Zabbix server to work properly with MySQL database.
  
   shell> mysql -uroot -p<​password>​   shell> mysql -uroot -p<​password>​
Line 48: Line 50:
 </​note>​ </​note>​
  
-=== Timescale DB ===+=== TimescaleDB ​===
  
-Experimantal support ​of Timescale DB has been added in Zabbix 4.2.0.+Support ​of TimescaleDB ​has been added on **experimental** basis in Zabbix 4.2.0.
  
-<note warning>Timescale DB is supported ​with Zabbix ​server only.</​note>​+<note warning>Currently TimescaleDB ​is not supported ​by Zabbix ​proxy.</​note>​
  
-The ''​timescaledb.sql''​ script is located in database/​postgresql ​(along with regular schema.sql, images.sql, data.sql). The script must be run after the regular PostgreSQL database has been created:+We assume that TimescaleDB extension has been already installed on the database ​server ​(see [[https://​docs.timescale.com/​latest/​getting-started/​installation|installation instructions]]).
  
-  cat timescaledb.sql | sudo -u zabbix psql zabbix+TimescaleDB extension must also be enabled for the specific DB by executing:
  
-The script assumes that TimescaleDB extension has been already installed in the database ([[https://​docs.timescale.com/​v1.1/​getting-started/​installation|installation instructions]]). ​+  echo "​CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;" ​sudo -u postgres psql zabbix
  
-TimescaleDB extension should also be enabled for the specific DB by executing:+Running this command requires database administrator privileges. ​
  
-  ​echo "​CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"​ | sudo -u postgres psql zabbix+<​note>​If you use a database schema other than '​public'​ you need to add a SCHEMA clause to the command above. E.g.:\\ ''​echo %%"%%CREATE EXTENSION IF NOT EXISTS timescaledb ​SCHEMA yourschema ​CASCADE;%%"%% | sudo -u postgres psql zabbix''</​note>​
  
-Running this command requires DB admin privileges+The ''​timescaledb.sql''​ script is located in database/​postgresql. The script must be run after the regular PostgreSQL database has been created with initial schema/data (see section above):
  
 +  cat timescaledb.sql | sudo -u zabbix psql zabbix
 +
 +//Note// that the ''​timescaledb.sql''​ script sets the following housekeeping parameters (from //​Administration//​ -> //General// -> //​Housekeeping//​):​
 +
 +  * Override item history period
 +  * Override item trend period
 +
 +In order to use partitioned housekeeping for history and trends both these options must be enabled. It's possible to use TimescaleDB partitioning only for trends (by setting //Override item trend period//) or only for history (//Override item history period//).
 +
 +<note tip>You may want to run the timescaledb-tune tool provided by TimescaleDB to optimize PostgreSQL configuration parameters in your ''​postgresql.conf''​.</​note>​
 === Oracle === === Oracle ===
  
Line 86: Line 98:
   sqlplus> @images.sql   sqlplus> @images.sql
   sqlplus> @data.sql   sqlplus> @data.sql
-  ​+ 
 +<note tip>​Please set the initialization parameter CURSOR_SHARING=FORCE for best performance.</​note>​ 
 Now the temporary directory can be removed: Now the temporary directory can be removed:
  
   shell> ssh [email protected]_host "rm -rf /​tmp/​zabbix_images"​   shell> ssh [email protected]_host "rm -rf /​tmp/​zabbix_images"​
- 
 === IBM DB2 === === IBM DB2 ===