• Re: [Info-ingres] delete_oldest_ckp

    From Paul White@21:1/5 to you on Fri Dec 3 09:34:48 2021
    Hi Rich,
    you wrote:
    Can this be modified to only store 1 checkpoint?
    We currently are storing 2 but running low on disk space.


    Be careful that you always have at least one good checkpoint. If checkpoint fails due to lack of disk space, it leaves an incomplete file/directory. You can get a situation where you have old, but good, checkpoints followed by a sequence of bad
    checkpoints and no room to make another checkpoint. Like this:

    $ infodb
    ...
    ----Checkpoint History for Journal----------------------------------------------
    Date Ckp_sequence First_jnl Last_jnl valid mode
    ----------------------------------------------------------------------------
    Sat Jun 10 22:09:29 2017 224 37337 37425 1 ONLINE
    Sat Jun 17 22:08:04 2017 225 37426 37970 0 ONLINE
    Sun Jun 25 06:47:24 2017 226 37971 38494 1 ONLINE
    Sat Jul 01 22:10:40 2017 227 38495 39046 0 ONLINE
    Sat Jul 08 22:10:20 2017 228 39047 39597 0 ONLINE
    Sat Jul 15 22:24:23 2017 229 39598 39858 0 ONLINE


    $ . cdckp
    /journals/ingresII/ingres/ckp/default

    $ du -sk mydb/*
    8103752 mydb/c0224001.ckp
    0 mydb/c0225001.ckp
    8230401 mydb/c0226001.ckp
    5054221 mydb/c0227001.ckp
    0 mydb/c0228001.ckp
    0 mydb/c0229001.ckp

    $ alterdb mydb -keep=2
    Sun Jul 16 10:20:02 2017 ALTERDB: No checkpoints available to delete.

    $ alterdb mydb -keep=1
    Sun Jul 16 10:20:07 2017 I_DM1405_ALT_CKP_DELETED Database 'mydb', checkpoint set 224 deleted.
    Sun Jul 16 10:20:07 2017 I_DM1405_ALT_CKP_DELETED Database 'mydb', checkpoint set 225 deleted.


    $ infodb
    ...
    ----Checkpoint History for Journal----------------------------------------------
    Date Ckp_sequence First_jnl Last_jnl valid mode
    ----------------------------------------------------------------------------
    Sun Jun 25 06:47:24 2017 226 37971 38494 1 ONLINE
    Sat Jul 01 22:10:40 2017 227 38495 39046 0 ONLINE
    Sat Jul 08 22:10:20 2017 228 39047 39597 0 ONLINE
    Sat Jul 15 22:24:23 2017 229 39598 39858 0 ONLINE


    $ du -sk mydb/*
    8230401 mydb/c0226001.ckp
    5054221 mydb/c0227001.ckp
    0 mydb/c0228001.ckp
    0 mydb/c0229001.ckp


    In this example, I would advise to manually remove incomplete checkpoints (not c0226001.ckp) before running another checkpoint. The "-keep" option removes oldest bad checkpoints when you have the required number of successful checkpoints.


    You might consider running data compression. For unix/linux I generally use tar -Z or pigz. For windows I have a custom script which performs the work. Make sure custom scripts are returning the right status to the checkpoint process.

    $ ingprenv II_CKTMPL_FILE
    /home/ingres/IngresII/ingres/files/cktmpl_custom.def


    from:/home/ingres/IngresII/ingres/files/cktmpl_custom.def
    WSDD: cd %D; /home/ingres/IngresII/ingres/bin/cktmpl_wrap /bin/tar -c --use-compress-program=pigz -f %A *
    WSDT: cd %D; /home/ingres/IngresII/ingres/bin/cktmpl_wrap /bin/tar -c --use-compress-program=pigz -f %A %B
    WRDD: cd %D; /bin/tar -x --use-compress-program=pigz -f %A
    WRDT: cd %D; /bin/tar -x --use-compress-program=pigz -f %A %B


    from:c:\ingresII\ingres\files\cktmpl_custom.def
    WSDD: myckxcopy "%D" "%A" BACKUP
    WSDT: myckxcopy "%D" "%A" BACKUP PARTIAL %B
    WRDD: myckxcopy "%D" "%A" RESTORE
    WRDT: myckxcopy "%D" "%A" RESTORE PARTIAL %B


    I like to keep a copy of the config file immediately after checkpoint is complete. This helps when I need to restore old checkpoints from long term archive. The backup script does this:

    echo "copy current config for $db" >> $log_file
    cp -p /journals/ingresII/ingres/dmp/default/${db}/aaaaaaaa.cnf /journals/ingresII/ingres/dmp/default/${db}/aaaaaaaa-`date +%y%m%d%H%M%S`.cnf


    This example shows the database has 5 checkpoints in local storage. I replicate (scp, winscp etc) the checkpoint location to another server or NAS for DR purposes.

    $ . cddmp
    /journals/ingresII/ingres/dmp/default
    $ ls -lat mydb|more
    total 3380
    drwxr-x---. 2 ingres ingresbak 4096 Dec 3 10:03 .
    -rw-r--r--. 1 ingres ingres 562 Dec 3 10:03 aaaaaaaa.ext
    -rw-r--r--. 1 ingres ingres 10240 Dec 3 10:03 aaaaaaaa.cnf
    -rw-r--r--. 1 ingres ingres 10240 Dec 2 23:38 aaaaaaaa-211202233825.cnf -rw-------. 1 ingres ingres 66048 Dec 2 23:38 d0000649.dmp
    -rw-------. 1 ingres ingres 620544 Dec 2 23:38 c1846000.lst
    -rw-------. 1 ingres ingres 10240 Dec 2 23:35 c0001846.dmp
    -rw-r--r--. 1 ingres ingres 10240 Dec 1 23:38 aaaaaaaa-211201233825.cnf -rw-------. 1 ingres ingres 620544 Dec 1 23:38 c1845000.lst
    -rw-------. 1 ingres ingres 10240 Dec 1 23:35 c0001845.dmp
    -rw-r--r--. 1 ingres ingres 10240 Nov 30 23:38 aaaaaaaa-211130233825.cnf -rw-------. 1 ingres ingres 620544 Nov 30 23:38 c1844000.lst
    -rw-------. 1 ingres ingres 10240 Nov 30 23:35 c0001844.dmp
    -rw-r--r--. 1 ingres ingres 10240 Nov 29 23:38 aaaaaaaa-211129233826.cnf -rw-------. 1 ingres ingres 620544 Nov 29 23:38 c1843000.lst
    -rw-------. 1 ingres ingres 10240 Nov 29 23:35 c0001843.dmp
    -rw-r--r--. 1 ingres ingres 10240 Nov 28 23:38 aaaaaaaa-211128233824.cnf -rw-------. 1 ingres ingres 620544 Nov 28 23:38 c1842000.lst
    -rw-------. 1 ingres ingres 10240 Nov 28 23:35 c0001842.dmp
    -rw-r--r--. 1 ingres ingres 10240 Nov 27 23:38 aaaaaaaa-211127233833.cnf -rw-r--r--. 1 ingres ingres 10240 Nov 26 23:38 aaaaaaaa-211126233826.cnf -rw-r--r--. 1 ingres ingres 10240 Nov 25 23:38 aaaaaaaa-211125233826.cnf -rw-r--r--. 1 ingres ingres 10240 Nov 24 23:38 aaaaaaaa-211124233826.cnf -rw-r--r--. 1 ingres ingres 10240 Nov 23 23:38 aaaaaaaa-211123233828.cnf -rw-r--r--. 1 ingres ingres 10240 Nov 22 23:38 aaaaaaaa-211122233825.cnf -rw-r--r--. 1 ingres ingres 10240 Nov 21 23:38 aaaaaaaa-211121233825.cnf -rw-r--r--. 1 ingres ingres 10240 Nov 20 23:38 aaaaaaaa-211120233835.cnf -rw-r--r--. 1 ingres ingres 10240 Nov 19 23:38 aaaaaaaa-211119233825.cnf ...


    Paul

    &

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)