# Is there a way to force a buffer flush?

**URL:** <https://techcommunity.softwareag.com/t/is-there-a-way-to-force-a-buffer-flush/99223>\
**Category:** Forum\
**Tags:** Adabas-Natural, Adabas, Adabas-Basics-on-Linux-Unix-Windows, Adabas-on-Windows-UNIX, Adabas-on-Linux\
**Created:** [December 13, 2011, 10:22am UTC](https://techcommunity.softwareag.com/t/is-there-a-way-to-force-a-buffer-flush/99223 "2011-12-13T10:22:16Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [December 13, 2011, 10:22am UTC](https://techcommunity.softwareag.com/t/is-there-a-way-to-force-a-buffer-flush/99223/1 "2011-12-13T10:22:16Z")

</div>

Hello all!

Is there a way to force a buffer flush? At the moment I’m thinking about setting the write\_limit to 1 for a few seconds. But is there a better way?

Thanks

Matthias

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [December 13, 2011, 11:06am UTC](https://techcommunity.softwareag.com/t/is-there-a-way-to-force-a-buffer-flush/99223/2 "2011-12-13T11:06:45Z")

</div>

Matthias,

even setting write\_limit to 1 may not give you exactly what you want / need  
as it doesn’t immediately force a bufferflush, and it may cause a lot more  
bufferflushes than you want, depending on the system activity at that time.

On mainframe Adabas one can force a bufferflush with a C1 command,  
not sure if this is implemented on OpenSystems as well, at least it isn’t  
documented, you’d have to ask support if there may be an “undocumented  
feature”.

What exactly do you need to force that bufferflush for ?

Cheers

&nbsp;&nbsp;&nbsp;Wolfgang

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [December 14, 2011, 7:57am UTC](https://techcommunity.softwareag.com/t/is-there-a-way-to-force-a-buffer-flush/99223/3 "2011-12-14T07:57:36Z")

</div>

Hi Wolfgang,

> [@Wolfgang Winter](#):
>
> even setting write\_limit to 1 may not give you exactly what you want / need

Of course you’re right. I set the WRITE\_LIMIT to 2 on monday. Sometimes I got 2-3 BF within 10 seconds… That’s not exactly what I want.

> [@](#):
>
> you’d have to ask support if there may be an “undocumented feature”.

Thanks fot the hint. I’m gonna ask …

> [@](#):
>
> What exactly do you need to force that bufferflush for ?

That’s a long story. [Parameter WRITE\_LIMIT - Adabas-Natural - Software AG Tech Community & Forums](http://tech.forums.softwareag.com/techjforum/posts/list/24435.page)

To make it short: Performance problems during buffer flush. So one idea is (for example) to make a buffer flush during lunchtime, when most of the users won’t use the programs.

Matthias

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [December 14, 2011, 12:04pm UTC](https://techcommunity.softwareag.com/t/is-there-a-way-to-force-a-buffer-flush/99223/4 "2011-12-14T12:04:50Z")

</div>

Matthias,

> [@Matthias](#):
>
> > [@](#):
> >
> > What exactly do you need to force that bufferflush for ?
> 
> That’s a long story. [Parameter WRITE\_LIMIT - Adabas-Natural - Software AG Tech Community & Forums](http://tech.forums.softwareag.com/techjforum/posts/list/24435.page)

Ah, THAT story, I see.  
Hopefully Wolfgang Obmann can provide some insight as to if there is  
a reliable way to force a bufferflush on demand.

> [@Matthias](#):
>
> To make it short: Performance problems during buffer flush. So one idea is (for example) to make a buffer flush during lunchtime, when most of the users won’t use the programs.

But there’s the problem, you can set WRITE\_LIMIT as low as you want, when noone is there  
to fill the BP with updates no flush will happen 😉

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [December 14, 2011, 12:50pm UTC](https://techcommunity.softwareag.com/t/is-there-a-way-to-force-a-buffer-flush/99223/5 "2011-12-14T12:50:25Z")

</div>

Hi Matthias,

adaopr ext\_backup=prepare  
adaopr ext-backup=abort

would make a buffer flush. But it will also require all transactions to be synchronized i.e. all have to be on ET-status and have to wait for it (TT parameter). TT can be reduced for this process but may result in user being timed out.

Perhaps not a good alternative but it depends on how eager you are in making a buffer flush? :?

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [December 15, 2011, 8:09am UTC](https://techcommunity.softwareag.com/t/is-there-a-way-to-force-a-buffer-flush/99223/6 "2011-12-15T08:09:19Z")

</div>

Hello Mogens!

We don’t want to make an ET\_SYNC. Blocking all new transactions would result in a dialog freeze (from the user’s point of view)…

Regards,

Matthias

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [December 15, 2011, 10:25am UTC](https://techcommunity.softwareag.com/t/is-there-a-way-to-force-a-buffer-flush/99223/7 "2011-12-15T10:25:01Z")

</div>

Wolfgang,

> [@Wolfgang Winter](#):
>
> Hopefully Wolfgang Obmann can provide some insight as to if there is  
> a reliable way to force a bufferflush on demand.

Meanwhile I found a way on my own. Your C1-thing was a good hint. The documentation says, C1 writes a checkpoint. And this is exactly what ADAINV is doing - even if ADAINV aborts, it does a buffer flush.

example:

```auto
adainv db=14 invert=30 fields AA end_of_fields
%ADAINV-I-STARTED, 15-DEC-2011 10:11:58, Version 6.1.10.10 (Solaris 64Bit)
%ADAINV-I-DBON, database 14 accessed online
AA
^
%ADAINV-E-ISDESC, field has already descriptor status
%ADAINV-E-NOFIELDS, no fields supplied

%ADAINV-I-IOCNT, 3 IOs on dataset ASSO
%ADAINV-I-ABORTED, 15-DEC-2011 10:11:59, elapsed time: 00:00:01
```

adamon looks like that:

```auto
Commands I/Os per sec Throw Buffer pool
per sec ASSO DATA WORK PLOG backs Hit Flushs
------------------------------------------------------
       0 0 0 0 0 0 - 0
       0 0 0 0 0 0 - 0
       0 0 0 0 0 0 - 0
       7 1 56 6 1 0 - 3 <-- ADAINV here
       0 0 0 0 0 0 - 0
       1 0 0 0 0 0 - 0
       0 0 0 0 0 0 - 0
```

and the “write pool” was almost empty at that time:

```auto
                       ADANUC Version 6.1.10.10
        Database 14 Buffer Pool Statistics on 15-DEC-2011 10:14:42

Buffer Pool Size : 536,870,912

Pool Allocation RABNs present
--------------- -------------
Current ( 72%) : 390,276,096 ASSO : 12,901
Highwater ( 72%) : 390,276,096 DATA : 38,512
                                       WORK : 0
                                       NUCTMP : 1
                                       NUCSRT : 0

I/O Statistics Buffer Flushes
-------------- --------------
Logical Reads : 3,093,026 Total : 28
Physical Reads : 51,402 To Free Space : 0
Pool Hit Rate : 98%
                                       Write Limit ( 60%): 322,122,000
Physical Writes : 26,612 Modified ( 0%): 462,848

                       ADANUC Version 6.1.10.10
        Database 14 Buffer Pool Statistics on 15-DEC-2011 10:15:22

Buffer Pool Size : 536,870,912

Pool Allocation RABNs present
--------------- -------------
Current ( 72%) : 390,276,096 ASSO : 12,901
Highwater ( 72%) : 390,276,096 DATA : 38,512
                                       WORK : 0
                                       NUCTMP : 1
                                       NUCSRT : 0

I/O Statistics Buffer Flushes
-------------- --------------
Logical Reads : 3,093,036 Total : 31
Physical Reads : 51,402 To Free Space : 0
Pool Hit Rate : 98%
                                       Write Limit ( 60%): 322,122,000
Physical Writes : 26,612 Modified ( 0%): 0

%ADAOPR-I-TERMINATED, 15-DEC-2011 10:15:24, elapsed time: 00:00:00
```

BTW: “%ADAINV-E-NOTAVL, File ?? not available” results in 2 flushes.

Next question is: Are there any side effects - for example in case of a restore + recover via plog?

Regards

Matthias

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [December 15, 2011, 1:14pm UTC](https://techcommunity.softwareag.com/t/is-there-a-way-to-force-a-buffer-flush/99223/8 "2011-12-15T13:14:05Z")

</div>

Hi Matthias,

Your adainv was running at 10:11:58 and the two “display bp” were running at 10:14:42 and 10:15:22. Much later (nearly 3 min). And between these two displays (just 40 secs in between) no of buffer flushes has bumped with 3. What makes you think the bp displays prove buffer flushes has taken place at adainv time?

adamon shows 3 buffer flushes but at which time?

Regenerate should not be affected by this. There should be nothing to do even if adainv has written a checkpoint. And invert - as far as I remember - is done “on the flight” by regenerate.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [December 15, 2011, 1:43pm UTC](https://techcommunity.softwareag.com/t/is-there-a-way-to-force-a-buffer-flush/99223/9 "2011-12-15T13:43:15Z")

</div>

If you want to force a buffer flush, just perform adadbm db=…  
There were complaints by customers that ADADBM sometimes requires a lot of time; this is because of the buffer flush. Therefore this behaviour may be changed with a future version, but because other custumers may rely on this behaviour this will not be done for the currently released versions.

Regards,  
Wolfgang

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [December 15, 2011, 4:02pm UTC](https://techcommunity.softwareag.com/t/is-there-a-way-to-force-a-buffer-flush/99223/10 "2011-12-15T16:02:41Z")

</div>

> [@Mogens](#):
>
> What makes you think the bp displays prove buffer flushes has taken place at adainv time?

Your’re right. The time doesn’t match. Obviously the adaopr-bp is showing my second try.

I was alone on my test-database. I did several tries (with reinvert, invert+descriptor already exists and invert+File in use) and every time, the modified byte count was reset to 0, the number of buffer flushes was increased by 2 or 3. So I’m sure Adabas did a buffer flush while ADAINV was running.

> [@](#):
>
> adamon shows 3 buffer flushes but at which time?

I did the adainv while watching adamon … interval=1. The listing was quite long so I just cut out the relevant part…

> [@](#):
>
> Regenerate should not be affected by this.

Thank you, Mogens.

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [December 15, 2011, 4:07pm UTC](https://techcommunity.softwareag.com/t/is-there-a-way-to-force-a-buffer-flush/99223/11 "2011-12-15T16:07:52Z")

</div>

Hello Wolfgang Obmann,

> [@Wolfgang Obmann](#):
>
> If you want to force a buffer flush, just perform adadbm db=…

Works fine! Thank you very much!

@Mogens: Here’s my try with adadbm:

```auto
$ adaopr db=12 di=bp
%ADAOPR-I-STARTED, 15-DEC-2011 16:07:28, Version 6.1.10.10 (Solaris 64Bit)

Database 12, startup at 24-NOV-2011 21:22:07
ADANUC Version 6.1.10.10, PID 25604

                       ADANUC Version 6.1.10.10
        Database 12 Buffer Pool Statistics on 15-DEC-2011 16:07:19

Buffer Pool Size : 536,870,912

Pool Allocation RABNs present
--------------- -------------
Current ( 42%) : 230,350,848 ASSO : 15,119
Highwater ( 42%) : 230,350,848 DATA : 17,751
                                       WORK : 0
                                       NUCTMP : 5
                                       NUCSRT : 0

I/O Statistics Buffer Flushes
-------------- --------------
Logical Reads : 7,808,175 Total : 79
Physical Reads : 34,565 To Free Space : 0
Pool Hit Rate : 99%
                                       Write Limit ( 60%): 322,122,000
Physical Writes : 2,302 Modified ( 0%): 561,152

%ADAOPR-I-TERMINATED, 15-DEC-2011 16:07:28, elapsed time: 00:00:00
$ adadbm db=12
%ADADBM-I-STARTED, 15-DEC-2011 16:07:49, Version 6.1.10.10 (Solaris 64Bit)
%ADADBM-I-DBON, database 12 accessed online

%ADADBM-I-TERMINATED, 15-DEC-2011 16:07:49, elapsed time: 00:00:00
$ adaopr db=12 di=bp
%ADAOPR-I-STARTED, 15-DEC-2011 16:08:01, Version 6.1.10.10 (Solaris 64Bit)

Database 12, startup at 24-NOV-2011 21:22:07
ADANUC Version 6.1.10.10, PID 25604

                       ADANUC Version 6.1.10.10
        Database 12 Buffer Pool Statistics on 15-DEC-2011 16:07:59

Buffer Pool Size : 536,870,912

Pool Allocation RABNs present
--------------- -------------
Current ( 42%) : 230,350,848 ASSO : 15,119
Highwater ( 42%) : 230,350,848 DATA : 17,751
                                       WORK : 0
                                       NUCTMP : 5
                                       NUCSRT : 0

I/O Statistics Buffer Flushes
-------------- --------------
Logical Reads : 7,808,185 Total : 80
Physical Reads : 34,565 To Free Space : 0
Pool Hit Rate : 99%
                                       Write Limit ( 60%): 322,122,000
Physical Writes : 2,302 Modified ( 0%): 0

%ADAOPR-I-TERMINATED, 15-DEC-2011 16:08:01, elapsed time: 00:00:00
$
```

```auto
$ adamon db=12 interval=1
%ADAMON-I-STARTED, 15-DEC-2011 16:07:43, Version 6.1.10.10 (Solaris 64Bit)

Database 12, startup at 24-NOV-2011 21:22:07
ADANUC Version 6.1.10.10, PID 25604

Commands I/Os per sec Throw Buffer pool
per sec ASSO DATA WORK PLOG backs Hit Flushs
------------------------------------------------------
       0 0 0 0 0 0 - 0
       0 0 0 0 0 0 - 0
       0 0 0 0 0 0 - 0
       0 0 0 0 0 0 - 0
       0 0 0 0 0 0 - 0
       0 0 0 0 0 0 - 0
       0 0 0 0 0 0 - 0
       4 82 22 2 1 0 - 1
       0 0 0 0 0 0 - 0
       2 0 0 0 0 0 100% 0
       0 0 0 0 0 0 - 0
       0 0 0 0 0 0 - 0
       0 0 0 0 0 0 - 0
^C

Summary (measurement time: 00:00:12)

                 Totals Ratio per sec
----------------------------------------
Commands : 6 0
ASSO I/Os : 82 6
DATA I/Os : 22 1
WORK I/Os : 2 0
TEMP I/Os : 3 0
PLOG I/Os : 1 0
Throwbacks : 0 0
Buffer Hit : 100%
Buffer flushs: 1
     Explicit: 1

%ADAMON-I-TERMINATED, 15-DEC-2011 16:07:55, elapsed time: 00:00:12
$
```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [December 15, 2011, 10:49pm UTC](https://techcommunity.softwareag.com/t/is-there-a-way-to-force-a-buffer-flush/99223/12 "2011-12-15T22:49:41Z")

</div>

Hi Matthias,

This looks much more nice and clean. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:01pm UTC](https://techcommunity.softwareag.com/t/is-there-a-way-to-force-a-buffer-flush/99223/13 "2021-04-02T15:01:19Z")

</div>


