Starting and Stopping PSUB
In this section:
- Starting and Stopping PSUB Manually in UNIX
- Starting and Stopping PSUB Automatically in UNIX
- Starting and Stopping PSUB Manually in Windows
- Starting PSUB Automatically in Windows
Parent topic: Managing Batch Jobs
Starting and Stopping PSUB Manually in UNIX
In this section:
Parent topic: Starting and Stopping PSUB
Starting PSUB Manually in UNIX
To start the PSUB service on UNIX:
-
Log in as the opapps user. By default, the opapps uses the C shell.
-
Set environment variables for the database name and code environment; see Setting Environment Variables on the Command Line
-
Start the PSUB service:
start_psub
database_name code_environment wallet_alias
For example:
start_psub prod 52 prod
where prod is the connect string for the database instance to which the PSUB service connects;
where 52 is the name of the code environment;
where wallet_alias is the name of the Wallet specified during installation. By default it is the same as the database name.
-
If there are any errors, check the following log files in the $RXC_CENTRAL_LOG directory:
-
rxcpsd_instance_environment_1.log
-
rxcpsd_instance_environment_2.log
-
Parent topic: Starting and Stopping PSUB Manually in UNIX
Stopping PSUB Manually in UNIX
The preferred way to stop the PSUB service is with the following utility, from the opapps account, after setting the correct environment. You need to be sure the TNS_ADMIN environment variable is set to the location of the sqlnet.ora file. The Installer puts sqlnet.ora in the opapps Home directory; see Setting TNS_ADMIN on UNIX.
Use the echo command to check the setting, then stop PSUB.
echo $TNS_ADMIN setenv TNS_ADMIN $HOME stop_psubdatabase_name][environment
Wallet_alias
Parent topic: Starting and Stopping PSUB Manually in UNIX
Starting and Stopping PSUB Automatically in UNIX
On UNIX systems, you can automate the process of starting and stopping PSUB. See the following:
Parent topic: Starting and Stopping PSUB
Starting PSUB Automatically in UNIX
The following example shell scripts for Sun Solaris show how to make the process start automatically at system startup:
# File: /etc/init.d/dbora ORA_HOME=/u01/app/oracle/product/12.1.0.2 ORA_OWNER=oracle if [ ! -f $ORA_HOME/bin/dbstart -o ! -d $ORA_HOME ] then echo 'Oracle startup: cannot start' exit fi case "$1" in 'start') echo 'Starting Oracle...' su - $ORA_OWNER -c $ORA_HOME/bin/dbstart su - $ORA_OWNER -c "lsnrctl start" su - opapps -c start_psub ;; 'stop') echo 'Stopping Oracle...' su - opapps -c stop_psub su - $ORA_OWNER -c $ORA_HOME/bin/dbshut ;; esac # File: start_psub # Start database 1 start_psubdb_name1 code_environment wallet_alias
# Start database 2 start_psubdb_name2 code_environment wallet_alias
For example:
# Start database 1 start_psub venus 52wallet_alias
# Start database 2 start_psub pluto 52wallet_alias
where the database names are venus and pluto and you have installed Oracle Clinical 5.2.
Parent topic: Starting and Stopping PSUB Automatically in UNIX
Stopping PSUB Automatically in UNIX
You can automate the shutdown of the PSUB service on UNIX so that it does not require the entry of a password.
The following example shell scripts for Sun Solaris show how.
# File: /etc/init.d/dbora
ORA_HOME=/u01/app/oracle/product/12.1.0.2
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart -o ! -d $ORA_HOME ]
then
echo 'Oracle startup: cannot start'
exit
fi
case "$1" in
'start')
echo 'Starting Oracle...'
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
su - $ORA_OWNER -c "lsnrctl start"
su - opapps -c start_psub
;;
'stop')
echo 'Stopping Oracle...'
su - opapps -c stop_psub
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
;;
esac
# File: stop_psub
# Stop database 1
set TNS_ADMIN= opapps_home_dir export TNS_ADMIN stop_psub venus 52wallet_alias
# Stop database 2
stop_psub pluto 52wallet_alias
where the database names are venus and pluto and you have installed Oracle Clinical 5.2.
Parent topic: Starting and Stopping PSUB Automatically in UNIX
Starting and Stopping PSUB Manually in Windows
In this section:
Parent topic: Starting and Stopping PSUB
Installing PSUB in Windows
On Windows, you must first install the PSUB process as a service:
-
Log in to the Windows server as Administrator or as a user with administrative privileges.
-
Open a Command Prompt window:
-
If you logged in as Administrator, click Start, then Run, then enter
cmd
. -
If you logged in as a different user with administrative privileges, click Start, type
cmd
in the Start search box, then right-click cmd in the list and click Run as administrator.
-
-
Enter the following commands:
set p1=database-connect-string set p2=code-environment opa_setup cd %RXC_BIN% rxcpsdps -install database-connect-string database-instance-name
-
Navigate to Start, then Administrative Tools, then Services.
-
In the Services window, right-click on the PSUB service, then click Properties. The PSUB Service Properties window opens.
-
In the General tab, set the Startup Type to Manual.
-
In the Log On tab, select This Account, then click Browse.
-
Enter:
opapps
, then click Check Names. The system enters the relative location to opapps. -
Click OK. The system returns to the PSUB Service Properties window.
-
Enter and confirm the opapps password, and click OK.
-
Log out from this Administrator session.
Parent topic: Starting and Stopping PSUB Manually in Windows
Starting PSUB Manually in Windows
To start the PSUB service on Windows:
-
Log in as opapps. (You set up the PSUB service to start as the opapps user, but in Windows you can start the service when logged on as another user.)
-
Set the PSUB service parameters:
-
In the Start menu, navigate to Administrative Tools, then Services.
-
From the list of services in the Services dialog box, double-click the name of the database for this service. It is in this form:
PSUB Service database
-
Enter values for the Log On parameters:
database code_environment
[verbose | noverbose]
value-of-RXC_ROOT
wallet_alias
For example:
prod 52 verbose c:\\opapps\\oc\\52 <
Wallet_name
>
where prod is the connect string for the database instance to which the PSUB service connects;
where 52 is the name of the code environment;
where wallet_alias is the name of the Wallet specified during installation.
Note:
If your entry requires a backslash (\), you must enter two (\\). Alternatively, you can enter the path using single forward slashes, for example, c:/OPA_HOME/oc/52.
-
-
Click Start.
-
Exit from the Services dialog box.
-
Check the PSUB service log file in <RXC_ROOT>/log for any warning or error messages.
Parent topic: Starting and Stopping PSUB Manually in Windows
Stopping PSUB Manually in Windows
Do not use Enterprise Manager to stop opapps sessions on Windows; instead, use the Control Panel on the appropriate local machines.
To stop the PSUB service:
-
Log in as the PSUB user; in this case, opapps.
-
Open the Services control panel.
-
In the Services dialog box, select the PSUB service for the particular database and open the Properties window. The PSUB service for the venus database, for example, might appear as:
psub service venus
-
In the Properties window, click Stop.
Parent topic: Starting and Stopping PSUB Manually in Windows
Starting PSUB Automatically in Windows
You must first install PSUB; see Installing PSUB in Windows.
The batch file is required in large databases that take so much time to come up during a server reboot so that the system tries to start PSUB before the database is fully up. In this case the PSUB service does not start and an error like the following appears in the PSUB log file (found in the drive:\opapps\oc\52\log directory):
ERROR:Daemon error while connecting:/@devoc ORA-1033: ORACLE initialization or shutdown in progress
For more information, see:
- Creating a System Environment Variable
- Creating a Batch File
- Scheduling the Batch File and Testing the Setup
- Adding a Shortcut
Parent topic: Starting and Stopping PSUB
Creating a System Environment Variable
You can specify that the PSUB service starts automatically when the Windows PSUB server re-boots. The service parameters are read from a system environment variable whose name concatenates PSUBSERVICE
with the database name.
To create a system environment variable in Windows:
-
Navigate from Start to the Control Panel, then click on the System and Security link. The System and Security window opens.
-
Click the System link. The System window opens.
-
Click the Advanced System Settings link at the top left corner. The System Properties window opens.
-
Select the Advanced tab, then click Environment Variables.
-
Click New under System Variables in the lower portion of the window to define the variable.
For the variable name, enter the string
PSUBSERVICE
concatenated with the database name; for example, for the database sun6x2:PSUBSERVICESUN6X2
For the variable value, use the format:
database_id code_environment
verbose
RXC_ROOT
wallet_alias
; for example:pluto 52 verbose t:\\opapps\\oc\\52
wallet_alias
where pluto is the database ID and RXC_ROOT is t:\opapps\oc\52.
Note that if you need a backslash (\) in the text box, you must double it (\\).
Parent topic: Starting PSUB Automatically in Windows
Creating a Batch File
Create a batch file called 'psub_start1.bat' in the %RXC_ROOT%/log directory (for example, D:\opapps\oc\52\log) with the following contents.
cmd /c echo Current Date/time= %DATE% %TIME% > psub_start1.log
cmd /c echo Starting Time Delay > psub_start1.log
ping localhost -n 180 > nul
cmd /c net start "PSUB Service database_id" > psub_start1.log
Notes:
-
"PSUB Service database_id" is the PSUB service name that appears in the Services window (under Administrative Tools from the Control Panel).
-
You can repeat the following command for different databases if needed:
cmd /c net start "PSUB Service database_id" > psub_start1.log
-
The 'ping localhost' command introduces a time delay to ensure that the database is up before starting PSUB. You can increase this value—set to 180 seconds (3 minutes) in the example above—if required.
Parent topic: Starting PSUB Automatically in Windows
Scheduling the Batch File and Testing the Setup
To schedule batch file execution:
-
Navigate to Start, then Administrative Tools, then Services. Scroll down and make sure that the Task Scheduler service is started.
-
Navigate to Start, then Administrative Tools, then Task Scheduler. The Task Scheduler window opens.
-
Click the Create Basic Task link on the right. The Create Basic Task wizard appears.
-
Enter a Name and Description and click Next.
-
In the Task Trigger window, select When the computer starts and click Next. The Action window appears.
-
In the Action window select Start a program and click Next. The Start a Program window appears.
-
In the Start a Program window, click Browse. The Browse window appears.
-
In the Browse window, browse to the directory where psub_start1.bat is saved and then select psub_start1.bat. Leave the other boxes empty and click Next.
-
Select Open the Properties dialog for this task when I click Finish and click Finish. The Properties dialog box opens.
-
In the Properties dialog box, General tab, Security options section, click Change User or Group and select Administrator.
To test, shut down the service if necessary (see Stopping PSUB Manually in Windows) and double-click on file psub_start1.bat to test that it starts the PSUB service. Verify that the log file psub_start1.log is created in the same directory unless a different path was specified.
-
In the Services window under Administrative Tools in the Control Panel, right-click the PSUB Service, click Properties, and change its Startup Type to Manual.
To test, restart the computer and check the Services window to see if the PSUB service has started. If it has, submit a PSUB job such as Batch Validation and check if it runs.
Parent topic: Starting PSUB Automatically in Windows
Adding a Shortcut
For convenience add a shortcut for psub_start1.bat on the desktop to manually start PSUB by double-clicking the icon.
Parent topic: Starting PSUB Automatically in Windows