Skip to main content
AskMe (beta)
Loading icon

HS.HC.SYS.Mirror

class HS.HC.SYS.Mirror extends %Library.RegisteredObject

This is a utility to setup mirroring of the HSSYS database with minimal user interaction.
Two methods are offered:
RunValidate() can be used to ensure the configuration will support setting up mirroring before actually executing the process. The RunValidate method can be useful to ensure it is valid before scheduling off peak updates. The actual update does not take long, but will set Switch 10 (suspending the system) while taking a copy of the HSSYS database.
Run() executes the validation code and then performs the update by setting Switch 10 while the HSSYS database is being copied on the primary.

The full process entails ensuring that mirroring HSSYS will not cause any loss of data from HSSYS by first ensuring all configured foundation namespaces exist on both systems, and ensuring that there is no FHIRSQL data stored in the HSSYS database. The code also checks to see that HSSYS does not exceed 1GB in size (a reasonable assumption, a requirement to ensure the primary is not suspended for excessive amounts of time to copy the database).
Before making changes on either system, Ensure HSSYS isn't already mirrored, Ensure the HS_Services user is enabled (don't enable it, allow the user to set passwords). Backup %SYS("HealthShare"), add mirroring to HSSYS, backup HSSYS database and copy to backup member. Restore HSSYS on backup member and enable mirroring. Failover to complete the process. Ideally the various config item namespaces would be activated to ensure the cpf's (global mappings) are updated to be the same from I4H / HC perspective

Method Inventory

Parameters

parameter CONNECTION = MirrorHSSYS;
parameter COPYFILENAME = COPY_IRIS.DAT;

Methods

classmethod Run(pHostname As %String = "", pSuperServerPort As %Integer = 1972, pNamespace As %String = "HSCUSTOM", pUsername As %String = "", pPassword As %String = "", pVerbose As %Boolean = 1) as %DynamicObject
@API Execute setting up HSSYS as a mirrored database. This is required to be run from the backup member
@argument pHostName The the host fqdn or ip address of the Primary host
@argument pSuperServerPort The super server port number of the primary instance
@argument pNamespace Defaulted to HSCUSTOM, this needs to be a HS mapped namespace, not HSSYS, and must be writable (to created the stored procedures)
@argument pUsername Username for an authorized user
@argument pPassword Password for an authorized user
@argument pVerbose 1/0 whether to display informational messages
@returns DynamicObject A dynamic object containing any status information with nodes described below
done a boolean true/false indicating the completion of the mapping of HSSYS
messages an array of success messages (strings) for completed steps
errors an array of objects with properties code, text, stack
classmethod RunValidate(pHostname As %String = "", pSuperServerPort As %Integer = 1972, pNamespace As %String = "HSCUSTOM", pUsername As %String = "", pPassword As %String = "", pVerbose As %Boolean = 1) as %DynamicObject
@API Validate that it is possible to setup HSSYS as a mirrored database. This step can be called before executing Run() but is not necessary, Run() will also validate before continuing the configuraiton.
This is required to be run from the backup member
@argument pHostName The the host fqdn or ip address of the Primary host
@argument pSuperServerPort The super server port number of the primary instance
@argument pNamespace Defaulted to HSCUSTOM, this needs to be a HS mapped namespace, not HSSYS, and must be writable (to created the stored procedures)
@argument pUsername Username for an authorized user
@argument pPassword Password for an authorized user
@argument pVerbose 1/0 whether to display informational messages
@returns DynamicObject A dynamic object containing any status information with nodes described below
done a boolean true/false indicating the potential completion of the mapping of HSSYS
messages an array of success messages (strings) for completed steps
errors an array of objects with properties code, text, stack

Inherited Members

Inherited Methods

FeedbackOpens in a new tab