The secrets of Master Block - Forum - OpenEdge RDBMS - Progress Community

The secrets of Master Block

 Forum

The secrets of Master Block

  • Since V10.1C the master block in Progress database contains at least 95 fields including three fields that are not reported by dbrpr utility. Some of the fields are obsolete. There are the fields that were removed from master block (like mb_dsrCRArea that existed only in V10.0A). Other fields match the ones in _MstrBlk and _DbStatus tables - so they are documented. But there are a lot of the fields in master blocks that are not documented. Below I have attached the masterblock.txt file with the list of the master block’s fields with their description. Any additional information is welcomed.

    Also I attached the masterblock.sh script and the masterblock.p program. Both can read the fields of master block from disk. Both can be used for database versions from 10.0A to 12.0.

    masterblock.sh dbname [field …]
    If you will not specify the list of the master block’s fields the script will report all of them. The “mb_” prefix is not mandatory in the field’s names.

    Or run the masterblock.p program and choose a .db file. The program will add the dump of master block to the masterblock.dump.txt file that can be opened in Excel. So you can check how the fields in master blocks are changing over the time.

    masterblock.txt

    masterblock.sh

    masterblock.p

  • George,

    I didn't see anything obvious but you are more eagle-eyed than I --  is there anything in there that tells you if a replication enabled db is a source or a target vs simply being enabled?

    Unfortunately the _repl-server VST vanishes at runtime if the replication server is not actually running :(

    --
    Tom Bascom
    tom@wss.com

  • I tried this on 3 repl-enabled 11.7.2 databases on AIX and mb_replEnabled returns 1 on the src and 66 on the target. I have no idea if that is definitive or not.

    Paul Koufalis
    White Star Software

    pk@wss.com
    @oeDBA (https://twitter.com/oeDBA)

    ProTop: The #1 Free OpenEdge DB Monitoring Tool
    http://protop.wss.com
  • mb_replEnabled:

    0 = Replication is not enabled
    1 = Source
    2 = Target

  • Other differences between the master block’s fields in source and target databases:

    mb_repl* fields (except mb_replEnabled) are not zeroes only in source databases.

    mb_maxArgnclts is 32000 in target databases. In most cases it’s zero in source databases but for one source db it was 5001 instead of 0.

    mb_dsrCRAISeq is 0 if replcation is not enabled, 1 in target databases and 2 or higher in source databases.

    mb_ai.* fields are zeroes if after-image logging is not enabled. In most cases it’s true for target databases.

  • any idea why I am seeing 66?

    Paul Koufalis
    White Star Software

    pk@wss.com
    @oeDBA (https://twitter.com/oeDBA)

    ProTop: The #1 Free OpenEdge DB Monitoring Tool
    http://protop.wss.com
  • Same source database, AIX 6.1, OE 11.7.2:

    mb_dsrCRAISeq seems to change at every execution of masterblock.sh:

    $ ./masterblock.sh db  2>/dev/null | grep -e Argn -e repl -e CRA

    RUN 1:

    mb_replai.aibegin     ERROR (seconds since Jan 01, 1970)

    mb_replai.ainew       ERROR (seconds since Jan 01, 1970)

    mb_replai.aigennbr    2

    mb_replai.aiopen      1555457031 (seconds since Jan 01, 1970)

    mb_repllstmod         ERROR (seconds since Jan 01, 1970)

    mb_replupdctr         87

    mb_replEnabled        1

    mb_replRET            ERROR

    mb_maxArgnclts        ERROR

    mb_replFlags          ERROR

    mb_dsrCRAISeq         92

    RUN 2:

    mb_replai.aibegin     1555456888 (seconds since Jan 01, 1970)

    mb_replai.ainew       1555457031 (seconds since Jan 01, 1970)

    mb_replai.aigennbr    2

    mb_replai.aiopen      1555457031 (seconds since Jan 01, 1970)

    mb_repllstmod         1555435515 (seconds since Jan 01, 1970)

    mb_replupdctr         0

    mb_replEnabled        1

    mb_replRET            1555456963

    mb_maxArgnclts        ERROR

    mb_replFlags          0x00000000

    mb_dsrCRAISeq         0

    RUN 3:

    mb_replai.aibegin     ERROR (seconds since Jan 01, 1970)

    mb_replai.ainew       ERROR (seconds since Jan 01, 1970)

    mb_replai.aigennbr    2

    mb_replai.aiopen      1555457031 (seconds since Jan 01, 1970)

    mb_repllstmod         1555435515 (seconds since Jan 01, 1970)

    mb_replupdctr         ERROR

    mb_replEnabled        1

    mb_replRET            ERROR

    mb_maxArgnclts        0

    mb_replFlags          0x00000000

    mb_dsrCRAISeq         0

    Paul Koufalis
    White Star Software

    pk@wss.com
    @oeDBA (https://twitter.com/oeDBA)

    ProTop: The #1 Free OpenEdge DB Monitoring Tool
    http://protop.wss.com
  • And running against the target, again AIX 6.1 OE 11.7.2:

    RUN 1:

    mb_replai.aibegin     ERROR (seconds since Jan 01, 1970)

    mb_replai.ainew       ERROR (seconds since Jan 01, 1970)

    mb_replai.aigennbr    ERROR

    mb_replai.aiopen      ERROR (seconds since Jan 01, 1970)

    mb_repllstmod         ERROR (seconds since Jan 01, 1970)

    mb_replupdctr         ERROR

    mb_replEnabled        66

    mb_replRET            1555456768

    mb_maxArgnclts        32000

    mb_replFlags          ERROR

    mb_dsrCRAISeq         ERROR

    RUN 2:

    mb_replai.aibegin     1555456768 (seconds since Jan 01, 1970)

    mb_replai.ainew       1555457024 (seconds since Jan 01, 1970)

    mb_replai.aigennbr    0

    mb_replai.aiopen      1555457024 (seconds since Jan 01, 1970)

    mb_repllstmod         1555435264 (seconds since Jan 01, 1970)

    mb_replupdctr         0

    mb_replEnabled        66

    mb_replRET            ERROR

    mb_maxArgnclts        ERROR

    mb_replFlags          0x00000000

    mb_dsrCRAISeq         1

    RUN 3:

    mb_replai.aibegin     1555456768 (seconds since Jan 01, 1970)

    mb_replai.ainew       1555457024 (seconds since Jan 01, 1970)

    mb_replai.aigennbr    0

    mb_replai.aiopen      1555457024 (seconds since Jan 01, 1970)

    mb_repllstmod         1555435264 (seconds since Jan 01, 1970)

    mb_replupdctr         0

    mb_replEnabled        66

    mb_replRET            ERROR

    mb_maxArgnclts        ERROR

    mb_replFlags          ERROR

    mb_dsrCRAISeq         ERROR

    Paul Koufalis
    White Star Software

    pk@wss.com
    @oeDBA (https://twitter.com/oeDBA)

    ProTop: The #1 Free OpenEdge DB Monitoring Tool
    http://protop.wss.com
  • From masterblock.p No errors but still not what you expected.   FYI: note the space in "mb_ replFlags" in the dump.txt file.

    Source:

    mb_replEnabled 1

    mb_replRET 1555442766

    mb_maxArgnclts 0

    mb_ replFlags 0

    mb_dsrCRAISeq 91

    Target:

    mb_replEnabled 66

    mb_replRET 1555442766

    mb_maxArgnclts 32000

    mb_ replFlags 0

    mb_dsrCRAISeq 1

    Paul Koufalis
    White Star Software

    pk@wss.com
    @oeDBA (https://twitter.com/oeDBA)

    ProTop: The #1 Free OpenEdge DB Monitoring Tool
    http://protop.wss.com
  • Hmmm....

    $ ./viewdbblock.sh db 64

    viewdbblock.sh: wrong area number (64).

    Paul Koufalis
    White Star Software

    pk@wss.com
    @oeDBA (https://twitter.com/oeDBA)

    ProTop: The #1 Free OpenEdge DB Monitoring Tool
    http://protop.wss.com
  • Today is not my day. ;-(

    It should be 'viewdbblock.sh db 6 64' where 6 is the area number and 64 is dbkey of master block provided db blocksize is 8K.

  • viewdbblock.sh db works:

    Source:

        mb_replEnabled:       0x01               1

        mb_replRET:           0x5cb62c4e         1555442766

        mb_maxArgnclts:       0x00000000         0

        mb_replFlags:         0x00000000         0

        mb_dsrCRAISeq:        0x0000005d         93

    Target:

        mb_replEnabled:       0x42               66

        mb_replRET:           0x5cb62c4e         1555442766

        mb_maxArgnclts:       0x00007d00         32000

        mb_replFlags:         0x00000000         0

        mb_dsrCRAISeq:        0x00000001         1

    Paul Koufalis
    White Star Software

    pk@wss.com
    @oeDBA (https://twitter.com/oeDBA)

    ProTop: The #1 Free OpenEdge DB Monitoring Tool
    http://protop.wss.com
  • I still don't have an idea why the target's mb_replEnabled is 66 on AIX. Not all secrets of master blocks are revealed!

  • viewdbblock.sh db 6 64 returns the same result as without the "6 64" at the end.

    Paul Koufalis
    White Star Software

    pk@wss.com
    @oeDBA (https://twitter.com/oeDBA)

    ProTop: The #1 Free OpenEdge DB Monitoring Tool
    http://protop.wss.com