• Home
  • Services
    • DBA Support
    • DBA Consultancy Services
    • PostgreSQL Support
    • Website Maintenance
  • Courses

    About Courses

    • List Of Courses
    • Become an Instructor
    Greenplum Database

    Greenplum Database

    $2,000.00 $1,500.00
    Read More
  • Company
    • FAQs
    • About Us
    • Contact
  • Events
  • Portfolio
  • Blogs
    • Blog – RayaFeeL
    • Blog – PostgreSQL Support
    • Blog – PostgreSQL Migration
    • Blog – All DB’s
    • Blog – Linux
    • Blog – Medical Coding
      • Cart

        0

    Have any question?
    (+91)8838953252
    ITsupport@rayafeel.com
    RegisterLogin
    RayaFeeL
    • Home
    • Services
      • DBA Support
      • DBA Consultancy Services
      • PostgreSQL Support
      • Website Maintenance
    • Courses

      About Courses

      • List Of Courses
      • Become an Instructor
      Greenplum Database

      Greenplum Database

      $2,000.00 $1,500.00
      Read More
    • Company
      • FAQs
      • About Us
      • Contact
    • Events
    • Portfolio
    • Blogs
      • Blog – RayaFeeL
      • Blog – PostgreSQL Support
      • Blog – PostgreSQL Migration
      • Blog – All DB’s
      • Blog – Linux
      • Blog – Medical Coding
        • Cart

          0

      Blog

      • Home
      • Blog
      • Blog
      • How to DELETE current XLOG / WAL LOG in postgresql database ?

      How to DELETE current XLOG / WAL LOG in postgresql database ?

      • Posted by Nijamutheen J
      • Categories Blog
      • Date August 19, 2019
      • Comments 0 comment

      Below are ours server , xlog & archive  details 

      PRIMARY / MASTER:
      ================
      
      postgres@tutorialdba_1:> ps -ef|grep postgres
      postgres   4436     1  0 Jun25 ?        00:05:04 /opt/10.6/bin/postgres -D /data
      postgres   4437  4436  0 Jun25 ?        00:00:00 postgres: logger process
      postgres   4439  4436  0 Jun25 ?        00:10:19 postgres: checkpointer process
      postgres   4440  4436  0 Jun25 ?        00:00:40 postgres: writer process
      postgres   4441  4436  0 Jun25 ?        00:04:55 postgres: wal writer process
      postgres   4442  4436  0 Jun25 ?        00:01:31 postgres: autovacuum launcher process
      postgres   4443  4436  0 Jun25 ?        00:00:27 postgres: archiver process   last was 00000001000000450000005E
      postgres   4444  4436  0 Jun25 ?        00:06:55 postgres: stats collector process
      postgres   4445  4436  0 Jun25 ?        00:00:02 postgres: bgworker: logical replication launcher
      postgres   4500  4436  0 Jun25 ?        00:05:07 postgres: wal sender process repmgr 53.99.98.119(44112) streaming 45/5FF3DB10
      
      XLOGS :
      
      postgres@tutorialdba_1:/xlog>
      -rw------- 1 postgres postgres 16777216 Jul 22 04:02 000000010000004500000096
      -rw------- 1 postgres postgres 16777216 Jul 22 04:01 000000010000004500000097
      -rw------- 1 postgres postgres 16777216 Jul 22 04:01 000000010000004500000098
      -rw------- 1 postgres postgres 16777216 Jul 22 04:01 000000010000004500000099
      -rw------- 1 postgres postgres 16777216 Jul 22 04:01 00000001000000450000009A
      -rw------- 1 postgres postgres 16777216 Jul 22 04:01 00000001000000450000009B
      drwx------ 2 postgres postgres    36864 Jul 22 05:01 archive_status
      
      
      
      XLOG STATUS :
      
      postgres@tutorialdba_1:/xlog/archive_status> ls -l
      total 0
      
      
      ARCHIVE LOGS:
      postgres@tutorialdba_1:/archive_log>
      -rw------- 1 postgres postgres 16777216 Jul 22 04:01 000000010000004500000059
      -rw------- 1 postgres postgres 16777216 Jul 22 04:02 00000001000000450000005A
      -rw------- 1 postgres postgres 16777216 Jul 22 04:02 00000001000000450000005B
      -rw------- 1 postgres postgres 16777216 Jul 22 04:02 00000001000000450000005C
      -rw------- 1 postgres postgres 16777216 Jul 22 04:02 00000001000000450000005D
      -rw------- 1 postgres postgres 16777216 Jul 22 04:02 00000001000000450000005E
      drwx------ 2 postgres postgres    20480 Jun 14 13:55 archive_status
      
      
      
      STANDBY / SLAVE : 
      =================
      
      postgres@tutorialdba_2:/archive_log> ps -ef|grep postgres
      postgres   4488     1  0 Jun25 ?        00:00:57 /opt/10.6/bin/postgres -D /data
      postgres   4489  4488  0 Jun25 ?        00:00:00 postgres: logger process
      postgres   4490  4488  0 Jun25 ?        00:16:08 postgres: startup process   recovering 00000001000000450000005F
      postgres   4493  4488  0 Jun25 ?        00:10:07 postgres: checkpointer process
      postgres   4494  4488  0 Jun25 ?        00:00:33 postgres: writer process
      postgres   4495  4488  0 Jun25 ?        00:01:08 postgres: stats collector process
      postgres   4496  4488  0 Jun25 ?        00:44:00 postgres: wal receiver process   streaming 45/5FF3DBF0
      
      
      
      XLOGS :
      postgres@tutorialdba_2:/xlog>
      -rw------- 1 postgres postgres 16777216 Jul 22 04:01 000000010000004500000059
      -rw------- 1 postgres postgres 16777216 Jul 22 04:02 00000001000000450000005A
      -rw------- 1 postgres postgres 16777216 Jul 22 04:02 00000001000000450000005B
      -rw------- 1 postgres postgres 16777216 Jul 22 04:02 00000001000000450000005C
      -rw------- 1 postgres postgres 16777216 Jul 22 04:02 00000001000000450000005D
      -rw------- 1 postgres postgres 16777216 Jul 22 20:39 00000001000000450000005E
      -rw------- 1 postgres postgres 16777216 Jul 22 12:36 00000001000000450000006F
      drwx------ 2 postgres postgres   970752 Jul 22 04:02 archive_status
      
      
      XLOG STATUS :
      postgres@tutorialdba_2:/xlog/archive_status>
      -rw------- 1 postgres postgres 0 Jul 22 04:01 000000010000004500000057.done
      -rw------- 1 postgres postgres 0 Jul 22 04:01 000000010000004500000058.done
      -rw------- 1 postgres postgres 0 Jul 22 04:01 000000010000004500000059.done
      -rw------- 1 postgres postgres 0 Jul 22 04:02 00000001000000450000005A.done
      -rw------- 1 postgres postgres 0 Jul 22 04:02 00000001000000450000005B.done
      -rw------- 1 postgres postgres 0 Jul 22 04:02 00000001000000450000005C.done
      -rw------- 1 postgres postgres 0 Jul 22 04:02 00000001000000450000005D.done
      -rw------- 1 postgres postgres 0 Jul 22 04:02 00000001000000450000005E.done
      
      
      
      Archive log location :
      postgres@tutorialdba_2:/archive_log> ls -l
      total 0

      Solution :

      Slave win’t be archive if even archive enabled as well.

      Check the status of xlog then delete the .done files before that check the master xlog status, walsender and last archived log for your confirmation.

      so finally you can delete the below xlog  untill (000000010000004500000059 – 00000001000000450000005E).

      Tag:archive, wal log, xlog

      • Share:
      Admin bar avatar
      Nijamutheen J

      Nijamutheen J 7+ years of experience in PostgreSQL, Linux admin , web hosting - apache server , Oracle ,mySQL, Mriadb, vertica DB & Server security administrator

      My updated resume is https://www.tutorialdba.com/p/hi-i-have-4.html

      Previous post

      Ora2PG - Oracle/MySQL to Postgres DB migration - Latest Version 20.0
      August 19, 2019

      Next post

      PostgreSQL SSL Setup
      September 7, 2019

      Leave A Reply Cancel reply

      You must be logged in to post a comment.

      Login with:

      Login with Google Login with Twitter Login with LinkedIn Login with Microsoft


      Search

      ADVERTISEMENT

      Latest Posts

      PostgreSQL Patching version 9, 10,11
      10Oct2019
      Tools for PostgreSQL
      16Sep2019
      Postgres user creation and restrict DDL & database access
      13Sep2019
      PostgreSQL SSL Setup
      07Sep2019
      How to DELETE current XLOG / WAL LOG in postgresql database ?
      19Aug2019

      Latest Courses

      PostgreSQL Database

      PostgreSQL Database

      $600.00 $500.00
      Greenplum Database

      Greenplum Database

      $2,000.00 $1,500.00

      Preview Course

      Free

      Recent Forum Topics

      • thought behind whiteboard activity
      • Are you going to take your first ste
      • How to start working on an application?
      • please let me know pre requirements to increase work_mem
      • how to copy some data in one table to another table in postgres

      2ndquadrant.in

      (+91) 8838953252

      ITsupport@rayafeel.com

      Company

      • About Us
      • Contact
      • Our Team
      • Blog

      COURSES

      • List Of Course
      • Become An Instructor
      • Events
      • Postgres Support Blog

      Support

      • DBA Support
      • Consultancy Services
      • Postgres Migration Blogs
      • Forum

      Recommend

      • Groups
      • Login
      • FAQs
      • SignUp

      IT Services by rayafeel.com. Powered by Rayafeel Technologies Pvt Ltd.

      • Privacy
      • Terms

      Become An Instructor?

      Join thousand of instructors and earn money hassle free!

      Get Started Now

      Login with:

      Login with Google Login with Twitter Login with LinkedIn Login with Microsoft

      Login with your site account

      Lost your password?

      Not a member yet? Register now

      Register a new account

      Are you a member? Login now