What is pg_xlog_ar​chive and how do I control what is in it?

The pg_xlog_archive is growing by leaps and bounds.  All I know, cause of The Google, is that it is like an archive direcotory is to Oracle.  How to clean it up and keep it just with what files it needs?
 

We are running DP 8.1 on HP-UX 11.31 and the new DP is apparently creating all of these.

  • Verified Answer

    The pg_xlog_archive is part of the DP IDB.  

     

    The IDB runs in archive mode. The Write Ahead Logs - short WAL, the transaction
    logs - are located in (DP_DATA_DIR\server\db80\pg\) pg_xlog. They are
    archived in pg_xlog_archive

     

    I found a lab case that talked about how to remove un-needed archive logs

     

    an archive log is stored in pg_xlog while it is in use. Therefore you cannot delete any archive in pg_xlog.

    Once the log is full it gets archived to folder pg_xlog_archive.

     


    If you want to clean up the pg_xlog_archive, you just have to run an IDB backup. This will by default remove all archived logs.

    There’s an advanced option to “Delete backup up archive log files”, which is checked by default (see attached screenshot).

     


  • Bob_Clark wrote:

    The pg_xlog_archive is part of the DP IDB.  

     

    The IDB runs in archive mode. The Write Ahead Logs - short WAL, the transaction
    logs - are located in (DP_DATA_DIR\server\db80\pg\) pg_xlog. They are
    archived in pg_xlog_archive

     

    I found a lab case that talked about how to remove un-needed archive logs

     

    an archive log is stored in pg_xlog while it is in use. Therefore you cannot delete any archive in pg_xlog.

    Once the log is full it gets archived to folder pg_xlog_archive.

     


    If you want to clean up the pg_xlog_archive, you just have to run an IDB backup. This will by default remove all archived logs. There’s an advanced option to “Delete backup up archive log files”, which is checked by default (see attached screenshot).

     


    We do an IDB backup daily with the Delete backup option checked.  Apparently no log files have been removed though since we have moved to 8.1.

    Interesting... just ran one manually and it cleared all 421 files we had in the dir.

    Wonder why it isn't doing it when we have it scheduled.  Does it have to run all by itself?

  • Not according to anything I am aware of.  The iDB Backup job should run the same, whether Interactive or Scheduled