Monitoring Shareplex Using Scripts
Monitoring Shareplex Using Scripts
Page 1
din 5
Sp_ps monitors shareplex processes and notifies if one, or more are stopped # Startmode: # nohup sp_ps 'sp_cop' MULTI_SOURCE >/dev/null 2>&1 # Usage: # sp_ps 'sp_cop -uname' CONFIGURATION & # where # 'sp_cop -uname' is the name of a specific sp_cop with the -u notation and typically # the port number that particular sp_cop is listening on. # CONFIGURATION The valid values are MULTI_SOURCE, SOURCE, and TARGET. This refers to # the configuration of the SharePlex instance being monitored. # A particular SharePlex instance can be configured to be SOURCE or # ,a TARGET or slave and MULTI_SOURCE in which case it send and receive changes. # & If the program is not started as a background process then the user # will not regain control of the shell. # # Dependencies: # The script uses mailx program to send e-mails. Before using the script make # sure the mailx is configured on the host on which this script will be deployed # and can successfully send mail.
Sp_qstatmon - monitors the Shareplex qstatus and report the backlog if it crosses the threshold. This enables you to take corrective actions before queues exceed available disk space. # Usage: # sp_qstatmon [-t n] [-v path] [-p port number] [-c integer] [-d integer] [-e integer] [-m] # where # -t specifies the time interval between successive scans every n seconds. # This parameter is optional and if not specified defaults to 60 seconds. # -p specifies the port number that SharePlex instance is attached to. # This parameter is optional and if not specified defaults to 2100. # -v specifies the path to the appropriate data directory for SharePlex. # This parameter is mandatory, the script will fail if not specified. # -m specifies that a user should be notified via e-mail. # This parameter is optional and by default no mail will be sent. # -c specifies the threshold number for the messages in capture queue. # This parameter is optional and if not specified defaults to 100. # -d specifies the threshold number for the messages in post queue. # This parameer is optional and if not specified defaults to 100. # -e specifies the threshold number for the messages in export queue. # This parameer is optional and if not specified defaults to 100. # & If the program is not started as a background process then the user # will not regain control of the shell. # # # Dependencies: # The script uses mailx program to send e-mails. Before using the script make # sure the mailx is configured on the host on which this script will be deployed # and can successfully send mail. Make sure that sp_ctrl utility is also installed # into the same directory as this script, since this script is dependent on sp_ctrl
Page 2
din 5
# # #
for functioning. Also, it creates a couple of temp files in the same directory as the one in which it resides. make sure the executing the script has write permission to that directory.
Page 3
din 5
END;
On the destination: On the destination you must create as many tables as post queues defined. DROP TABLE heartbeat_q1 CASCADE CONSTRAINTS; --- heartbeat_q1 (Table) -CREATE TABLE heartbeat_q1 ( ID NUMBER, TIMESTAMP DATE, DELAY NUMBER ) LOGGING NOCOMPRESS NOCACHE NOPARALLEL NOMONITORING; CREATE OR REPLACE TRIGGER T_CALC_DELAY BEFORE INSERT OR UPDATE ON heartbeat_q1 REFERENCING NEW AS NEW OLD AS OLD FOR EACH ROW DECLARE tmpvar NUMBER; /****************************************************************************** NAME: PURPOSE: REVISIONS: Ver Date Author Description --------- ---------- --------------- -----------------------------------1.0 4/10/2008 Mihai Ghita 1. Created this trigger. NOTES: ******************************************************************************/ BEGIN tmpvar := 0; SELECT (SYSDATE - :NEW.TIMESTAMP) * 24 * 60 * 60 INTO tmpvar FROM DUAL; :NEW.DELAY := tmpvar; EXCEPTION WHEN OTHERS
Page 4
din 5
THEN NULL; END; / Modify the configuration file to add the following lines:
SPLEX.HEARTHBEAT SPLEX.HEARTHBEAT SPLEX.HEARTHBEAT SPLEX.HEARTHBEAT SPLEX.HEARTHBEAT SPLEX.HEARTHBEAT SPLEX.HEARTHBEAT SPLEX.HEARTHBEAT SPLEX.HEARTHBEAT SPLEX.HEARTHBEAT_ Q_DAY_1 SPLEX.HEARTHBEAT_ Q_DAY_2 SPLEX.HEARTHBEAT_ Q_DAY_3 SPLEX.HEARTHBEAT_ Q_DAY_4 SPLEX.HEARTHBEAT_ Q_DAY_5 SPLEX.HEARTHBEAT_ Q_MONTHLY_1 SPLEX.HEARTHBEAT_ Q_BILLDAY_1 SPLEX.HEARTHBEAT_ Q_BILLDAY_2 SPLEX.HEARTHBEAT_ Q_BILLDAY_3 hebe.mis.orange.intra:Q_DAY_1@o.dwdx hebe.mis.orange.intra:Q_DAY_2@o.dwdx hebe.mis.orange.intra:Q_DAY_3@o.dwdx hebe.mis.orange.intra:Q_DAY_4@o.dwdx hebe.mis.orange.intra:Q_DAY_5@o.dwdx hebe.mis.orange.intra: Q_MONTHLY_1@o.dwdx hebe.mis.orange.intra: Q_BILLDAY_1@o.dwdx hebe.mis.orange.intra: Q_BILLDAY_2@o.dwdx hebe.mis.orange.intra: Q_BILLDAY_3@o.dwdx
Page 5
din 5