Progress
Database Administration
Guide and Reference


ProControl Command-line Interface

In order to start Progress database servers on an NT node, ProControl simply runs the PCCmd command. This image controls either starting or stopping ProService and the various database servers. For the entire syntax of the PCCmd command, see the Progress Startup Command and Parameter Reference .

Within your scripts or script objects, use the following syntax and parameters based on your requirements:

SYNTAX
%DLC%\BIN\pccmd.exe P1 P2 [P3] 

%DLC% is a system-wide environment variable defined during Progress installation. The parameters to ppcmd.exe dictate what is done. The following is the list of parameters you will need:

P1 - Parameter 1

Use P1 to specify one of the following values for the type parameter:

P2 - Parameter 2

Use P2 to specify one of the following values for the command parameter.

START to start either ProService or the Database Server named in P3.

STOP to stop either ProService or the Database Server named in P3.

STATUS to return one of the following:

[P3] - Parameter 3

Use [P3] to specify a value for the identifier parameter. [P3] is required if Parameter 1 is DATABASE.

If a wrong parameter is passed to PCCmd, it will be signaled to the standard output and no action will be taken.

EXAMPLES

Some command-line examples include:

%DLC%\bin\pccmd.exe ProService Status 

A return of 0 from this call means ProService is already running:

%DLC%\bin\pccmd.exe ProService Start 

If run while already running, a message displays stating that ProService is already running; otherwise, a successful run will return 0:

%DLC%\bin\pccmd.exe ProService Stop 

If run while already stopped, a message displays stating that ProService is already stopped; otherwise, a successful run will return 0:

%DLC%\bin\pccmd.exe Database Status DEMO 

A return of 0 from this call indicates the Database server for DEMO is already running:

%DLC%\bin\pccmd.exe Database Start DEMO 

A return of 0 from this indicates the Database server for DEMO was started successfully. If a start is attempted twice, 0 will still be returned and no message is displayed:

%DLC%\bin\pccmd.exe Database Stop DEMO 

A return of 0 from this indicates the Database server for DEMO was stopped successfully. If a stop is attempted twice or attempted upon a stopped database server, a 1 will be returned and no message is displayed.

Using the above commands, you can create either an entire script to be run or Failover Objects for ProControl and each database server to be placed into a Progress Failover Group.

Determining whether or not to create a script depends on the environment. In the simple case of one database server per cluster, by simply starting and stopping ProService with the database server being automatically started and shutdown by ProService, a script is unnecessary. In this case, using the direct command-line start/stop ProService as the startup and shutdown options to the Failover Object should be used. In the more complicated case of multiple database servers on both nodes, you should use scripts. The scripts can then use the “status” option to determine whether or not ProService is running, as well as determine whether or not a database server is running for the particular object.

NOTE: The Failover Manager is documented to perform startup in the order of the Failover Groups and shutdown in the reverse order of the Failover Groups.

Startup of objects within each group is performed in the order listed within the group, while shutdown is executed in reverse order. Therefore, the cluster system manager must properly configure the order so that each Progress database server will have the necessary disk and network objects in place before attempting to start. This becomes especially tricky when dealing with multiple TCP/IP alias objects. The script objects to start and stop the database should be placed into the same group as the TCP/IP alias name for each database server that uses a particular TCP/IP alias name.

ProService Startup/Shutdown Script Examples

The following are examples of scripts that can be used to start and stop ProService. The scripts are stored on a shared disk, which is assigned the drive letter S. The Failover Object is configured to run the scripts for start and stop, respectively:

StartProService.cmd
StartProService.cmd 
ECHO OFF 
REM This is a Cluster Startup Script for the Cluster Failover Manager to  
REM execute when the cluster has a problem. Its primary purpose is to restart 
REM ProService if it isn’t already started on the node. 
SET LOG=S:\ProgressScripts\StartProService.log 
ECHO "Running on %COMPUTERNAME%" >> %LOG% 
DATE /T >> %LOG% 
%DLC\bin\PCCMD.EXE ProService Status >> %LOG% 
IF %ERRORLEVEL% == 1 GOTO notstarted 
  ECHO “ProService already running >> %LOG% 
  GOTO done 
:notstarted 
ECHO "Starting ProService"  >> %LOG% 
%DLC%\bin\PCCMD.EXE ProService Start >> %LOG% 
ECHO "Return value from start is %ERRORLEVEL%" >> %LOG%  
:done 

StopProService.cmd
ECHO OFF 
REM This is a Script for the Cluster Failover Manager to execute when the 
REM cluster has a problem. Its primary purpose is to Stop ProService if 
REM it isn’t already stopped on the node. 
SET LOG=S:\ProgressScripts\StopProService.log 
ECHO "Running on %COMPUTERNAME%" >> %LOG% 
DATE /T >> %LOG% 
%DLC\bin\PCCMD.EXE ProService Status >> %LOG% 
IF %ERRORLEVEL% == 1 GOTO notstarted 
  ECHO "Shutting down ProService" >> %LOG% 
  %DLC%\bin\PCCMD.EXE ProService Stop >> %LOG% 
  ECHO "Return value from shutdown is %ERRORLEVEL%" >> %LOG% 
  GOTO done 
:notstarted 
ECHO "ProService is already shutdown >> %LOG% 
:done 

Specific Database Startup/Shutdown Script Examples

Within ProService startup or shutdown scripts, or within a separate script, once ProService has started, then specific database servers can be started. Conversely, before ProService is shut down, the database servers should be shut down as well.

If you have multiple databases, you might want to create a generic script that can be run with an input parameter for the database name.

The following examples assume that you have set up ProControl to have a database server identified as CluDemo1. (Note it is very important to match the case between the script and ProControl.) If the scripts are contained within the ProService startup/shutdown scripts (either directly or through a reference call), then only one object needs to be added to the Failover Group. However, if they are separate scripts, then multiple objects are needed for each database to be started/shut down by the Failover Group.

The following are code fragments to Start and then Stop the Progress database server for database CluDemo1. The code assumes the same as the Start and Stop ProService examples above with the cluster shared disk as drive letter S:

StartCluDemo1.cmd
ECHO OFF 
REM This is a Script for the Cluster Failover Manager to execute when the 
REM cluster has a problem. 
REM It’s primary purpose is to Start the Database server for CluDemo1. 
SET LOG=S:\ProgressScripts\StartCluDemo1.log 
ECHO "Running on %COMPUTERNAME%" >> %LOG% 
DATE /T >> %LOG% 
%DLC%\bin\pccmd.exe Database Status CluDemo1 >> %LOG% 
IF %ERRORLEVEL% == 1 GOTO startcludemo1 
    ECHO "Server for CluDemo1 already started" >> %LOG% 
    GOTO done cludemo1start 
:startcludemo1 
    ECHO "Starting database server for CluDemo1" >> %LOG% 
    %DLC%\bin\PCCMD.EXE Database Start CluDemo1  
    ECHO "Return value from startup is %ERRORLEVEL%" >> %LOG% 
:donecludemo1start 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095