7.5 pgAgent

Table of Contents Previous Next



The Advanced Server installer creates the scheduling tables required by the pgAgent service under schema pgagent. If you are installing Advanced Server in Compatible with Oracle mode (the default), the scheduling tables are created in the edb database; if you are installing in PostgreSQL mode, the tables are created in the postgres database.
To use the DBMS_JOB package compatible with Oracle databases from a database other than the edb database, you must install the pgAgent schema into each additional database in which you wish to schedule jobs. To install the pgAgent schema, you must:
2) Invoke the pgagent.sql script.
When installed with the RPM package, the pgagent.sql script is located in /usr/share/ppas95-pgagent-3.4.1. When installed with the interactive installer, the script is located in /opt/PostgresPlus/9.5AS/share/extension.
If you installed Advanced Server using the interactive installer, pgAgent is installed as well. The pgagent program is installed under the bin subdirectory of the Advanced Server installation directory along with the required startup scripts, subdirectories for logging, etc.
Similarly, if you installed Advanced Server using the ppas95 RPM package or the ppas95-pgagent RPM package, pgAgent is installed. The pgagent program is installed under the bin subdirectory of the Advanced Server installation directory along with the required startup scripts, subdirectories for logging, etc.
As already stated, when the interactive installer is used, the pgagent schema and its scheduling tables are created in either the edb database or the postgres database.
When the RPM package is used, the pgagent schema and its scheduling tables are not automatically created. The scheduling tables must be created by connecting to the desired database and executing the pgagent.sql script as previously described.
When the interactive installer is used, a script named servicemanager.sh along with other supporting files is installed under the installer/pgAgent subdirectory of the Advanced Server location for providing an alternative method for managing pgAgent.
The servicemanager.sh script can be used to install pgAgent, uninstall pgAgent, start the pgAgent service, stop the pgAgent service, or disable the automatic startup of pgAgent.
Note: The servicemanager.sh script is only provided when the interactive installer is used, and the same functionality provided by this script can be accomplished using the methods described in Chapter 5.
When invoking the servicemanager.sh script, the current working directory from where the script is invoked must be /opt/PostgresPlus/9.5AS/installer/pgAgent.
If for whatever reason, you need to reinstall pgAgent using the servicemanager.sh script, you must create the pgpass file in the following directory:
hostname specifies name of the Advanced Server host.
port specifies the port on which the Advanced Server host is listening.
database specifies the name of the database.
username specifies the name of an Advanced Server user.
password specifies the password of the database in which the scheduling table resides.
After creating the pgpass file, execute the following commands as the root user to install the pgAgent service and create the startup file. The script configures the pgAgent executor to run in the background at system startup.
./servicemanager.sh component_name user_name install_dir service_name action_type version data_dir pg_host pg_port pg_user pg_database
component_name - Specify pgAgent.
user_name - Specify the Linux operating system account that runs Advanced Server. For example, this is enterprisedb if installed with the mode compatible with Oracle databases. This is postgres if installed with the mode compatible with PostgreSQL databases.
install_dir - Specify the Advanced Server installation directory.
service_name - Specify ppas-agent-9.5.
action_type - Specify install to install pgAgent, uninstall to uninstall pgAgent, start to start up the pgAgent service, stop to stop the pgAgent service, or disable_autostart to prevent automatic startup of the pgAgent service.
version - Specify 9.5.
data_dir - Specify the Advanced Server data directory (for example, /opt/PostgresPlus/9.5AS/data).
pg_host - Specify the name or IP address of the target database server's host.
pg_port - Specify the port number of the target database server.
pg_user - Specify the name of the database user listed in the pgpass file (for example, enterprisedb).
pg_database - Specify the name of the target database.
After installing the service, you should remove the password from the pgpass file so that the password is not available to other users.
pgagent INSTALL service_name [options] connection_string
service_name specifies the name of the pgAgent service.
specifies a logging verbosity. Specify a 0 to log ERROR messages, 1 to log WARNING messages, or 2 to log DEBUG messages. The default is 0
connection_string specifies connection information for an Advanced Server host.
Connecting as user enterprisedb.
Using the password 1safepassword.
You can optionally include the REMOVE keyword to remove a pgAgent service:


Table of Contents Previous Next