Software User's Guide
DRMS - Disaster Recovery Mirroring System

Table of contents

  1. Introduction
    1. Mirroring VOS to other platforms
    2. Scalability
    3. Hands-off operations
    4. Simplicity
    5. Batch Commands
    6. Monitoring and reporting
    7. Performance
    8. How does DRMS work?
  2. Components and data flow
  3. Supported system calls
  4. The Control Table (drms.table)
    1. record_type
    2. run_on_module
    3. priority
    4. tcp_host
    5. tcp_port
    6. max_buffer_len
    7. primary_call_timeout
    8. max_file_errors
    9. log_statistics_on_close
    10. tp_abort_timeout
    11. substitute_system_name
    12. appl_show_stats
    13. appl_mirror_default_output
    14. appl_send_alerts_to_25th_line
    15. appl_send_alrets_to_syserr_log
    16. check_file_at_open,check_file_at_close
    17. check_file_interval
    18. use_tp
    19. appl_q_timeout
    20. primary_max_buffers
    21. appl_max_buffers
    22. user_application_q_timeout
    23. use_yield_processor
    24. sort_buffer
    25. no_of_queues
    26. replace_special_chars
    27. qmon_warn_at
    28. disable_drms
    29. resume_at_q_depth
    30. keep_trying
    31. trace_level
  5. Configuration example using a single queue
  6. The DRMS Files Table (drms_files.table)
    1. record_type
    2. process_name
    3. source_path
    4. destination_dir
    5. drms_server
    6. in_any_directory
    7. auto_synchronize
    8. dont_send_reads
    9. extractor_file_id
    10. equalize_interval
    11. equalize_if_new
    12. equalize_if_modified
    13. equalize_if_locked
    14. report_orphans
    15. delete_orphans
  7. DRMS' Administration
  8. The DRMS Syncronize program
  9. Running the DRMS_DEMO Application
  10. Getting Started
  11. DRMS Files & Logs
  12. DRMS-Extractor - mirroring to external platforms
    1. A complete Example
  13. Mirroring VM Regions
  14. Troubleshooting
  15. The DRMS_DEMO Program
  16. Important Operation considerations
    1. Preparations
    2. Starting the DRMS/Application
    3. Scheduled shutdowns


Introduction

Today's sad news is that the disasters of the 20th century seem somehow comforting in the face of disasters from the 21st. We know we can survive the tragedies, the question is how to survive the mess. Disasters may come in the form of a server crash, power outage, a cut in communications cables, a fire, or natural disaster. An outage always disrupts your business, causing a loss of productivity, critical information, or worse, a loss of revenue. Whatever the cause, you need to minimize data loss by restoring access to your files as quickly as possible and when downed servers are restored, their respective files need to be restored as well.

The risks and the devastating effects of disasters resulting in computer downtime are obvious and always pose a pressing issue to any business running critical applications. Business organizations demand 100% fault tolerance and continuous availability of their computing systems. Relying on traditional, full system backups means that any critical data and transactions executed after the last system backup are lost forever. The use of traditional backups also means that data at the remote site always lags behind, so that the remote computers can not be used for online production processing and can only be utilized in course of a disaster-recovery scenario. For this reason, these vital and expensive resources are idle while the primary computer, in many cases, is over-loaded and suffering from deteriorated performance.

DRMS is a software solution that provides reliable, bi-directional real-time data backup and mirroring over existing Stratus networks. At any given time, all critical remote databases are identical to the primary database, which ensures rapid and reliable application recovery. Networked computers mirror each other providing flexible, scaleable load-balancing solution utilizing the full computing capacity of the hardware at both the primary and remote locations. DRMS replicates sequential, fixed, relative and stream files (including transaction-protected files) as well as, one-way-server-queue and message queues. DRMS dynamically detects and replicates newly created critical files so that no configuration changes are necessary. The internal design of DRMS puts great emphasis on protecting the business application and on preserving the primary computer's current performance. DRMS is external to the business application and requires absolutely no application or any software changes - its operation is completely transparent to the user.

There are other considerations and reasons for mirroring critical databases:

Mirroring VOS to other platforms DRMS can be used to mirror data into any SQL databases that may reside on any platform via TCP/IP. Based on known data layouts and user-provided templates, DRMS can be used to convert any VOS data into standard text-only formats such as comma-delimited, XML etc. Such output is then transmitted to remote ODBC databases or written to local VOS files or queues for further processing. Scalability As a software-only solution, DRMS offers total configuration flexibility and scalability. Any number of modules can mirror each other. The administrator can select and identify critical data files, directories or disks - all within DRMS' configuration. DRMS can simultaneously mirror critical data in any direction (A-to-B, B-to-A, B-to-C etc.). DRMS supports all VOS platforms and all VOS releases. Hands-off operations< DRMS is designed to run 24x7 without any human intervention. DRMS dynamically manages all aspects of error detection, handling and recovery including alternate routing and communication line switching - always utilizing the entire network bandwidth. Simplicity DRMS requires no application changes whatsoever. It is extremely simple to learn, implement and operate on a daily basis and requires no specific training. The implementation phase of the software can be completed within a few days, once all critical data files or directories have been identified and listed in DRMS' configuration table (DRMS uses only one TIN file!). DRMS requires no additional hardware as it utilizes existing networks and supports both TCP-IP and X.25 connections. Batch Commands DRMS replicates VOS internal commands, such as copy_file, move_file, rename, create_file etc. so that any after-hours batch cycles and command-macros are also mirrored accurately at the remote site. Monitoring and reporting The operator can monitor the system and all aspects of the data mirroring activities - number of I/Os, queuing operations, transaction throughput, processing rate etc. These monitors provide, at all times great sense of control over the system. DRMS maintains and reports activities both on system-level as well as on a per-file basis down to the lowest details of how many I/O operations were made on each critical file broken down by I/O type (write/update/delete etc.) Performance Since most of the processing takes place at the target system, DRMS has practically no impact on performance of the primary (sending) computer. How does DRMS work? During run-time, DRMS intercepts all I/O operations performed on files marked by the system administrator as "critical". After the I/O operation is completed, DRMS passes the information to the DRMS Server for transmission to the target system. The corresponding DRMS server on the target computer collects these messages and executes the I/O operation within the remote databases. The only additional work that a mirrored operation requires is the sending of the message to the DRMS queue. The entire operation is therefore completed with minimal impact on the end-user's program.


Components and data flow

Click to enlarge:

To achieve reliable data mirroring with minimal system overhead and better throughput, both the Primary and Backup systems will run the DRMS Server programs as background sub-processes. All input-output operations on the Primary system are detected within the user application. Based on simple configuration rules, any updates to files that are identified as "critical" are forwarded to the DRMS process. The DRMS on the Primary system acts as a server to the Primary user application and as a requester to the DRMS server running on the Backup system. The server on the Primary system is responsible for transmitting all relevant transactions to its partner DRMS process running on the Backup system. The server on the Backup system is responsible for accepting these transmissions and for applying updates to all critical Backup databases.

Communication between the two DRMS processes uses existing Stratanet or TCP-IP connections. The communication layer is designed to automatically recover any communication failures and reliably deliver each transaction without any user intervention. The system administrator can define and execute multiple pairs of DRMS processes. This allows for mirroring to more than one location, dual-direction mirroring or application specific mirroring.


Supported system calls

s$add_items$add_keys$attach_ports$close
s$controls$create_allocated_files$create_delete_record_indexs$create_file
s$create_indexs$create_record_indexs$delete_files$delete_index
s$delete_items$delete_keys$detach_ports$enforce_region_locks
s$get_items$keyed_deletes$keyed_lock_records$keyed_position
s$keyed_position_deletes$keyed_position_reads$keyed_position_rewrites$keyed_read
s$keyed_rewrites$keyed_unlock_records$keyed_writes$keyed_write_unlock
s$lock_files$lock_regions$msg_opens$msg_send
s$notify_paths$opens$read_raws$rel_delete
s$rel_lock_records$rel_positions$rel_position_delete$rel_position_read
s$rel_position_rewrites$rel_reads$rel_rewrites$rel_unlock_record
s$rel_writes$rel_write_unlocks$renames$seq_delete
s$seq_lock_records$seq_opens$seq_positions$seq_position_delete
s$seq_position_read$seq_position_rewites$seq_reads$seq_rewrite
s$seq_unlock_records$seq_writes$seq_write_partials$seq_write_unlock
s$set_expiration_dates$set_file_allocations$set_implicit_lockings$set_pipe_file
s$set_safety_switchs$truncate_files$truncate_open_files$unlock_file
s$unlock_recordss$writes$write_codes$write_partial
s$write_partial_codes$write_raws$write_wraps$write_wrap_indent
s$write_wrap_partials$set_transaction_files$start_transactions$start_priority_transaction
s$commit_transactions$abort_transactions$copy_files$clone_file

The Control Table (drms.table)


The Control Table (drms.table)

This drms.table defines all system Servers that participate in the DR activities. To create the control table, execute the create_table command using the drms.dd data definition file.
organization:		   relative; 
fields      :
record_type		   char (32) var,
run_on_module                 char (66) var,
priority                      bin (15) default ('8'),
tcp_host                      char (32) var,
tcp_port                      bin (15),
max_buffer_len                bin (15) default ('8196'),
primary_call_timeout          bin (15) default ('60'),
max_file_errors               bin (15) default ('50'),
log_statistics_on_close       bit (1)  default ('1'),
tp_abort_timeout              bin (15) default ('2'), 
substitute_system_name        char (32) var,
appl_show_stats               bit  (1),
appl_mirror_default_output    bit  (1),
appl_send_alerts_to_25th_line bit (1) default ('1'),
appl_send_alrets_to_syserr_log bit (1) default ('1'),
check_file_at_open            bit (1) default ('1'),
check_file_at_close           bit (1) default ('1'),
check_file_interval           bin (15),
use_tp                        bit (1)  default ('1'),
appl_q_timeout                bin (31) default ('2'),
primary_max_buffers           bin (15) default ('1000'),
appl_max_buffers              bin (15) default ('200'),
primary_q_read_timeout        bin (15) default ('120'),
user_application_q_timeout    bin (15) default ('5'),
use_yield_processor           bit (1)  default ('0'),
sort_buffer                   bin (15) default (30),
no_of_queues                  bin (15) default (1),
replace_special_chars         bit (1) default (1),
qmon_warn_at                  bit (15),
disable_drms		  bit default ('1'),
resume_at_q_depth	  	  bin (15) default ('10000'),
keep_trying		  bit default ('1'),
trace_level                   bin (15);
end;

Field Definitions

record_type Choose one of the following values:

GLOBAL_SETTINGS One Global-Settings record is always required. See details below.
PRIMARY Communications Server running on the Primary module.
BACKUP Communications Server running on the Backup module.
APPLICATION Application Server running on the Backup module.
EQUALIZER A server that periodically "Equalizes" files and directories. This feature addresses all non-transaction based files (source code). The Equalizer Server uses the drms_equalize.cm which is maintained by the user to FTP or copy_file files from the Primary to the Backup module. FTP may be used for ASCII/text files; for all other files, use the copy_file command provided that Stratanet is installed between the two modules.
DRMS_SYNC_VMA server that constantly replicates virtual-memory regions.

The PRIMARY and BACKUP processes handle all the communications aspects; APPLICATION process(es) apply the mirrored I/O on the backup machine.

run_on_module The module name on which the process will run. The 'start_servers' request (documented later) will scan the control table and start all processes belonging to the current-module
priority The priority under which the process will be started.
tcp_host The IP address of the Backup system. For more information on TCP-IP configuration, see VOS TCP System Administration Guide.
tcp_port The port number that will be used by the TCP connection. For more information on TCP-IP configuration, see VOS TCP System Administration Guide.
max_buffer_len Specifies the maximum size allocated for application I/O buffers.
primary_call_timeout Specifies that time, in seconds between each re-connection attempt by the Primary Server.
max_file_errors A number I/O errors allowed for each mirrored file. The HotBackup Server keeps track of all file I/O errors for each file. When the number of I/O errors exceeds the max_fille_errors threshold, error logging will be stopped.
log_statistics_on_close A yes/no switch indicating whether the system administrator is interested in transaction counts and statistics when files are closed. The DRMS server accounts for every system call (s$). When an application closes its files the Server is capable of reporting which calls were executed and how many times. This is useful and valuable information for capacity planning or application troubleshooting. The DRMS servers use a daily log (with a date extension) in the logs directory:

  • The Primary server uses: drms_primary.(date)
  • The Backup server uses: drms_backup.(date)
  • tp_abort_timeout Tp_abort_timeout is used only by the HotBackup software with applications that are using Transaction Protection. In the case that the transaction aborts, it specifies the time in 1/1024 seconds of wait time before attempting to re-apply the transaction.
    substitute_system_name Use this field to enter the name of the backups system. You should use this field ONLY if both the primary and backup systems are identical in their disk configuration. This feature will allow to leave the destination_dir empty and DRMS will substitute the primary system name with the backup system name.

    Example:

    The primary system is %prim#m1. The backup system is %back#m1 (and =substitute_system_name is set to 'back'...and in drms_files.tin we have the following entry:

    /=record_type       include
     =process_name      *
     =source_path       %prim#d03>PROD>data>my_critical_file
    

    ....then, the destination (mirrored) file will be set to:

    %back#d03>PROD>data>my_critical_file

    appl_show_stats When this switch is set, the application program will write file-level statistics to the [application].drms file. The information will include which files were used and a how many times each s$ call was used.
    appl_mirror
    _default_output
    In most cases it is not necessary to mirror the application's default output file on the Backup system. Default output files are typically temporary *.out files that are created when the process is started. The DRMS software is capable of mirroring these files as well. To activate this feature, set the variable to "1".
    appl_send_alerts
    _to_25th_line
    When set, the DRMS servers will forward errors to the operator's terminal (25th line message). Major DRMS-Server problems will be reported regardless of the setting of this switch. This switch should never be used in Production.
    appl_send_alrets
    _to_syserr_log
    When set, the DRMS servers will forward errors to the daily syserr_log file. This governs only application level alerts. Major DRMS-Server problems will be reported regardless of the setting of this switch. This switch should never be used in Production.
    check_file_at_open, check_file_at_close When set, DRMS will compare file information when the file is opened or closed to assure that files on the primary and backup systems are equal in size, number of records, number of bytes, and indexes.
    check_file_interval When set, DRMS will compare file information at the specified interval. Interval is specified in minutes.
    use_tp A yes/no switch indicating whether the backup system should use TPF. This is used only to disable and bypass TP. Consult with your software provider before changing the default value.
    appl_q_timeout A timeout interval in seconds set on the DRMS_Backup_App server queue. Consult with your software provider before changing the default value.
    primary_max_buffers The number of buffers DRMS_Primary servers use for their internal recovery algorithm.
    appl_max_buffers The number of buffers DRMS_Backup_App servers use for their internal buffering algorithm. Consult with your software provider before changing the default value.
    user_application
    _q_timeout
    The timeout set in seconds on the DRMS_Primary queue. Consult with your software provider before changing the default value.
    use_yield_processor Used to assure proper sequencing in a high-load system. Consult with your software provider before changing the default value.
    sort_buffer Used to adjust the internal sorting algorithm. Consult with your software provider before changing the default value.
    no_of_queues The number of queues to be used on the Primary system between the user application and the DRMS Primary servers. By default, DRMS uses fast one-way server queues with a depth of depth of 32,767 messages for each queue. You can also use a slower message queue with unlimited queue depth that will allow you to accumulate messages up to the disk-space capacity by setting the no_of_queues to -1.
    replace_special_chars Used only by DRMS/Extractor while building XML data. Special characters are replaced as follows:

    • < < (less than)
    • > > (greater than)
    • & & (ampersand)
    • ' ' (apostrophe or single quote)
    • " " (double quote)
    qmon_warn_at DRMS checks the total number of pending message every 5 minutes. If this number exceeds the qmon_warn_at threshold, a warning will be recorded and this check will be performed ever 2 minutes until the pending count drops below the specified threshold. To disable this feature, set the threshold to zero.
    disable_drms Set this switch if you need to run the system without data mirrorig.
    resume_at_q_depth See note below on keep-trying.
    keep_trying if for any reason the Primary DRMS server is stopped, you have two options:

    1. Keep trying (the default): The application will resume sending messages when the Primary DRMS server is re-started. Note that in this case, it may take a while for the backup system to become synchronized with the primary system.
    2. Disable all mirroring activities. (reset the switch)
    trace_level Use any of the following values:

    0 no tracing
    1 communication-level trace
    2 file selection step
    4 Memory Allocation
    8 compare-file-info trace
    16 Sequence numbers.
    32 Extractor to file
    64 Equalizer
    128 Message No.
    256 Ports


    Configuration example using a single queue

    /=record_type         GLOBAL_SETTINGS
     =tcp_host            0.0.0.0  /* IP of the Backup!!*/
     =tcp_port            5000
     =max_buffer_len      8192
     =queue_threshold     15000
     =no_of_queues        1
     =appl_max_buffers    1000
     =sort_buffer         400
    
    /=record_type	    PRIMARY
     =run_on_module       (current_module)
     =use_queue_no         1
    
    /=record_type          BACKUP
     =run_on_module        current_module)
    
    /=record_type          APPLICATION
     =run_on_module       (current_module)
    

    The DRMS Files Table (drms_files.table)

    This drms_files.table identifies critical applications and files. To create the control table, execute the create_table command using the drms_files.dd data definition file. Note that the table is designed so that it could be used as a centralized, system-wide definition shared by all applications.

    Programs that access critical files in a read-only mode do NOT require any mirroring and should be excluded from this activity.

    organization:  	relative;
    fields      :
    record_type         char (32) var  default ('include'),
    process_name        char (32)  var,       
    source_path         char (256) var,
    destination_dir     char (256) var,
    drms_server	  bin (15),
    in_any_directory    bit 1,
    auto_synchronize     bit (1)
    dont_send_reads      bit (1)
    extractor_file_id   bin (15),
    equalize_interval   char (32) var,
    equalize_if_new     bit (1),
    equalize_if_modified bit (1),
    equalize_if_locked   bit (1),
    report_orphans       bit (1),
    delete_orphans       bit (1),
    end;                                                            
    

    Field Definitions

    record_type The configuration supports three types of records:

    include

    This is the default record_type. It is used to specify which applications (processes) and files are critical. PROGRAMS THAT ONLY READ CRITICAL FILES SHOULD NOT BE INCLUDED IN ANY MIRRORING ACTIVITIES. For this reason, the DRMS configuration layer requires both process-name AND a file-name. Star-names can be specified in the process_name and in the source_path fields.

    Example #1: To include all processes that use MainTxnFile:

    /=record_type    	include
    =process_name   	*
    =source_path 	[production-dir>MainTxnFile
    =mirroring_dir  	[hot-backup-directory]
    
    Example #2: To include only TradeProcessor* processes that use MainTxnFile:

    /=record_type    	include
    =process_name   	TradeProcessor*
    =source_path 	[production-dir]>MainTxnFile
    =mirroring_dir  	[hot-backup-directory]
    

    exclude

    Exclude is used to exclude certain processes or files from any mirroring activities. Star-names can be specified in the process_name and in the source_path fields.

    Example #1: Do not perform ANY mirroring for the ReportTxn program:

    /=record_type    	exclude
    =process_name   	ReportTxn
    =source_path 	[production-dir]>MainTxnFile
    =mirroring_dir  	[hot-backup-directory]
    

    Example #2: Exclude LogFile from ANY mirroring activities:

    /=record_type    exclude
    =process_name   *
    =source_path    [production-dir]>LogFile
    

    Note that in the case of DRMS/Equalizer, the exclude records apply to the entire system regardless of the directory portion of =source_path. In the following example, DRMS/Equalizer will skip all *kp file regardless of their location:

    /=record_type    exclude
    =source_path    *.kp
    

    equalize

    These are optional records. They are used by the EQUALIZER process. Include data files that are not related to the application's database. Such files can include any source files or configuration files that are typically changed by the editor (tin,dd,pl1,form,cobol, cm,pm,table etc.)

    process_name This table is designed to be centralized and by all applications. The application must be identified by a process name. For programs running in the background, use the process_name (see the start_process command). For interactive programs, use the program name (without the .pm) extension. Note that star-names are supported, for example, you may use: EditServer_*.
    source_path The full/relative path name of the critical file on the Primary module. Note that you can use star-names (tlf* etc.).
    destination_dir The full/relative path name of the directory on the Backup module to where mirroring will be performed.
    drms_server Identifies the Application server on the Backup machine that will process file I/O activities.
    in_any_directory When set, the =source_path will include only a file name (or star-name) and DRMS will look for such file(s) REGARDLESS of their directory location. This feature should be used primarily if you have only one set of critical file and may wish to periodically move your database around without having to change the full path name (=source_path) in this table. However, you should use it with some caution: If your program uses the same file under different directory, DRMS will attempt to mirror all activities to only one file specified in =mirroring_dir (which will create errors). This consideration does not apply if your systems have identical disk structure are you are using the =substitute_system_name feature in drms.dd's GLOBAL_SETTINGS record.
    auto_synchronize This option applies only to s$keyed_rewrite. When set, and if the s$keyed_rewrite fails, then DRMS will attempt to "fix" the file by executing s$keyed_write. This feature may be used to build and fix indexed files that have not been synchronized.
    dont_send_reads This option applies to applications that do not update critical files with s$seq_rewrite or s$seq_delete. Such applications normally update the files with Keyed (s$keyed___) operations and therefore do not need to pass all Read operations (s$seq_read, s$keyed_position etc.) to the backup side. Using this option may save significant network overhead. If dont_send_reads is set then the following s$ calls will not be mirrored:

    • s$keyed_position
    • s$keyed_position_read
    • s$keyed_read
    • s$rel_position
    • s$rel_position_read
    • s$rel_read
    • s$seq_position
    • s$seq_position_read
    • s$seq_read
    extractor_file_id A non-zero, the extractor_file_id is used to identify the layout and Template(s) for the file(s):

    • DRMS>layouts>file.[extractor_file_id]
    • DRMS>layouts>layout.[extractor_file_id]
    • DRMS>layouts>template.[extractor_file_id]
    equalize_interval A time interval in minutes used to specify how often DRMS should check for modified or newly created files. This setting applies only to records used by the EQUALIZER process (=record_type EQUALIZE).
    equalize_if_new If equalize_if_new is set (to 1), DRMS will synchronize files that exists within the source-path's star-name but do NOT exist in the mirroring directory.
    equalize_if_modified If equalize_if_modified is set (to 1), DRMS will synchronize files that exists both within the source-path's star-name and in the mirroring directory but the version on the Primary module has been modified and is more recent.
    equalize_if_locked If equalize_if_locked is set (to 1), DRMS will synchronize files that are locked. By default, files that are being used (locked) by the application are not equalized.
    report_orphans Used only by DRMS/Equalizer. When set, any directories and/or files that remain under the destination directory but no longer exist on the primary module will be reported in the DRMS/Application log file.
    delete_orphans Used only by DRMS/Equalizer. When set, any directories and/or filesthat remain under the destination directory but no longer exists on the primary module will be deleted.


    DRMS' Administration

    DRMS' admnistration can be done via the WEB interface (via Alert-Manager's DRMS tab) of from the VOS command-line. start_servers Starts all DRMS servers as defined in the drms.table file while ignoring the Checkpoint file.

    recover_servers Starts all DRMS servers as defined in the drms.table file while recovering all active ports recorded in the Checkpoint file.

    Click to enlarge:


    drms_sync.pm

    Purpose

    The drms_sync command is used to syncronize large data file without having to copy these files to the backup system.

    CRT Form

    ---------------------------------- DRMS Sync.  --------------------------------
     files:  
     -index 
     

    Lineal Form

    drms_sync.pm  [files] -index [index-name]
    

    Arguments

    files

    Any valid unique-indexed data file which is defined as a critical file within the drms_file.tin configuration. You can also use a star-name.

    -index

    Use this option only if the file is encrypted using the Encryptor software to specify the name of a non-duplicates index name.


    Running the DRMS_DEMO Application

    The DRMS software includes a sample application (drms_demo.pm) that can be used to demonstrate data mirroring and for throughput and benchmark testing. The drms_demo.pm program included with its source code performs a basic copy_file function. It accepts a source and a destination file name as arguments and then reads the source file and writes it to the destination file. Make sure that the file selected as the destination file is identified as a critical file (see the drms_files.tin file). The goal is to mirror the destination file which is identified as a critical file on the Backup module. When the program completes, use the compare_files command to validate the results.

    You should be able to complete this basic test within a few minutes.

    1. Start the Servers
    2. Execute the program: drms_demo.pm
    3. The program should produce a test_file in the current directory and a mirror image of the file in the mirroring_dir directory.
    4. Compare the test_file created in the DRMS directory with it's mirror image under DRMS>mirroring_dir directory.

    Note that this initial test should be completed without having to change any of the configuration files.


    Getting Started

    The SPS>DRMS directory must be added to your COMMAND and OBJECT library paths as follows:

    You will need to re-bind all your application program-modules to include the drms_routines.obj object. Note that since you've added the DRMS path, it is not necessary to make any changes to your bind control files.

    Add your application's critical processes and files to the DRMS configuration table (drms_files.tin). Make sure that files selected for mirroring exist on the Backup module and are identical to the files on the Primary module. Use the compare_files command for this purpose. If necessary, use the copy_file or create_file commands to complete the Backup set of files.

    Modify the drms.table to include your own communication configuration IP address and the port number.

    You are now ready to start the DRMS servers on both modules - click on start-servers.

    You'll need to wait a few seconds until all processes are started and connect to each other. You should expect a message on you terminal's 25th line announcing that a connection was established.

    Once connected, you'll be ready to start your application processes.


    DRMS Files & Logs

    All following log files are created and maintained in: SPS>DRMS>logs.

    drms_*.q: A queue used for inter-process communications between the user's application and the DRMS software.

    drms.vm: Virtual Memory used by the DRMS server to keep and report statistics.

    [user-application-process-name].drms: A log file used by the user's application to report file I/O and s$ call activities as well as any errors that the application may encounter while communicating with DRMS.

    Backup.(date): A log file maintained by the DRMS_Backup server.

    Application.(date): A log file maintained by the DRMS_Backup_App server.

    Primary.(date): A log file maintained by the DRMS_Primary server.

    Application_X.q: An internal queue used on the Backup machine to support communication between the DRMS_Backup and the DRMS_Backup_App process(es). The X stands for the number of the queue being used.

    drms_to_lams.q: A queue used for passing internal messages, warnings and run-time errors to SPS/Logs & Alert Manager.


    DRMS-Extractor - mirroring to external platforms

    DRMS can be configured to mirror to other non-VOS platforms. This feature called DRMS/Extractor can convert VOS data to practically any known formats such as SQL statements, XML data structures, comma-delimited steams. This allows real-time data mirroring of critical data into practically any database including DB2, MySQL, Access etc. Every file that is selected for this purpose is uniquely identified by an special File-Extractor-ID and requires the following configuration files in the DRMS>layouts directory. Note that NNN represents the File-Extractor-ID.

    file.NNN An empty clone of the mirrored file which is used by DRMS to extract file format and information about the files indexes. To create this file, simply copy the original file and truncate it.
    layout.NNN This is a standard Data Description (dd) file used by DRMS/Extractor to extract the data from the original buffer and build the proper outputs.
    template.NNN One or more Templates used to format the output messages. For XML formats, only one Template is used, for SQL formats, three Tempaltes are used.

       File-Extractor-ID(s) 1-99 are reserved for XML formatted outputs where IDs higher than 100 are normally used to create SQL statements and therefore require three different Templates - for INSERT, UPDATE and DELETE (template.NNN.i, template.NNN.u, template.NNN.d)

       SQL by its nature require in most cases one or more indexes. Therefore files used for SQL conversion must be opened for update in indexed mode and all operations must be perfumed by s$keyed_xxx operations. Sequential writes are updates are supported but sequential updates and deletes are not.

    Supported system calls The following system calls are supported by DRMS/Extractor:

    s$keyed_delete
    s$keyed_position_rewrite
    s$keyed_rewrite
    s$keyed_write
    s$keyed_write_unlock
    s$rel_write
    s$rel_write_unlock
    s$seq_write
    s$seq_write_unlock
    

    A complete Example In this example we will create treat the standard VOS (master_disk)system>error>error_codes.table as a critical file and mirror it using the SQL format.

    1. Assign this file a File-Extractor-ID of 200 create an entry for it in the drms_files.tin as follows:

      /=record_type            include
       =process_name           *                                                  
       =source_path            error_codes.data                            
       =destination_dir        mirroring_dir
       =extractor_file_id      200
      

    2. Create the file.NNN file:

      !copy_file (master_disk)system>error>error_codes.table DRMS>layouts>file.200 -truncate

    3. Create the layout.NNN file:

      fields: err_number		fixed bin (15),
              err_name        	char (32),
              err_text           char (128) varying,
              err_category    	char(18),
              err_category2   	char(18);
      end;
      

         VOS standard date-time fields must be defined as defined as fixed-binary-31 and the field name must be preceded with 'dt_'. For example: dt_last_update bin (31),

    4. Create three SQL Templates:

      • template.200.i (for INSERT) insert into @drms_file@ values (@err_number@, '@err_name@', '@err_text@', '@err_category@', '@err_category2@')
      • template.200.u (for UPDATE) update @drms_file@ set err_number=@err_number@, err_name='@err_name@', err_text='@err_text@', err_category='@err_category@', err_category2='@err_category2@' where @drms_index_info@
      • template.200.d (for DELETE) delete from @drms_file@ where @drms_index_info@
    5. Using the drms_demo.pm program, write new records to the "critical" error_codes.data file:

      drms_demo.pm -input_path #d01>system>error>error_codes.table -output_path error_codes.data


    Mirroring VM Regions

    You may use DRMS to replicate your application's VM regions. Here's what you'll need to do:

    1. Make sure the VM file is defined as a critical file in your drms_files.table.
    2. Edit the drms_sync_vm_01.bind file
    3. Adjust the the modules section to match your application's bind VM regions. Be sure to specify the modules in the same order.
    4. For every region, adjust:
      • the region_path_N (path-name of the file)
      • region_pages_N (number of pages to connect to)
      • region_interval_N (how often to runout, specified in seconds)
    5. You may repeat the process for up to 10 VM regions.
    6. Add the following entry to drms.tin:

      /=record_type                                SYNCHRONIZE_VM
       =run_on_module                              [your-production-module]
       


    Troubleshooting

    If for some reason you are not getting the expected results, check:

    1. Check DRMS communications:
      • Are both DRMS processes running and properly started?
      • Run list_users and make sure there is only DRMS_Primary process running on the primary system and only DRMS_Backup and DRMS_Application are running on the backup module. If you have multiple DRMS environments, make sure only one is being used.
      • Review both systems, focus on the communication servers (DRMS_PRIMARY, DRMS_BACKUP).
      • Look for any error messages in their log files (list *.(date)).
      • In the DRMS directory, execute "who_locked *pm" and verify that the drms.pm is being locked.

    2. Run the test program - drms_demo.pm:
      • Delete the DRMS>mirroring_dir>test_file on the Backup side.
      • Run the drms_demo.pm program.
      • Verify that the test_file has properly mirrored to the Backup directory.
      • Look for any errors.
      • Review the DRMS_Application log on the Backup module, look for any errors.
      • Review the monitor screen, make sure that counters are changing as expected.

    3. Check the application programs:
      • Is your application bound with the drms_routines.obj objects?
      • Does the application name in the configuration table match (exactly!) the name of your process (background) or program name (foreground)?
      • Does the =source_path configuration path match the path name of the file you are mirroring?
      • Verify that the your application is not excluded within the drms_files.table configuration.
      • Verify that the DRMS directory appears in the module's default library paths - both command and object lists. Use the list_default_library_paths command.
      • On the primary module, log into the system using the same user-id that under which the application is running and execute 'where_command drms.pm;list_library_paths' review the output-file.
      • On the backup module, review the DRMS_Application log file; look for errors or traces for connection attempts from the application program in question.
      • Review the queue-monitor screen to verify that messages are being transferred and delivered.
      • On the Primary module, set sufficient access right (modify/write) to allow the application to create and write its log files in the SPS>DRMS>logs subdirectory.


    The DRMS_DEMO Program

    drms_demo: proc;
    /*  +++begin copyright+++ *******************************  */
    /*                                                         */
    /*  SoftMark Inc. CONFIDENTIAL INFORMATION                 */
    /*  COPYRIGHT (c) 1989 -1993 SoftMark, Inc.                */
    /*  All Rights Reserved.                                   */
    /*                                                         */
    /*  This  program  contains  confidential and proprietary  */
    /*  information  of  SoftMark, Inc. and any reproduction,  */
    /*  disclosure, or use in whole or in  part is  expressly  */
    /*  prohibited, except as may be  specifically authorized  */
    /*  by prior written agreement or permission of SoftMark.  */
    /*                                                         */
    /*  +++end copyright+++ *********************************  */
    
    /***********************************************************************/  
    /*  Description: This is a sample application used to demonstrate      */
    /*               the DRMS-Data Mirroing System.                        */
    /*                                                                     */
    /*               The program accepts 2 arguments: an input-file and    */
    /*               an output-path. The program reads all records in the  */
    /*               input file and writes them to the output file.        */
    /*               The program can therfore be describled as a simple    */
    /*               version of the "copy_file" command.                   */
    /*                                                                     */
    /*               The default name for the Output file is "test_file"   */
    /*               which also appears in the sample configuration (see   */
    /*               the drms_files.tin file).                             */
    /*                                                                     */
    /*               For more details, please refer to the:                */
    /*                                                                     */
    /*                    DRMS - Installation Guide                        */
    /*                                                                     */
    /***********************************************************************/
    %include 'system_io_constants.incl.pl1';
    declare  s$error entry(fixed bin(15), char(*) varying, char(*) varying);
    dcl s$parse_command  entry (char (*) var,bin(15),
                                char (*) var,char (256) var,
                                char (*) var,char (256) var,
                                char (*) var);
    declare  s$write entry(char(*) varying);
    declare  s$seq_write entry(fixed bin(15), fixed bin(15), char(*), fixed
              bin(15));
    declare  s$attach_port entry(char(32) varying, char(256) varying, fixed
              bin(15), fixed bin(15), fixed bin(15));
    declare  s$open entry(fixed bin(15), fixed bin(15), fixed bin(15), fixed
              bin(15), fixed bin(15), fixed bin(15), char(32) varying, fixed
              bin(15));
    declare  s$seq_read entry(fixed bin(15), fixed bin(15), fixed bin(15),
              char(*), fixed bin(15));
    declare  s$close entry(fixed bin(15), fixed bin(15));
    declare  s$detach_port entry(fixed bin(15), fixed bin(15));
    declare  s$stop_program entry(char(*) varying, fixed bin(15));
    
    dcl 1 parse,
          2 input_path       char (256) var,
          2 output_path      char (256) var;
    
    dcl record_buffer        char (4096);
    dcl in_port              bin  (15);
    dcl out_port             bin  (15);
    dcl rec_len              bin  (15);
    dcl caller_name          char (32) var static init ('drms_demo');
    dcl code                 bin  (15);
    dcl records              bin  (31);
    dcl e$end_of_file        bin  (15) static ext;
    
    
    call s$parse_command   (caller_name,code,
        'option (-input_path),pathname,req,=''(home_dir)>abbreviations''',
                   parse.input_path,
        'option (-output_path),pathname,req,=test_file',parse.output_path,
        'end');
    if code ^= 0  then stop;
    
    call s$write ('Starting DRMS-DEMO.');
    call s$write ('Copying ' || parse.input_path);
    call s$write ('     To ' || parse.output_path);
    
    /*
     *   Opening the Input file.
     */
    call s$attach_port ('',parse.input_path,0,in_port,code);
    if code ^= 0 then call error ('Problem opening input file.');
    
    call s$open (in_port,SEQUENTIAL_FILE,0,
          DIRTY_INPUT_TYPE,IMPLICIT_LOCKING,SEQUENTIAL_MODE,'',code);
    if code ^= 0 then call error ('Problem opening input file.');
    
    /*
     *   Opening the Output file.
     */
    call s$attach_port ('',parse.output_path,0,out_port,code);
    if code ^= 0 then call error ('Problem opening output file.');
    
    call s$open (out_port,SEQUENTIAL_FILE,0,
          OUTPUT_TYPE,IMPLICIT_LOCKING,SEQUENTIAL_MODE,'',code);
    if code ^= 0 then call error ('Problem opening output file.');
    
    records = 0;
    call s$seq_read (in_port,length (record_buffer),rec_len,record_buffer,code);
    do while (code = 0);
       records = records + 1;
       call s$seq_write (out_port,rec_len,record_buffer,code);
       if code ^= 0 then call error ('Problem writing to output file.');
    	call s$seq_read (in_port,length   
                (record_buffer),rec_len,record_buffer,code);
    end;
    if code ^= 0 & code ^= e$end_of_file
    then
       call error ('Problem reading the input file.');
    
    /*
     *   Closing files.
     */
    call s$close (in_port,code);
    if code ^= 0 then call error ('Problem closing input file.');
    call s$detach_port (in_port,code);
    if code ^= 0 then call error ('Problem closing input file.');
    
    call s$close (out_port,code);
    if code ^= 0 then call error ('Problem closing output file.');
    call s$detach_port (out_port,code);
    if code ^= 0 then call error ('Problem closing output file.');
    
    call s$stop_program ('', (0));
    
    error: proc (a_text);
      dcl a_text        char (*) var;
    
      call s$error (code,(caller_name),(a_text));
      call s$stop_program ('',code);
    end error;
    end drms_demo;
    

    Important Operation considerations

    Preparations Critical files must exist on the backup directory before starting the system. In most cases, it is required that critical files are identical on both Primary and Backup module before starting the system. There's no need to create files that are created dynamically dynamically by the application (like files with a "date" extension), these files will be created by DRMS.

    If you make configuration changes, it is not required to start and restart the DRMS servers - ONLY THE APPLICATION must be restarted.

    DRMS must be up and running BEFORE THE APPLICATION IS STARTED.

    Starting the DRMS/Application The ideal sequence of starting DRMS & the application:

    1. DRMS (Backup)
    2. DRMS (Primary)
    3. The Application

    If DRMS (primary) is started before the backup side, it may take up to one minute for them to connect.

    Under no (normal) circumstances should you stop ANY DRMS server(s).

    Scheduled shutdowns

    1. Shutdown of Primary: stop the application, make sure no message are left on DRMS queue(s) on both systems (monitor_queues), stop DRMS (in any order)

    2. Shutdown of Backup: in most cases it makes no sense to attempt mirroring if the backup module is stopped. So you'll probably need to plan to start over (preparing files, restarting DRMS, restarting the application). DRMS offers an advanced option that takes checkpoints and allows a short outage (shutdown) of the backup module but this will work only if the backup module is shutdown for a very short period of time.

    3. YOU MUST MONITOR DRMS OPERATIONS SEVERAL TIMES EVERY DAY AND IMMEDIATELY AFTER EVERY CHANGE TO THE SYSTEM (configuration etc.). Watch the queue monitor should be sufficient. Randomly checking the backup files would also be a good practice.