FortiSIEM
FortiSIEM provides Security Information and Event Management (SIEM) and User and Entity Behavior Analytics (UEBA)
Andy_G
Staff
Staff
Article Id 198377

Description
This article describes how to empty Postgresql logs in order to save space on the disk. 
Solution

Here is a step by step guide: 

1. Login as root user and shutdown all the processes on FortiSIEM before proceeding. See the related KB article "How to fully shutdown FortiSIEM".

2. Enter the following command in the Supervisor: 

Version 3.X

/usr/bin/pg_controldata /cmdb/data/ 

Version 4.X 

/cmdb/data/global/pg_controldata /cmdb/data

Output should look something like that: 

pg_control version ner:            833

Catalog version number:               200711281

Database system identifier:           5895752525429993407

Database cluster state:               shut down

pg_control last modified:             Thu 22 Aug 2013 12:35:29 PM PDT

Latest checkpoint location:           1/1D4103B0

Prior checkpoint location:            1/1D3C22C0

Latest checkpoint's REDO location:    1/1D4103B0us

Latest checkpoint's TimeLineID:       1

Latest checkpoint's NextXID:          0/288493

Latest checkpoint's NextOID:          20449

Latest checkpoint's NextMultiXactId:  1

Latest checkpoint's NextMultiOffset:  0

Time of latest checkpoint:            Thu 22 Aug 2013 12:35:29 PM PDT

Minimum recovery ending location:     0/0

Maximum data alignment:               8

Database block size:                  8192

Blocks per segment of large relation: 131072

WAL block size:                       8192

Bytes per WAL segment:                16777216

Maximum length of identifiers:        64

Maximum columns in an index:          32

Maximum size of a TOAST chunk:        1996

Date/time type storage:               floating-point numbers

Maximum length of locale name:        128

LC_COLLATE:                           en_US.UTF-8

LC_CTYPE:                             en_US.UTF-8

Make note of the following in the above output:

Latest checkpoint's NextXID:          0/288493

Latest checkpoint's NextOID:          204492

3. Enter the NEXTXID and NextOID values  in pg_resetxlog to clean up Postgresql logs. 

Version 3.X

# sudo -u postgres /usr/bin/pg_resetxlog -o 20449 -x 288493 -f /cmdb/data/

Transaction log reset

or 

Version 4.X 

# sudo -u postgres /usr/psql-9.1/bin/pg_resetxlog -o 20449 -x 288493 -f /cmdb/data/

Transaction log reset



Related Articles

Technical Note: [Accelops KB] How to fully Shutdown AccelOps

Contributors