Consultor Eletrônico



Kbase P102939: Suggested method of parsing the database log file to find out if a quiet point has been enabled
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   25/07/2008
Status: Verified

GOAL:

What is the best way to determine if the proquiet point has been enabled?

GOAL:

Suggested method of parsing the database log file to find out if a quiet point has been enabled

GOAL:

How to find out if proquiet -C enable has succeeded?

GOAL:

Why does a quiet point sometimes not get enabled immediately?

GOAL:

Quiet point has been enabled by the broker. (5583)

GOAL:

How to know if proquiet has been granted?

FACT(s) (Environment):

UNIX

FIX:

When a user issues a proquiet command, a quiet point flag is set. Customers with mirrored systems often break the mirror immediately after issuing the proquiet command or check for a success return code from the _mprshut executable. This can result in the mirror splitting before the quiet point has actually been enabled. One way to get around this limitation is to parse the database log file for the 5583 message before breaking the mirror.

The only caveat in using proquiet is that you MUST check that the quiet was successfully started | stopped before undertaking any further operations against the database and not assume that it has been as soon as the "proquiet -C enable | disable" command has been run.

Unless there are specific reasons at the time that the "proquiet -C enable" cannot establish a quiet point, there is no point in running a script to query return codes, because once all the necessary latches to prevent any type of writes from the database have been acquired by the broker, we acknowledge through shared memory that the quiet point was enabled. This is communicated to the requester process and it is then free to print the enabled message (5583) and return to the (quiet point requester) user with an appropriate return code = 0. As soon as the user session has been granted the proquiet, it exits (453) and is no longer visible in (say) a: ps -ef | grep "_mprshut -C quiet enable" | echo $? Moreover, at the time of writing, there are no VST available to query the proquiet state.

For example: QUIET 5: Quiet point request login by <user> on <ttyxxx>. (5569)
BROKER 0: Quiet point has been enabled by the broker. (5583)
QUIET 5: Logout by <user> on <ttyxxx>. (453) One of the reasons that the (5583) may take longer than expected to return is because resources held by a dead user (for example) are not available until TCP/IP timeout's kick in or the Watchdog utility cleans these up. ie: a client that is holding an update TXE latch and causing the request for quiet point to wait as it should, by design, on the TXE latch being released.

Parsing the database log file for matching message sets: Quiet point has been enabled by the broker. (5583)
Quiet point has been disabled by the broker. (5584) in a loop is suggested as the first step in finding out if the quiet point has been enabled. If the result fails to return a favorable result after the set iterations, further investigation into what is causing the delay can ensue. The script snippet below will result in the entire database log file being parsed. It may be more beneficial to copy off the last days worth of log activity or make use of the UNIX tail command to capture the last 100+ or more lines and redirect them into another file. The script could then be modified to run against this subset of data instead of the entire log file.

For example: <shell script snippet>

DBNAME=dbname
LOOPTIME=10 while true
do
q1=`more ${DBNAME}.lg | grep "(5583)" | wc -l`
q2=`more ${DBNAME}.lg | grep "(5584)" | wc -l` if test $q1 -eq $q2
then echo "DB does NOT have a quiet point"
else if test $q1 -gt $q2
then echo "quiet point HAS been enabled on the DB"
else echo "DB.log's been shrunk or modified"
fi
fi
sleep $LOOPTIME
done

<shell script snippet>