0 like 0 dislike
asked by (1.1k points)  
Because it use a lot of my space on my server

Please log in or register to answer this question.

1 Answer

0 like 0 dislike
answered by (1.1k points)  

Don't delete the xlog files  it's need at the time of instance crashes​  if the system crashes, the database can be restored to consistency by "replaying"the log entries made since the last checkpoint.  and  used for immediate​ recovery so better tar  and move the archive files if archive directory having individual partition

For example if you moved archive Means you will get Free space at  archive partition in this moment you will get free space archive partition then archiver archived the xlog files to archive partition so you will get free space at xlog directory as well as data directory

Before moving archives switch the xlog

Before postgresql 10:

select pg_switch_xlog();

after Postgresql 10:

 select pg_switch_wal();

Following script will be helpful to moving Archive to Backup location


After moving everything if you don't want to  issue again you have to change the following parameter:

archive_timeout: reduce of a minute or so are usually reasonable. You should consider using streaming replication, instead of archiving, if you want data to be copied off the master server more quickly than that. 

checkpoint_timeout : reduce the checkpoint time but you have to mind one thing if you reduce the check point time you will get performance issue and data will not be more loss


Related questions

0 like 0 dislike
2 answers