The method of execution of the SQDaemon is platform specific.
z/O - Typically as a Started Task or Job:
//SQDAEMON JOB 1,MSGLEVEL=(1,1),MSGCLASS=H,NOTIFY=&SYSUID
//*
//*-----------------------------------------------------------------
//* Execute the z/OS SQDAEMON Controller in Batch
//*-----------------------------------------------------------------
//* Parms Must be Entered in lower case
//*
//* --service=port_number
//* Where port_number is the number of a TCP/IP port that will be
//* used to communicate to the Controller Daemon
//* ** Note: If this parm is omitted, here and in the
//* sqdagents.cfg file, the default port will be 2626 **
//*
//* -d zfs_dir
//* Where zfs_dir is the predefined working directory used by
//* the controller
//* EXAMPLE:
//* /home/sqdata/daemon - the controller's working directory
//* and its required cfg and optional logs sub-directories:
//*
//* /home/sqdata/daemon/cfg - must contain 1 file:
//* sqdagents.cfg - contains a list of
//* capture/publisher/engine agents to
//* be controlled by the daemon
//*
//* - and optionally:
//* acl.cfg - used for acl security
//* /home/sqdata/daemon/logs - used to store log files used by the
//* controller daemon
//*
//*********************************************************************
//*
//JOBLIB DD DISP=SHR,DSN=SQDATA.V400.LOADLIB
//*
//SQDAEMON EXEC PGM=SQDAEMON
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SQDLOG DD SYSOUT=*
//*SQDLOG8 DD DUMMY
//*
//SQDPUBL DD DISP=SHR,DSN=SQDATA.NACL.PUBLIC
//SQDPKEY DD DISP=SHR,DSN=SQDATA.NACL.PRIVATE
//SQDAUTH DD DISP=SHR,DSN=SQDATA.NACL.AUTH.KEYS
//*SQDPARMS DD DISP=SHR,DSN=SQDATA.V400.PARMLIB(SQDAEMON)
//SQDPARMS DD *
--service=2626
--tcp-buffer-size=262144
-d /home/sqdata/daemon
/*
//
sqdagents.cfg
file described above rather than specifying them in the JCL. The exception to this recommendation is when multiple Controller Daemon's are running on the same machine. In that case --service=port_number must be specified for at least one of the Daemons.Linux - A shell script:
Starting the Controller Daemon requires only the SQDAEMON command. A shell script is commonly created containing commands for this purpose.
$ sqdaemon --service=<Port_number>
--tcp-buffer-size=<buffer_size>
--[ipv4] | [ipv6]
-d <SQDATA_VAR_DIR>/daemon
Keyword | Description |
---|---|
--service=<Port_number> | The TCP/IP port that will be used to communicate with the Controller Daemon. The default if not specified is 2626. |
--tcp-buffer-size=<buffer_size> | The size of the TCP/IP send buffer that will be created for the socket initially established by the controller daemon and a requesting Apply Engine before that socket is transferred to the CDCStore Publisher. The recommended number is 262144. |
--[ipv4] | [ipv6] | The TCP/IP protocol used by the Controller Daemon. connection. The operating system default will be used if not specified. |
-d <SQDATA_VAR_DIR>/daemon | The working directory of the Controller Daemon. |
Example
$ sqdaemon --service=2626 --tcp-buffer-size=262144 -d <SQDATA_VAR_DIR>/daemon
Windows - Either a batch file:
Starting the Controller Daemon requires only the SQDAEMON command. A batch script can be created with the optional parameters.
$ sqdaemon --service=2626 --tcp-buffer-size=262144 --[ipv4] | [ipv6] -d <SQDATA_VAR_DIR>/daemon
Windows - Or as a system service:
A program to register Controller Daemon (sqdaemon) as a windows service is included in the distribution. This is the preferred method for starting/stopping the sqdaemon on windows. When adding the daemon as a service, you need to use an elevated administrator command prompt. Open a command windows by Right clicking on a Command prompt shortcut and choose "Run as Administrator":
- To add sqdaemon as a service:
> sqdsvc.exe [-install | /install]
- To remove sqdaemon as a service:
> sqdsvc.exe [-remove | /remove]
• To specify a log level for the daemon to run with:.
> sqdsvc.exe [-install | /install] --log-level=8
After -install or -remove verify the service has truly been installed/removed by trying to locate the sqdaemon process in the "Services" list. If the install/remove command did not work properly verify you have logged on with the "ADMINISTRATOR" account.
- In the "Services" window, find "sqdaemon" in the list. "Services" are usually found under "Administrative Tools".
- Right click on "Properties".
- Find the tab that lets you define the user to "log on as" for that process.
- Enter the username/password for the user that you want the daemon to run as. This user must have admin privileges. If you try to run with a user with lesser privileges you will get an message "Error: Access is Denied". When the user has been successfully accepted a message will pop up saying the user has been granted "Log on a Service" privileges.
- In the "Services" list window, find "sqdaemon" in the list.
- Right click on "sqdaemon" and choose start/stop. The daemon is now running.
Notes:
- Environment variables that are needed to run any engine under the daemon, like PATH, ORACLE_HOME,and the SQDAEMON_DIR, need to be setup before the sqdaemon is started.
- SQDaemon gets a copy of the environment variables at startup and never reacquires them without bouncing the daemon.
- The program used to register sqdaemon as a service (sqdsvc) will not install the daemon as a service if SQDAEMON_DIR is not present in the environment variables.