Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux:monitoring:zabbix:database:postgresql:partitioning [2020/03/31 12:04] jlucas |
linux:monitoring:zabbix:database:postgresql:partitioning [2020/04/02 08:20] (current) jlucas [Dump individual Zabbix database tables for testing] |
||
---|---|---|---|
Line 41: | Line 41: | ||
====Dump the entire Zabbix DB==== | ====Dump the entire Zabbix DB==== | ||
- | Use this to dump the entire Zabbix database | + | dump the entire Zabbix database |
- | sudo su _postgresql | ||
pg_dump -U zabbix zabbix | gzip -1 > ./ | pg_dump -U zabbix zabbix | gzip -1 > ./ | ||
- | ===Triggering the Zabbix install screen=== | ||
- | Initial install & configuration instructions: | ||
- | https:// | ||
+ | pg_dump -U postgres postgres | psql -U zabbix zabbix | ||
- | Testing... | + | ====Dump individual Zabbix database tables for testing==== |
- | The history table is by far the largest | + | The following use of pg_dump and pg_restore performs a data-only backup using the custom-form output option and using INSERTs instead of COPY statements: |
- | pg_dump -U zabbix -t history_uint | + | pg_dump -U zabbix |
+ | Once the backup is done, drop all data from the table: | ||
+ | psql -U zabbix -c ' | ||
+ | Now restore the data to the table: | ||
+ | gunzip -c zabdb.zabbix.history_str.Pg.gz | pg_restore -U zabbix -d zabbix |