Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

delete_oldest_ckp

17 views
Skip to first unread message

Rich Ford

unread,
Dec 2, 2021, 12:02:30 PM12/2/21
to
When running alterdb -delete_oldest_ckp how does Ingres determine the oldest available checkpoint?

Thanks,
Rich

Roy Hann

unread,
Dec 2, 2021, 12:27:18 PM12/2/21
to
Rich Ford wrote:

> When running alterdb -delete_oldest_ckp how does Ingres determine the oldest available checkpoint?

It gets it from the checkpoint history recorded in the database
configuration file. That file lives in the default data area of the
database. It's called aaaaaaaa.cnf but it's a binary file that is hard
for a human user to interpret.

Fortunately you don't have to interpret it. The infodb utility dumps the
file contents, including the checkpoint history, in a readable format.

The history array can save about 99 checkpoints IIRC... If you
somehow manage to accumulate more checkpoints than that they become
invisible and can no longer be deleted using alterdb.

Roy

Rich Ford

unread,
Dec 2, 2021, 12:29:40 PM12/2/21
to
Can this be modified to only store 1 checkpoint?
We currently are storing 2 but running low on disk space.

Rich

Roy Hann

unread,
Dec 2, 2021, 12:44:37 PM12/2/21
to
Rich Ford wrote:

> On Thursday, 2 December 2021 at 09:27:18 UTC-8, Roy Hann wrote:
>> Rich Ford wrote:
>>
>> > When running alterdb -delete_oldest_ckp how does Ingres determine the oldest available checkpoint?
>> It gets it from the checkpoint history recorded in the database
>> configuration file. That file lives in the default data area of the
>> database. It's called aaaaaaaa.cnf but it's a binary file that is hard
>> for a human user to interpret.
>>
>> Fortunately you don't have to interpret it. The infodb utility dumps the
>> file contents, including the checkpoint history, in a readable format.
>>
>> The history array can save about 99 checkpoints IIRC... If you
>> somehow manage to accumulate more checkpoints than that they become
>> invisible and can no longer be deleted using alterdb.
>
> Can this be modified to only store 1 checkpoint?
> We currently are storing 2 but running low on disk space.

alterdb -keep=1 ...

Roy

Rich Ford

unread,
Dec 2, 2021, 1:18:36 PM12/2/21
to
Big help.

Thanks,
Rich

Paul White

unread,
Dec 2, 2021, 6:36:09 PM12/2/21
to info-...@lists.planetingres.org
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

&

0 new messages