Feedback
Did this article resolve your question/issue?

   

Article

How to write script statements to check if a PROQUIET has been enabled?

« Go Back

Information

 
TitleHow to write script statements to check if a PROQUIET has been enabled?
URL NameP174598
Article Number000150729
EnvironmentProduct: Progress
Version: 9.1D07, 9.1D08, 9.1D09, 9.1E
Product: OpenEdge
Version: 10.x, 11.x, 12.x
OS: All supported platforms
Question/Problem Description
How to write script statements to check if a PROQUIET has been enabled?
How to script PROQUIET enable?
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution
It is necessary to test the return code because the 'proquiet <dbname> -C enable' command will return (to the command line or allow the next line in a script to execute) while the quiet point is not yet acknowledged as enabled by the database itself. The quiet point has only been successfully raised when the Broker posts the 5583 confirmation message in the database log file or the promon activity screen shows: Quiet Point is Active

When is a database quiet point instate:

In essence, the 'proquiet enable' command is simply a request. It is the database broker that first has to do the work and acknowledge it done before the quiet point has been raised.

1.  The quiet process requests to the broker that a quiet point be enabled and waits for the broker to acknowledge that request is complete. At this point, the requester is in a sleep loop. This process will not return until the broker has done his job at which time, the return code will contain whether the quiet point was enabled or rejected.
QUIET   5: Quiet point request login by <user> on <ttyxxx>. (5569)

2. While the the requester is in a sleep loop the broker processes the watchdog code, which makes a pass through the quiet point enablement code. All necessary locks and latches are aquired to prevent any type of writes from the database and flushes the database files depending on what processes are running at that moment in time. If APWS are present, an additional flush is made. After all these latches are acquired and flushing is complete, the broker sends an acknowledgment to the requester through shared memory that the quiet point was enabled and goes to sleep in a quiet point.
BROKER  0: Quiet point has been enabled by the broker. (5583)

3. Once this is communicated to the requester process the broker is then free to print the enabled message and return to the (quiet point requester) user with an appropriate return code. The quiet point requester awakes and notices the state change. It ends its sleep cycle and returns a return code to indicate the quiet point is in force.
QUIET   5: Logout by <user> on <ttyxxx>. (453)

For further detailed information refer to Article  What happens when a PROQUIET is requested   

The following two scripts (one for Windows and one for Unix):
  1. Will Quiescence the database,
  2. Then will loop to check the status of the quiet point and finally
  3. Will not proceed until the return code of 0 is given indicating that the quiet point has been enabled.
These scripts are examples and should be rigorously tested prior to incorporation into existing production environments. Progress Development reserves the right to change the return codes of utilities when necessary at any time in the future, without warning.

PROQUIET enable script for Windows:

On Windows the following script will attempt to enable a PROQUIET and will check repeatedly approximately every 4 seconds to see if the quiet point is enabled.

Replace 'dbname' with the database name.
:startit
call proquiet dbname enable
if not ERRORLEVEL 0 (
ping 5
goto :startit
) else (
goto :quit
)
:quit
echo The database is in a state of quiescent consistency
REM <Do whatever scripting you need to perform here while quiet is enabled.>
call proquiet dbname disable
 

PROQUIET enable script for UNIX:

On Unix the following script will attempt to enable a proquiet and will check repeatedly approximately every 5 seconds to see if the quiet point is enabled.

Replace 'dbname' with the database name.
 
#!/bin/sh
proquiet dbname enable
ret=$?
echo Return is $ret
while [ $ret -ne 0 ]
do
sleep 5
proquiet dbname enable
ret=$?
done
echo The database is in a state of quiescent consistency
#<Do whatever scripting you need to perform here while quiet is enabled.>
proquiet dbname disable
Workaround
Notes
Last Modified Date9/22/2021 8:26 PM
Attachment 
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.