Commands and Qualifiers

The MUPIP commands described in this section are used for common database operations and serves as the foundation for more advanced functionality like Journaling and Replication.

BACKUP

Saves the contents of the database. It provides a consistent application snapshot across all database regions involved in the backup operation.

The format of the MUPIP BACKUP command is:

B[ACKUP]
[
 -BK[UPDBJNL]={DISABLE|OFF}]
 -BY[TESTREAM] [-NET[TIMEOUT]]
 -DA[TABASE]
 -[NO]NEWJNLFILES[=[NO]PREVLINK],[NO]S[YNC_IO]]
 -[NO]O[NLINE]
 -REC[ORD]
 -REPLA[CE]
 -RET[RY]=count
 -REPLIN[STANCE]=target_location
 -SH[OWPROGRESS]
 -SI[NCE]={DATABASE|BYTESTREAM|RECORD}
 -T[RANSACTION]=hexadecimal_transaction_number
] region-list[,...] destination-list
[Important] Important

MUPIP BACKUP does a more comprehensive job of managing backup activities than other backup techniques such as a SAN backup, disk mirroring, or a file system snapshot because it integrates journal management, instance file management, and records timestamps in the database file headers. To use other techniques, you must first freeze all regions concurrently with a command such as MUPIP FREEZE -ON "*" in order to ensure a consistent copy of files with internal structural integrity. FIS neither endorses nor tests any third party products for backing up a GT.M database.

  • MUPIP BACKUP supports two methods of database backup: -BYTESTREAM and -DATABASE. MUPIP BACKUP -BYTESTREAM directs the output to a broad range of devices, including disks, TCP sockets, and pipes. MUPIP BACKUP -DATABASE directs the output to random access devices (that is, disks).

  • [NO]ONLINE qualifier determines whether MUPIP BACKUP should suspend updates to regions. For example, MUPIP BACKUP -NOONLINE suspends updates to all regions from the time it starts the first region until it finishes the last region. However, it does not suspend processes that only read from the database.

  • By default, MUPIP BACKUP is -DATABASE -ONLINE.

  • If any region name does not map to an existing accessible file, or if any element of the destination list is invalid, BACKUP rejects the command with an error.

  • region-list may specify more than one region of the current global directory in a list. Regions are case insensitive and separated by a comma. Any region-name may include the wildcard characters * and ? (remember to escape them to protect them from inappropriate expansion by the shell). Any region name expansion due to wildcards results ordering determined by M (ASCII) collation. MUPIP BACKUP selects regions for backup based on the order specified in the region-list.

  • Depending on the type of backup, destination-list may be a single directory, or a comma separated list of destinations including files, piped commands, or a TCP socket address (a combination of IPv4 or IPV6 hostname and a port number).

  • Region-list and destination-list items are matched in order - the first region is mapped to the first destination, the second to the second destination, and so on. If GT.M encounters a region mapped to a directory, GT.M treats that directory as the destination for all subsequent regions in the region-list.

  • GT.M implicitly timestamps both BYTESTREAM and DATABASE backups using relative timestamps (transaction numbers). You can also explicitly specific a RECORD timestamp for custom-control (SANS or mirrored disk) backup protocol. You might want to use these timestamps as reference points for subsequent backups.

  • It takes approximately one (1) minute (per region) for BACKUP -ONLINE to give up and bypass a KILLs in progress; backup does not wait for Abandoned Kills to clear.

  • The environment variable gtm_baktmpdir specifies the directory where mupip backup creates temporary files. If gtm_baktmpdir is not defined, GT.M uses the deprecated GTM_BAKTMPDIR environment variable if defined, and otherwise uses the current working directory.

  • When you restrict access to a database file, GT.M propagates those restrictions to shared resources associated with the database file, such as semaphores, shared memory, journals and temporary files used in the course of MUPIP BACKUP.

  • GT.M supports only one concurrent -ONLINE backup on a database. MUPIP BACKUP displays the BKUPRUNNING message if started when there is an already running BACKUP.

  • MUPIP BACKUP protects against overwriting of existing destination files. However, it cannot protect other destinations, for example, if the destination is a pipe into a shell command that overwrites a file.

[Tip] Before starting a MUPIP BACKUP

Perform the following tasks before you begin a database backup.

  • Ensure adequate disk space for target location and temporary files. Set the environment variable gtm_baktmpdir to specify the directory where MUPIP BACKUP creates temporary files. If gtm_baktmpdir is not defined, GT.M uses the deprecated GTM_BAKTMPDIR environment variable if defined, and otherwise uses the current working directory. Do not place temporary files in the current directory for large databases in production environments.

  • If you are backing up an encrypted datababase, you need to backup your $gtmcrypt_config file and securely preserve the encryption key. You also need to backup the related algorithms used to generate that key. For example, if you are using gpg for encryption and signing services, you must backup the relevant files in your $GNUPGHOME directory as part of your backup in addition to preserving the encryption key. Look in the manpages of gpg (man gpg) to see what all files require backup. Remember that if you forget the password of the encryption key which was used at the time of taking the backup, there is no way to decrypt the data from the encrypted regions. Therefore, ensure that you have procedures in place to securely handle password storage and retrieval of the encryption key.

  • When using replication, ensure that the Source/Receiver process is alive (MUPIP REPLIC -SOURCE/-RECEIVER -CHECKHEALTH). Always backup the replicating instance file with the database (BACKUP -REPLINST).

  • If you intend to use a -DATABASE backup at the same time in the same computer system as the source database, be sure to disable journaling in the backed up database with -BKUPDBJNL=DISABLE.

  • When doing a complete backup, switch journal files as part of the backup command using the -NEWJNLFILES qualifier. This aligns the journal files with the backup and simplifies journal file retention. Use the NOPREVLINK option for this qualifier with caution if the original database is used for replication. If the link to the previous generation journal file is cut, then the source server cannot supply transactions from the prior generation journal files.

  • If you follow separate procedures for backup and archive (moving to secondary storage), you can save time by starting archive as soon as MUPIP BACKUP completes the process of creating a backup database file for a region. You do not need to wait for MUPIP BACKUP to complete processing for all regions before starting archive. For example, a message like:

    DB file /home/jdoe/.fis-gtm/V6.0-001_x86_64/g/gtm.dat backed up in file /backup/gtm.dat
    Transactions up to 0x0000000000E92E04 are backed up.

    confirms that gtm.dat is backed up correctly and is ready for archive.

  • Determine an appropriate frequency, timing, and backup method (-BYTESTREAM or -DATABASE) based on the situation.

  • Ensure the user issuing backup commands has appropriate permissions before starting the backup. Backup files have the ownership of the user running MUPIP BACKUP.

  • There is one circumstance under which a MUPIP BACKUP is not advised. When your operational procedures call for taking backups of unmodified databases and journal files on rebooting a system after a crash, then use an underlying operating system command (cp, cpio, gzip, tar, and so on) which will open the files read-only. Note that for ordinary system crashes where the system simply stops writing to open files at power down, you can use MUPIP JOURNAL to recover journaled database files, and taking backups on reboot should not be required. However, for system crashes with the possibility of damage to files already written to disk (for example, if the crash involved an IO controller with the potential for having written random data to disk immediately prior to power down), such backups on reboot may be appropriate.

Example:

$ mupip backup "*" /gtm/bkup

This example creates ready-to-run database backup of all regions.

-BKupdbjnl

A backup database shares the same journaling characteristics of the source database. However, with BKUPDBJNL you can disable or turns off journaling in the backup database. Use this qualifier if you intend to open your backup database at the same time in the same environment as the source database.

The format of the BKUPDBJNL qualifier is:

-BK[UPDBJNL]={DISABLE|OFF}
  • Specify DISABLE to disable journaling in the backup database.

  • Specify OFF to turn off journaling is in the backup database.

  • Only one of the qualifiers DISABLE or OFF can be specified at any given point.

-Bytestream

Ttransfers MUPIP BACKUP output to a TCP connection, file (or a backup directory), or a pipe. If there are multiple .dat files, BYTESTREAM transfers output to a comma separated list of TCP connections, incremental backup files and/or directories, or pipes. When used with -SINCE or -TRANSACTION, MUPIP BACKUP allow incremental backup, that is, include database blocks that have changed since a prior point specified by the -SINCE or -TRANSACTION.

[Note] Note

MUPIP BACKUP output to a TCP connection saves disk I/O bandwidth on the current system.

All bytream backups needs to be restored to a random access file (with MUPIP RESTORE) before being used as a database file. -BYTESTREAM can also send the output directly to a listening MUPIP RESTORE process via a TCP/IP connection or a pipe.

The format of the BYTESTREAM qualifier is:

-BY[TESTREAM]
  • -BYTESTREAM is compatible with -SINCE and -TRANSACTION.

  • -INCREMENTAL is deprecated in favor of -BYTESTREAM. For upward compatibility, MUPIP temporarily continues to support the deprecated -INCREMENTAL.

-Database

Creates a disk-to-disk backup copy of the files of all selected regions. DATABASE backup copy is a ready-to-use a GT.M database unlike BYTESREAM backup which is required to be restored to a random access file.

The format of the DATABASE qualifier is:

-D[ATABASE]
  • By default, MUPIP BACKUP uses -DATABASE.

  • The DATABASE qualifier is only compatible with the -[NO]NEW[JNLFILES], -ONLINE, and -RECORD qualifiers.

  • -COMPREHENSIVE is depreciated in favor of -DATABASE. For upward compatibility, MUPIP temporarily continues to support the deprecated -COMPREHENSIVE.

-NETtimeout

Specifies the timeout period when a bytestream BACKUP data is either sent over a TCP/IP connection or restored using the RESTORE command. The format of the NETTIMEOUT qualifier is:

NET[TIMEOUT]=seconds
  • The default value is 30 seconds.

  • Use only with: -BYTESTREAM and RESTORE.

-NEWJNLFILES

Determines the journaling charactertistics of the database files being backed-up. All the established journaling characteristics apply to new journal files. This qualifier is effective only for an ONLINE backup (the default), when the database has journaling enabled.

The format of the NEWJNLFILES qualifier is:

-[NO]NEWJNLFILES[=[NO]PREVLINK], [NO]S[YNC_IO]]
  • -NEWJNLFILES can take the following three values:

    1. PREVLINK: Back links new journal files with the prior generation journal files. This is the default value.

    2. NOPREVLINK: Indicates that there should be no back link between the newly created journals and prior generation journal files. Since only one new journal file is produced which may be used by both the original database and the backup copy, this option can cause NOPREVLINK errors with replication if the source server needs to supply transactions from a previous generation journal file.

    3. SYNC_IO: Specifies that every WRITE to a journal file to be committed directly to disk. On high-end disk subsystems (for example, those that include non-volatile cache and that consider the data to be committed when it reaches this cache), this might result in better performance than the NOSYNC_IO option. NOSYNC_IO turn off this option.

  • -NONEWJNLFILES causes journaling to continue with the current journal files. It does not accept any arguments.

  • The default is -NEWJNLFILES=PREVLINK.

-Online

Specifies that while a MUPIP BACKUP operation is active, other processes can update the database without affecting the result of the backup. The format of the ONLINE qualifier is:

-[NO]O[NLINE]
  • MUPIP BACKUP -ONLINE creates a backup of the database as of the moment the backup starts. If the running processes subsequently update the database, the backup does not reflect those updates.

  • MUPIP BACKUP -ONLINE on regions(s) waits for up to one minute so any concurrent KILL or MUPIP REORG operations can complete. If the KILL or MUPIP REORG operations do not complete within one minute, MUPIP BACKUP -ONLINE starts the backup with a warning that the backup may contain incorrectly marked busy blocks. Such blocks waste space and can desensitize operators to much more dangerous errors, but otherwise don't affect database integrity. If you get such an error, it may be better to stop the backup and restart it when KILL or MUPIP REORG operations are less likely to interfere. Performing MUPIP STOP on a process performing a KILL or MUPIP REORG operation may leave the database with incorrectly marked busy blocks. In this situation, GT.M converts the ongoing KILLs flag to abandoned KILLs flag. If MUPIP BACKUP -ONLINE encounters ADANDONED_KILLS, it gives a message and then starts the backup. An ABANDONED_KILLS error means both the original database and the backup database possibly have incorrectly busy blocks which should be corrected promptly.

  • By default, MUPIP BACKUP is -ONLINE.

-Record

Timestamps (in the form of a transaction number) a database file to mark a reference point for subsequent bytestream, database, or custom backup (SANS or disk mirror) protocols. Even though -DATABASE and -BYTESTREAM both mark their own relative timestamps, -RECORD provides an additional timestamp option. In addition to storing the transaction number, -RECORD also stores a timestamp including the date and time of a successful backup operation in the database file. MUPIP DUMPFHEAD displays this timestamp as "sgmnt_data.last_start_backup" using a format such as "Sun Aug 15 13:37:32 2021". DSE DUMP -FILEHEADER -ALL also displays this date and time as "Last Record Backup Start" using the same format. These timestamps are displayed relative to the current timezone, and display as "Never" if the database file has never been successfully backed up with -RECORD. MUPIP FREEZE also provides the -RECORD qualifier because a FREEZE may be used to set the database up for a SAN or disk-mirror based backup mechanism.

The format of the RECORD qualifier is:

-R[ECORD]
  • Use -RECORD (with the hypen) to timpestamp a refererence point and use RECORD as a keyword (as in -SINCE=RECORD) to specific the starting point for a MUPIP BACKUP operation.

  • -RECORD replaces the previously RECORDed transaction identifier for the database file.

-REPLace

Overwrites the existing destination files.

The format of the REPLACE qualifier is:

-[REPL]ACE
  • By default, MUPIP BACKUP protect against overwriting the destination files. -REPLACE disables this default behavior.

  • -REPLACE is compatible only with -DATABASE.

-REPLInstance

Specifies the target location to place the backup of the replication instance file.

[Note] Note

The replication instance file should always be backed up with the database file. The source server for the instance must be started at least once before backing up the replication instance file.

The format of the REPLINSTANCE qualifier is:

-REPLI[NSTANCE]=<target_location>

-RETry

Makes the specified number of retry attempts to perform BACKUP if the backup fails. If -RETRY is not specified, MUPIP retries file copy operation once if the first attempt fails for a retriable reason. In case of an error, retry attempts are always based on cp or pax even when another copy mechanism is available. If -RETRY=0 is specified, there is no retry for any failure that BACKUP encounters.

The format of the RETRY qualifier is:

-RET[RY]=<count>

-SHowprogress

When the backup copy mechanism supports monitoring, -SHOWPROGRESS periodically displays the transfer progress, estimated time left, speed, and the number of transaction applied to the database during backup.

The format of the SHOWPROGRESS qualifier is:

-SH[OWPROGRESS]

Incompatible with: -BYTESTREAM

-Since

Includes blocks changed since the last specified backup. The format of the SINCE qualifier is:

-SI[NCE]={DATABASE|BYTESTREAM|RECORD}
  • D[ATABASE] - Backup all changes since the last MUPIP BACKUP -DATABASE.

  • B[YTESTREAM] - Backup all changes since the last MUPIP BACKUP -BYTESTREAM.

  • R[ECORD] - Backup all changes since the last MUPIP BACKUP -RECORD.

By default, MUPIP BACKUP -BYTESTREAM operates as -SINCE=DATABASE.

Incompatible with: -TRANSACTION.

-Transaction

Specifies the transaction number of a starting transaction that causes BACKUP -BYTESTREAM to copy all blocks that have been changed by that transaction and all subsequent transactions. The format of the TRANSACTION qualifier is:

-T[RANSACTION]=transaction-number
  • A Transaction number is always 16 digit hexadecimal number. It appears in a DSE DUMP -FILEHEADER with the label "Current transaction".

  • If the transaction number is invalid, MUPIP BACKUP reports an error and rejects the command.

  • It may be faster than a DATABASE backup, if the database is mostly empty.

  • Incompatible with: -DATABASE, -SINCE

[Note] Note

A point in time that is consistent from an application perspective is unlikely to have the same transaction number in all database regions. Therefore, except for -TRANSACTION=1, this qualifier is not likely to be useful for any backup involving multiple regions.

Examples for MUPIP BACKUP

Example:

$ mupip backup -bytestream REPTILES,BIRDS bkup

Suppose that the environment variable gtmgbldir has regions REPTILES and BIRDS that map to files called REPTILES.DAT and BIRDS.DAT (no matter which directory or directories the files reside in). Then the above example creates bytestream backup files REPTILES.DAT and BIRDS.DAT in the bkup directory since the last DATABASE backup.

Example:

$ mupip backup -bkupdbjnl="OFF" "*"

This command turns off journaling in the backup database.

Example:

$ mupip backup -bytestream "*" tcp://philadelphia:7883,tcp://tokyo:8892

Assuming a Global Directory with two regions pointing to ACN.DAT and HIST.DAT, this example creates a backup of ACN.DAT to a possible MUPIP RESTORE process listening at port 7883 on server philadelphia and HIST.DAT to a possible MUPIP RESTORE process listening at port 8893 on server tokyo.

Always specify the <machine name> and <port> even if both backup and restore are on the same system, and ensure that the MUPIP RESTORE process is started before the MUPIP BACKUP process.

Example:

$ mupip backup -database -noonline "*" bkup
DB file /home/gtmnode1/gtmuser1/mumps.dat backed up in file bkup/mumps.dat
Transactions up to 0x00000000000F42C3 are backed up.
BACKUP COMPLETED.

This command creates a disk-to-disk backup copy of all regions of the current database in directory bkup. GT.M freezes all the regions during the backup operation.

Example:

$ mupip backup -bytestream -nettimeout=420 DEFAULT tcp://${org_host}:6200

This command creates a backup copy of the DEFAULT region with timeout of 420 seconds.

Example:

$ mupip backup -bytestream DEFAULT '"| gzip -c > online5pipe.inc.gz"'

This command sends (via a pipe) the backup of the DEFAULT region to a gzip command.

Example:

$ mupip backup -online DEFAULT bkup
DB file /gtmnode1/gtmuser1/mumps.dat backed up in file bkup/mumps.dat
Transactions up to 0x00000000483F807C are backed up.
BACKUP COMPLETED.

This command creates a backup copy of the DEFAULT region of the current database in directory bkup. During the backup operation, other processes can read and update the database.

Example:

$ mupip backup -record DEFAULT bkup

This command sets a reference point and creates a backup copy of the DEFAULT region of the current database in directory bkup.

Example:

$ mupip backup -online -record DEFAULT bkup1921
DB file /home/reptiles/mumps.dat backed up in file bkup1921/mumps.dat
Transactions up to 0x00000000000F4351 are backed up.

Example:

$ mupip backup -bytestream -since=record DEFAULT bkup1921onwards
MUPIP backup of database file /home/reptiles/mumps.dat to bkup1921onwards/mumps.dat
DB file /home/reptiles/mumps.dat incrementally backed up in file bkup1921onwards/mumps.dat
6 blocks saved.
Transactions from 0x00000000000F4351 to 0x00000000000F4352 are backed up.
BACKUP COMPLETED.

The first command sets a reference point and creates a backup copy of the DEFAULT region of the current database in directory bkup1921. The second command completes a bytestream backup starting from the reference point set by the first command.

Example:

$ mupip backup -bytestream -transaction=1 DEFAULT bkup_dir
MUPIP backup of database file /gtmnode1/gtmuser1/mumps.dat to bkup_dir/mumps.dat
DB file /gtmnode1/gtmuser1/mumps.dat incrementally backed up in file bkup/mumps.dat
5 blocks saved.
Transactions from 0x0000000000000001 to 0x0000000000000003 are backed up.
BACKUP COMPLETED.

This command copies all in-use blocks of the DEFAULT region of the current database to directory bkup_dir.

Example:

$ mupip backup -newjnlfiles=noprevlink,sync_io "*" backupdir

This example creates new journal files for the current regions, cuts the previous journal file link for all regions in the global directory, enables the SYNC_IO option and takes a backup of all databases in the directory backupdir.

CREATE

Creates and initializes database files using the information in a Global Directory file. If a file already exists for any segment, MUPIP CREATE takes no action for that segment.

The format of the CREATE command is:

CRE[ATE] [-[no]V6] [-R[EGION]=region-name]

The single optional -REGION qualifier specifies a region for which to create a database file.

Note that a GT.M logical database (an M global variable namespace) can consist of an arbitrary number of database files.

-V6

Directs MUPIP to create a V6.3-014 compatible database file. This option is negatable to ensure that MUPIP CREATE always creates current version database files even when the environment variable gtm_db_create_ver is defined as V6. By default, MUPIP CREATE creates database files for the current version. The environment variable gtm_db_create_ver can override the default behavior.

The format of the V6 qualifier is:

-[NO]V6

-NOV6 creates a V7 database overriding the value of the environment variable gtm_db_create_ver.

-Region

Specifies a single region for creation of a database file. By default, MUPIP CREATE creates database files for all regions in the current Global Directory that do not already have a database file.

The format of the REGION qualifier is:

-R[EGION]=region-name
[Note] Note

MUPIP CREATE silently ignores requests to create database files that have AutoDB enabled in the Global Directory. MUPIP CREATE prints no message even if the database region is specified by name. For more information on AutoDB, refer to “Region Qualifiers”.

Examples for MUPIP CREATE

Example:

$ mupip create -region=REPTILES

This command creates the database file specified by the Global Directory (named by the GT.M Global Directory environment variable) for region REPTILES.

DOWNGRADE

The MUPIP DOWNGRADE command changes the file header format from V6 to V5 under appropriate conditions. The format of the MUPIP DOWNGRADE command is:

D[OWNGRADE] -V[ERSION]={V5|V63000A}} file-name
[Note] Note

V7.0-000 and up do not support DOWNGRADE, even when running on a V6 database.

[Note] Note

You must perform a GT.M database integrity check using the -noonline parameter prior to downgrading a database. The integrity check verifies and clears database header fields required for an orderly downgrade. If an integrity check is not possible due to time constraints, please rely on a rolling upgrade scheme using replication and / or take a backup prior to upgrading the database.

-VERSION={V5|V63000A}

V5 specifies file header format. For more information on the downgrade criteria for your database, refer to the release notes document of your current GT.M version.

V63000A:

V63000A downgrades to any release older than V6.3-001. All releases up to V6.3-000A have an empty 512-bytes block logically after the last usable database block. VERSION=V63000A changes this terminating block from having the current size of a database block to 512-bytes.

Examples for MUPIP DOWNGRADE

Example:

$ mupip downgrade mumps.dat -VERSION=V5

This command changes the file-header of mumps.dat to V5 format.

DUMPFHEAD

The MUPIP DUMPFHEAD command displays information about one or more database files. The format of the MUPIP DUMPFHEAD command is:

DU[MPFHEAD]  {-FI[LE] file-name |-R[EGION] region-list} 
[Note] Note

MUPIP DUMPFHEAD obtains the field values from the database file header and ^%PEEKBYNAME obtains field values from the shared memory. Therefore, it may be possible that MUPIP DUMPFHEAD reports stale values for unflushed fields. If you require more recent file header values, use the MUPIP DUMPFHEAD -FLUSH which flushes file headers fields from shared memory to disk before returning the file header values.

-FILE=file

Specifies the name of the database file for the MUPIP DUMPFHEAD operation. -FILE does not require a Global Directory. The format of the FILE qualifier is:

-FI[LE] database-file-name
  • The database file name must include the absolute or relative path.

  • The -FILE qualifier is incompatible with the -REGION qualifier.

-FLUSH

Flushes the database file header flush before displaying the database file header fields. While this qualifier ensures the information is recent, under most production circumstances the output is sufficiently accurate without -FLUSH. Use of -FLUSH makes the operation significanly more heavyweight. If the database file header flush fails, MUPIP DUMPFHEAD -FLUSH produces a BUFFLUFAILED warning, but still produces output. The format of the FLUSH qualifier is:

-FL[USH] 

-REGION=region

Specifies that the DUMPFHEAD command identifies one or more regions rather than a database file. The format of the REGION qualifier is:

-R[EGION] region-list
  • The region-list identifies the target of DUMPFHEAD; region-list may specify more than one region of the current global directory in a list. DUMPFHEAD treats regions names (separated by commas) as case-insensitive with optional wildcard characters * and ? expanded in M (ASCII) collation order. Remember to escape wildcard characters to protect them from inappropriate expansion by the shell. DUMPFHEAD processes regions based on the order specified in the region-list.

  • The region-list argument may specify more than one region of the current Global Directory in a list separated with commas. DUMPFHEAD -REGION requires the environment variable gtmgbldir to specify a valid Global Directory. For more information on defining gtmgbldir, refer to Chapter 4: “Global Directory Editor.

  • The -REGION qualifier is incompatible with the -FILE qualifier.

Examples for MUPIP DUMPFHEAD

Example:

$ mupip dumpfhead -file mumps.dat

This command lists information about the database file mumps.dat in the current working directory.

$ mupip dumpfhead -region "*"

This command lists information about all the database files mapped by the global directory specified by $gtmgbldir.

ENDIANCVT

Converts a database file from one endian format to the other (BIG to LITTLE or LITTLE to BIG). The format of the MUPIP ENDIANCVT command is:

ENDIANCVT [-OUTDB=<outdb-file>] -OV[ERRIDE] <db-file>
  • <db-file> is the source database for endian conversion. By default ENDIANCVT converts <db-file> in place.

  • outdb writes the converted output to <outdb-file>. In this case, ENDIANCVT does not modify the source database <db-file>.

  • ENDIANCVT produces a <outdb-file>of exactly the same size as <db-file>.

    [Important] Important

    Ensure adequate storage for <outdb-file> to complete the endian conversion successfully.

  • ENDIANCVT requires standalone access to the database.

  • GT.M displays a confirmation request with the "from" and "to" endian formats to perform the conversion. Conversion begins only upon receiving positive confirmation, which is a case insensitive "yes".

  • In a multi-site replication configuration, the receiver server automatically detects the endian format of an incoming replication stream and converts it into the native endian format. See Database Replication chapter for more information.

  • Encrypted database files converted with ENDIANCVT require the same key and the same cipher that were used to encrypt them.

[Note] Note

GT.M on a big endian platform can convert a little endian database into big endian and vice versa; as can GT.M on a little endian platform. GT.M (run-time and utilities other than MUPIP ENDIANCVT) on a given endian platform opens and processes only those databases that are in the same endian format. An attempt to open a database of a format other than the native endian format produces an error.

-OVerride

Enables MUPIP ENDIANCVT to continue operations even if GT.M encounters the following errors:

  • "minor database format is not the current version"

  • "kills in progress"

  • "a GT.CM server is accessing the database"

Note that the OVERRIDE qualifier does not override critical errors (database integrity errors, and so on) that prevent a successful endian format conversion.

Examples for MUPIP ENDIANCVT

$ mupip endiancvt mumps.dat -outdb=mumps_cvt.dat
Converting database file mumps.dat from LITTLE endian to BIG endian on a LITTLE endian system
Converting to new file mumps_cvt.dat
Proceed [yes/no] ?

This command detects the endian format of mumps.dat and converts it to the other endian format if you type yes to confirm.

EXIT

Stops a MUPIP process and return control to the process from which MUPIP was invoked.

The format of the MUPIP EXIT command is:

EXI[T]

The EXIT command does not accept any qualifiers.

EXTEND

Increases the size of a database file. By default, GT.M automatically extends a database file when there is available space.

The format of the MUPIP EXTEND command is:

EXTE[ND] [-BLOCKS=<data-blocks-to-add>] region-name
  • The only qualifier for MUPIP EXTEND is BLOCKS.

  • The required region-name parameter specifies the name of the region to expand.

  • EXTEND uses the Global Directory to map the region to the dynamic segment and the segment to the file.

  • A V6 database file can have a maximum of 992Mi blocks and a V7 database file can have a maximum of 16Gi blocks. A request to EXTEND blocks beyond this limit produces an error. In such a case, performing a region split, REORG to reclaim free blocks, etc. may be some of the available options. FIS recommends operating procedures to proactively monitoring DB growth to ensure that corrective actions are performed before reaching these limits.

-Blocks

Specifies the number of GDS database blocks by which MUPIP should extend the file. GDS files use additional blocks for bitmaps. MUPIP EXTEND adds the specified number of blocks plus the bitmap blocks required as overhead. For more information about bitmaps, refer to Chapter 9: “GT.M Database Structure(GDS).

The format of the BLOCK qualifier is:

-BLOCKS=data-blocks-to-add

By default, EXTEND uses the extension value in the file header as the number of GDS blocks by which to extend the database file. You can specify as many blocks as needed as long as you are within the maximum total blocks limit (which could be as high as 224 million GDS blocks).

Examples for MUPIP EXTEND

$ mupip extend DEFAULT -blocks=400

This command adds 400 GDE database block to region DEFAULT.

Example:

$ mupip extend REPTILES -blocks=100

This command adds 100 GDE database blocks to the region REPTILES.

EXTRACT

Backups certain globals or to extract data from the database for use by another system. The MUPIP EXTRACT command copies globals from the current database to a sequential output file in one of three formats-GO, BINARY, or ZWR. The format of the MUPIP EXTRACT command is:

EXTR[ACT] 
[
 -FO[RMAT]={GO|B[INARY]|Z[WR]}
 -FR[EEZE]
 -LA[BEL]=text
 -[NO]L[OG]
 -R[EGION]=region-list
 -S[ELECT]=global-name-list]
]
{-ST[DOUT]|file-name}
  • By default, MUPIP EXTRACT uses -FORMAT=ZWR.

  • MUPIP EXTRACT uses the Global Directory to determine which database files to use.

  • MUPIP EXTRACT supports user collation routines. When used without the -FREEZE qualifier, EXTRACT may operate concurrently with normal GT.M database access.

  • To ensure that MUPIP EXTRACT reflects a consistent application state, suspend the database updates to all regions involved in the extract, typically with the FREEZE qualifier, or backup the database with the ONLINE qualifier and extract files from the backup.

  • EXTRACT places its output in the file defined by the file- name.

  • In UTF-8 mode, MUPIP EXTRACT write sequential output file in the UTF-8 character encoding. Ensure that MUPIP EXTRACT commands and corresponding MUPIP LOAD commands execute with the same setting for the environment variable gtm_chset.

  • The GO format is not supported for UTF-8 mode. Use BINARY or ZWR formats with UTF-8 mode.

For information on extracting globals with the %GO utility, refer to "M Utility Routines" chapter of the GT.M Programmer's Guide. MUPIP EXTRACT is typically faster, but %GO can be customized.

The following sections describe the qualifiers of MUPIP EXTRACT command.

-FOrmat

Specifies the format of the output file. The format of the FORMAT qualifier is:

-FO[RMAT]=format_code

The format code is any one of the following:

  1. B[INARY] - Binary format, used for database reorganization or short term backups. MUPIP EXTRACT -FORMAT=BINARY works much faster than MUPIP EXTRACT -FORMAT=GO and MUPIP EXTRACT -FORMAT=ZWR. Note: There is no defined standard to transport binary data from one GT.M implementation to another. Further, FIS reserves the right to modify the binary format in new versions. The first record of a BINARY format data file contains the header label. The header label is 87 characters long. The following table illustrates the components of the header label.

    BINARY Format Data File Header Label

    CHARACTERS

    EXPLANATION

    1-2

    Hexadecimal representation of the length of the label (by default 64 - decimal 100).

    3-28

    Fixed-length ASCII text containing:

    • "GDS BINARY EXTRACT LEVEL 6": when no region is encrypted.

    • "GDS BINARY EXTRACT LEVEL 8": when one more regions are encrypted using null IVs.

    • "GDS BINARY EXTRACT LEVEL 9": when one or regions are encrypted using non-null IVs.

    29-41

    Fixed-length ASCII text: Date and time of extract in the $ZDATE() format: "YEARMMDD2460SS".

    42-48

    Fixed-length ASCII text: Decimal maximum block size of the union of each region from which data was extracted.

    49-55

    Fixed-length ASCII text: Decimal maximum record size of the union of each region from which data was extracted.

    56-62

    Fixed-length ASCII text:Decimal maximum key size of the union of each region from which data was extracted.

    63-69

    Fixed-length ASCII text:Boolean indicator of Standard NULL collation (1) or GT.M legacy collation (0).

    70-100

    Fixed-length ASCII text: Space-padded label specified by the -LABEL qualifier; the default LABEL is "GT.M MUPIP EXTRACT"

    For extracts in UTF-8 mode, GT.M prefixes UTF-8 and a space to -LABEL.

  2. GO - Global Output format, used for files to transport or archive. -FORMAT=GO stores the data in record pairs. Each global node produces two records - the first contains the key and the second contains the value. MUPIP EXTRACT -FORMAT=GO has two header records - the first is a text label (refer to the LABEL qualifier) and the second is the date and time of extract in $ZDATE() format DD-MON-YEAR 24:60:SS. If -LABEL is not specified, the default first header is "GT.M MUPIP EXTRACT".

  3. ZWR - ZWRITE format, used for files to transport or archive that may contain non-graphical information. Each global node produces one record with both key and value. MUPIP EXTRACT -FORMAT=ZWR has two header records, which are the same as for FORMAT=GO, except that the second record ends with the text " ZWR".

-FReeze

Prevents database updates to all database files from which the MUPIP EXTRACT command is copying records. FREEZE ensures that a MUPIP EXTRACT operation captures a "sharp" image of the globals, rather than one "blurred" by updates occurring while the copy is in progress.

The format of the FREEZE qualifier is:

-FR[EEZE]

By default, MUPIP EXTRACT does not "freeze" regions during operation.

-LAbel

Specifies the text string that becomes the first record in the output file. MUPIP EXTRACT -FORMAT=BINARY truncates the label text to 32 characters. The format of the LABEL qualifier is:

-LA[BEL]=text
  • By default, EXTRACT uses the label "GT.M MUPIP EXTRACT."

  • For more detailed information about the -FORMAT=BINARY header label, refer to the description of EXTRACT -FORMAT=BINARY.

-LOg

Displays a message on stdout for each global extracted with the MUPIP EXTRACT command. The message displays the number of global nodes, the maximum subscript length and maximum data length for each global. The format of the LOG qualifier is:

-[NO]LO[G]

By default, EXTRACT operates -LOG.

-Null_iv

Creates an encrypted binary extract with null IVs from a database with non-null IVs, which can be restored to a version that does not support non-null IVs. The format of the -NULL_IV qualifier is:

-[NO]NULL_IV
  • GT.M versions prior to V6.3-000 used empty (all zeros or "NULL_IV") initialization vectors(IVs) to encrypt or decrypt -FORMAT="BINARY" extracts.

  • GT.M version starting from V6.3-000 use non-zero IVs.

  • Use the NULL_IV qualifier only on encrypted databases to create an encrypted binary extract in GDS BINARY EXTRACT LEVEL 8 format. This format can load data on any encrypted GT.M database created with a version prior to V6.3-000.

  • The default is -NONULL_IV which produces a binary extract in GDS BINARY EXTRACT LEVEL 9 format.

-Region

Restricts MUPIP EXTRACT to a set of regions. The format of the REGION qualifier is:

-R[EGION]=region-list 

region-list may specify more than one region of the current global directory in a list. Regions are case-insensitive, separated by a comma, and wildcards can be used to specify them. Any region-name may include the wildcard characters * and % (remember to escape them to protect them from inappropriate expansion by the shell). Any region name expansion occurs in M (ASCII) collation order.

-Select

Specifies globals for a MUPIP EXTRACT operation. The format of the SELECT qualifier is:

-S[ELECT]= global-specification
  • By default, EXTRACT selects all globals, as if it had the qualifier -SELECT=*

  • The caret symbol (^) in the specification of the global name is optional.

The global-specification can be:

  • A global name, such as MEF. In this case, MUPIP EXTRACT selects only global ^MEF.

  • A range of global names, such as A7:B6. In this case, MUPIP EXTRACT selects all global names between ^A7 and ^B6, inclusive.

  • A list, such as A,B,C. In this case, MUPIP EXTRACT selects globals ^A, ^B, and ^C.

  • A suffix with a global name. For example, PIGEON* selects all global names from ^PIGEON through ^PIGEONzzzzz. You can use suffixes with a global name or a list.

[Note] Note

If the rules for selection are complex, it may be easier to construct an ad hoc Global Directory that maps the global variables to be extracted to the database file. This may not be permissible if the database file is part of a replicated instance. If this is the case, work with a backup of the database.

-STdout

Redirects database extract to the standard output stream. The format of the STDOUT qualifier is:

-ST[DOUT]

Examples for MUPIP EXTRACT

Example:

$ mupip extract -format=go -freeze big.glo

This command prevents database updates during a MUPIP EXTRACT operation.

Example:

$ mupip extract -format=GO mumps_i.go

This command creates an extract file called mumps_i.go in "Global Output" format. Use this format to transport or archive files. The first record of a GO format file contains the header label, "GT.M MUPIP EXTRACT," as text.

Example:

$ mupip extract -format=BINARY v5.bin

This command creates an extract file called v5.bin in Binary format. Use this format for reorganizing a database or for short-term backups.

Example:

$ mupip extract -format=ZWR -LABEL=My_Label My_Extract_File

This example extracts all globals from the current database to file My_Extract_File (in ZWRITE format) with label My_Label.

Example:

$ mupip extract -nolog FL.GLO

This command creates a global output file, FL.GLO, (which consists of all global variables in the database) without displaying statistics on a global-by-global basis. As there is no label specified, the first record in FL.GLO contains the text string "GT.M MUPIP EXTRACT."

Example:

$ mupip extract -select=Tyrannosaurus /dev/tty

This command instructs EXTRACT to dump the global ^Tyrannosaurus to the device (file-name) /dev/tty.

FREEZE

Temporarily suspends (freezes) updates to the database after ensuring a consistent state between memory and secondary storage, which, with -ACCESS_METHOD=BG, means after flushing global buffers. If you prefer a non-GT.M utility to perform a backup or reorganization, you might use this facility to provide standalone access to your GT.M database. You might use MUPIP FREEZE to suspend (and later resume) database updates for creating mirrored disk configuration or re-integrating a mirror.

GT.M BACKUP, INTEG, and REORG operations may implicitly freeze and unfreeze database regions. However, for most operations, this freeze/unfreeze happens internally and is transparent to the application.

The format of the MUPIP FREEZE command is:

FR[EEZE] {-OF[F] [-OV[ERRIDE]]|-ON [[-ONL[INE] [-[NO]AUTORELEASE]] | [-NOONL[INE]] [-R[ECORD]]]} region-list
  • The region-list identifies the target of the FREEZE. region-list may specify more than one region of the current global directory in a list. Regions are case-insensitive, separated by a comma, and wildcards can be used to specify them. Any region-name may include the wildcard characters * and % (remember to escape them to protect them from inappropriate expansion by the shell). Any region name expansion occurs in M (ASCII) collation order.

  • MUPIP FREEZE waits for up to one minute so that concurrent KILL or MUPIP REORG operations can complete. If the KILL or MUPIP REORG commands do not complete within one minute, MUPIP FREEZE unfreezes any regions it had previously marked as frozen and terminates with an error.

  • To ensure that a copy or reorganized version of a database file contains a consistent set of records, concurrent MUPIP utilities, such as BACKUP (without the ONLINE qualifier) and EXTRACT, include mechanisms to ensure that the database does not change while the MUPIP utility is performing an action. FIS recommends the use of the -ONLINE qualifier with BACKUP.

  • A MUPIP FREEZE can be removed only by the user who sets the FREEZE or by using -OVERRIDE.

  • A MUPIP FREEZE -ON can specify either -NOONLINE, the default, or -ONLINE, and if -ONLINE, can specify either -AUTORELEASE, the default, or -NOAUTORELEASE.

  • A FREEZE specifying -ONLINE attempts to minimize the impact of the FREEZE on concurrently updating processes by restricting all database-related updates to memory as long as it can.

  • A FREEZE specifying -ONLINE -AUTORELEASE allows updates to continue immediately when GT.M needs to update the database file.

  • After MUPIP FREEZE -ON -NOONLINE, processes that are attempting updates "hang" until the FREEZE is removed by the MUPIP FREEZE -OFF command or DSE. Make sure that procedures for using MUPIP FREEZE, whether manual or automated, include provisions for removing the FREEZE in all appropriate cases, including when errors disrupt the normal flow.

  • MUPIP FREEZE sends a DBFREEZEON/DBFREEZEOFF message to the system log for each region whose freeze state is changed.

  • A -RECOVER/-ROLLBACK for a database reverts to a prior database update state. Therefore, a -RECOVER/-ROLLBACK immediately after a MUPIP FREEZE -ON removes the freeze. However, -RECOVER/-ROLLBACK does not succeed if there are processes attached (for example when a process attempt a database update immediately after a MUPP FREEZE -ON) to the database.

FREEZE must include one of the qualifiers:

-OF[F]
-ON

The optional qualifiers are:

-[NO]A[UTORELEASE] - only valid with -ONLINE
-ON[LINE] - only valid with -ON
-OV[ERRIDE]
-R[ECORD] - only valid with -ON

-OFf

Clears a freeze set by another process with the same userid.

The format of the OFF qualifier is:

OF[F]
  • A FREEZE -OFF which turns off a FREEZE -ONLINE -AUTORELEASE produces a OFRZNOTHELD warning to indicate that the freeze was automatically released and therefore did not protect whatever concurrent actions it was intended to guard.

  • When used with -OVERRIDE, -OFF stops a freeze operation set by a process with a different userid.

  • Incompatible with: -ON, -RECORD

-ON

Specifies the start of a MUPIP FREEZE operation. The format of the ON qualifier is:

-ON

Incompatible with: -OFF, -OVERRIDE

-[NO]A[UTORELEASE

Controls the behavior of a FREEZE specified with -ONLINE when GT.M must write to a database file. The format of the AUTORELEASE qualifier is:

-[NO]A[UTORELEASE]
  • -AUTORELEASE, the default, causes GT.M to release the freeze if it needs to update the file before a FREEZE -OFF.

  • When FREEZE -ONLINE is in effect, MUPIP rejects all SET actions and produces the OFRZACTIVE warning; if you need to perform any such SET actions, you must release the freeze first.

  • -NOAUTORELEASE causes GT.M to hold off actions that need to update the database file until someone issues a MUPIP FREEZE -OFF.

  • The actions that require GT.M to write to the database file are:

    • Insufficient global buffers to hold updates - GT.M must flush buffers to make space to do any additional updates

    • Insufficient space in the database to hold updates - GT.M must extend the file

    • The journal file reaches its maximum size

    • An epoch comes due - GT.M must create a checkpoint

    • Someone issues a MUPIP BACKUP command - GT.M must record state information to mark the beginning of the backup

  • When an -AUTORELEASE abandons a FREEZE, any actions that depend on the stability of the database file on secondary storage, such as a database copy, lose that protection and are not reliable, so they likely need to be repeated at a time when an -AUTORELEASE is less likely or when -NOONLINE is more appropriate.

  • An -AUTORELEASE action produces an OFRZAUTOREL message in the operator log.

  • An -AUTORELEASE action requires a FREEZE -OFF to reestablish a normal database state.

  • Incompatible with: -OFF, -NOONLINE

-ONLine

Controls the potential impact of a FREEZE on concurrently updating processes. The format of the ONLINE qualifier is:

-[NO]ONL[INE]
  • ON -NOONLINE, the default, causes the freeze to last until OFF, and makes management of the FREEZE straightforward.

  • ON -ONLINE, causes GT.M to attempt to minimize the impact of the FREEZE on concurrently updating processes by taking a number of actions, as appropriate:

    • Switching journal files to provide maximum space

    • Performing an epoch to provide maximum time to the next epoch

    • Flushing the global buffers to make all available to hold updates

    • Incompatible with: -AUTORELEASE, -OFF

  • After performing these preparations, -ONLINE allows updating processes to make updates to global buffers but defers flushing them to the database file.

  • -ONLINE cannot apply to MM databases, so a FREEZE -ONLINE skips any MM regions it encounters.

  • Refer to -AUTORELEASE above for additional information.

  • Incompatible with: -OFF

[Note] Note

If a database is nearly full, and you about to use MUPIP FREEZE -ON -ONLINE, you may want to use MUPIP EXTEND first as a database file extension will either AUTORELEASE or "harden" the -ONLINE freeze effectively into a -NOONLINE freeze.

-OVerride

Release a freeze set by a process with a different userid. GT.M provides OVERRIDE to allow error recovery in case a procedure with a freeze fails to release. The format of the OVERRIDE qualifier is:

-OV[ERRIDE]
  • OVERRIDE should not be necessary (and may even be dangerous) in most schemes.

  • Incompatible with: -AUTORELEASE, -ON, -ONLINE -RECORD

-Record

Specifies that a MUPIP FREEZE operation should record an event as a reference point. You might use MUPIP FREEZE to set up your database for a custom-backup mechanism (SAN or mirror-based).

The format of the RECORD qualifier is:

-R[ECORD]
  • You might use -RECORD to integrate MUPIP BACKUP -BYTESTREAM with an external backup mechanism.

  • -RECORD replaces the previously RECORDed transaction identifier for the database file.

  • Incompatiable with: -OFF and -OVERRIDE.

Examples for MUPIP FREEZE

Example:

$ mupip freeze -off DEFAULT

This command stops an ongoing MUPIP FREEZE operation on the region DEFAULT.

Example:

$ mupip freeze -on "*"

This command prevents updates to all regions in the current Global Directory.

Example:

$ set +e
$ mupip freeze -on -record "*"
$ tar cvf /dev/tape /prod/appl/*.dat
$ mupip freeze -off
$ set -e

The set +e command instructs the shell to attempt all commands in the sequence , regardless of errors encountered by any command. This ensures that the freeze -off is processed even if the tar command fails. FREEZE prevents updates to all database files identified by the current Global Directory. The -record qualifier specifies that the current transaction in each database be stored in the RECORD portion of the database file header. The tar command creates a tape archive file on the device /dev/tape, containing all the files from /prod/app that have an extension of .dat. Presumably all database files in the current Global Directory are stored in that directory, with that extension. The second FREEZE command re-enables updates that were suspended by the first FREEZE. The set -e command re-enables normal error handling by the shell.

Example:

$ mupip freeze -override -off DEFAULT

This command unfreezes the DEFAULT region even if the freeze was set by a process with a different userid.

FTOK

Produces the "public" (system generated) IPC Keys (essentially hash values) of a given file-list or the journal/receiver pool in a table form.

The format of the MUPIP FTOK command is:

FT[OK] [-DB] [-JNLPOOL] [-RECVPOOL] [-ID] [-ONLY] [-[NO]HEADER] file-list
  • file-list a space delimited list of files, such as that provided by the use of the * and ? shell wildcard characters.

  • With -JNLPOOL or -RECVPOOL, MUPIP FTOK ignores any files in the list.

-DB

Specifies that the file-name is a database file. By default, MUPIP FTOK uses -DB.

-ID

Specifies the signature use for the ftok; if unspecified, it defaults to the signature for a GT.M database file. if a file is not valid and accessible, FTOK reports -1 values. By default, the utility provides additional information about the file, including its file ID which provides the basis for the FTOK.

-[NO]HEADER

Displays or omits the header of the table. -ONLY output has no header, but by default other forms include a header that -NOHEADER suppresses.

-ONLY

Restricts the output to only the FTOK Key; if a file is not valid and accessible, FTOK reports -1 values. -ONLY does not report the table header even when -HEADER is specified. If the database file is unavailable, the utility defaults to the -ONLY behavior.

-JNLPOOL

Specifies that the reported key is for the Journal Pool of the instance created by the current Global Directory.

-RECVPOOL

Specifies that the reported key is for the Receive Pool of the instance created by the current Global Directory.

Example:

$ mupip ftok -id mumps.dat
                File ::            Semaphore Id ::        Shared Memory Id ::                FTOK Key ::                             FileId
-------------------------------------------------------------------------------------------------------------------------------------------
           mumps.dat :: 1044382209 [0x3e400201] ::  613417274 [0x2490013a] ::  725039842 [0x2b373ae2] :: 0x00000000000e09818000002900000001
    
$ mupip ftok -id -only mumps.dat
           mumps.dat  ::   725039842  [ 0x2b373ae2 ]
$ mupip ftok -id -noheader mumps.dat
           mumps.dat :: 1044382209 [0x3e400201] ::  613417274 [0x2490013a] ::  725039842 [0x2b373ae2] :: 0x00000000000e09818000002900000001
  
$ mupip ftok -jnlpool 
                File ::            Semaphore Id ::        Shared Memory Id ::                FTOK Key ::                             FileId
-------------------------------------------------------------------------------------------------------------------------------------------
          multi.repl ::         -1 [0xffffffff] ::         -1 [0xffffffff] ::  743218009 [0x2c4c9b59] :: 0x00000000000e09838000002900000001
             jnlpool ::  636486196 [0x25f00234] ::  578814256 [0x22800130]

HASH

Uses a 128 bit hash based on the MurmurHash3 algorithm to provide provides the hash of source files from the command line.

The format of the MUPIP HASH command is:

MUPIP HASH <file-names> 

INTEG

Performs an integrity check on a GT.M database file. You can perform structural integrity checks on one or more regions in the current Global Directory without bringing down (suspending database updates) your application. However, a MUPIP INTEG on a single file database requires standalone access but does not need a Global Directory. The order in which the MUPIP INTEG command selects database regions is a function of file system layout and may vary as files are moved or created. Execute a MUPIP INTEG operations one database file at a time to generate an report where the output always lists database files in a predictable sequence. For example, to compare output with a reference file, run INTEG on one file at a time.

Always use MUPIP INTEG in the following conditions:

  • Periodically - to ensure ongoing integrity of the database(s); regular INTEGs help detect any integrity problems before they spread and extensively damage the database file.

  • After a crash - to ensure the database was not corrupted. (Note: When using before-image journaling, when the database is recovered from the journal file after a crash, an integ is not required).

  • When database errors are reported - to troubleshoot the problem.

Improving the logical and physical adjacency of global nodes may result in faster disk I/O. A global node is logically adjacent when it is stored within a span of contiguous serial block numbers. A global node is physically adjacent when it resides on adjacent hard disk sectors in a way that a single seek operation can access it. Database updates (SETs/KILLs) over time affect the logical adjacency of global nodes. A MUPIP INTEG reports the logical adjacency of your global nodes which may indicate whether a MUPIP REORG could improve the database performance. A native file system defragmentation improves physical adjacency.

[Note] Note

Most modern SAN and I/O devices often mask the performance impact of the adjustments in logical and physical adjacency. If achieving a particular performance benchmark is your goal, increasing the logical and physical adjacency should be only one of many steps that you might undertake. While designing the database, try to ensure that the logical adjacency is close to the number of blocks that can physically reside on your hard disk's cylinder. You can also choose two or three cylinders, with the assumption that short seeks are fast.

The format of the MUPIP INTEG command is:

INTE[G] 
[
 -A[DJACENCY]=integer
 -BL[OCK]=hexa;block-number
 -BR[IEF]
 -DMAX[BLOCKSIZE][=integer]
 -FA[ST]
 -FU[LL]
 -IMAX[BLOCKSIZE][=integer]
 -[NO]K[EYRANGES]
 -[NO]MAP[=integer]
 -[NO]MAXK[EYSIZE][=integer]
 -[NO]O[NLINE]
 -S[UBSCRIPT]=subscript] 
 -TN[_RESET]
 -[NO]TR[ANSACTION][=integer]
]
{[-FILE] file-name|-REG[ION] region-list}
  • MUPIP INTEG requires specification of either file(s) or region(s).

  • Press <CTRL-C> to stop MUPIP INTEG before the process completes.

  • The file-name identifies the database file for a MUPIP INTEG operation. The region-list identifies one or more regions that, in turn, identify database files through the current Global Directory.

  • MUPIP INTEG operation keeps track of the number of blocks that do not have the current block version during a non-fast integ (default or full) and matches this value against the blocks to upgrade counter in the file-header. It issues an error if the values are unmatched and corrects the count in the file header if there are no other integrity errors.

[Important] Important

Promptly analyze and fix all errors that MUPIP INTEG reports. Some errors may be benign while others may be a signs of corruption or compromised database integrity. If operations continue without fixes to serious errors, the following problems may occur:

  • Invalid application operation due to missing or incorrect data.

  • Process errors, including inappropriate indefinite looping, when a database access encounters an error.

  • Degrading application level consistency as a result of incomplete update sequences caused by the preexisting database integrity issues.

FIS strongly recommends fixing the following errors as soon as they are discovered:

  • Blocks incorrectly marked free - these may cause accelerating damage when processes make updates to any part of the database region.

  • Integrity errors in an index block - these may cause accelerating damage when processes make updates to that area of the database region using the faulty index. For more information, refer to Chapter 11: “Maintaining Database Integrity.

MUPIP INTEG -FAST and the "regular" INTEG both report these errors (These qualifiers are described later in this section). Other database errors do not pose the threat of rapidly spreading problems in GDS files. After the GT.M database repair, assess the type of damage, the risk of continued operations, and the disruption in normal operation caused by the time spent repairing the database. For information on analyzing and correcting database errors, refer to Chapter 11: “Maintaining Database Integrity. Contact your GT.M support channel for help assessing INTEG errors.

The following sections describe the qualifiers of the INTEG command.

-ADjacency

Specifies the logical adjacency of data blocks that MUPIP INTEG should assume while diagnosing the database. By default, MUPIP INTEG operates with -ADJACENCY=10 and reports the logical adjacency in the "Adjacent" column of the MUPIP INTEG report.

  • The complexity of contemporary disk controllers and the native file system may render this report superfluous. But when it is meaningful, this report measures the logical adjacency of data.

  • A MUPIP REORG improves logical adjacency and a native file system defragmentation improves physical adjacency.

The format of the ADJACENCY qualifier is:

-AD[JACENCY]=integer

-BLock

Specifies the block for MUPIP INTEG command to start checking a sub-tree of the database. MUPIP INTEG -BLOCK cannot detect "incorrectly marked busy errors".

The format of the BLOCK qualifier is:

-BL[OCK]=block-number
  • Block numbers are displayed in an INTEG error report or by using DSE.

  • Incompatible with: -SUBSCRIPT and -TN_RESET

-BRief

Displays a single summary report by database file of the total number of directory, index and data blocks. The format of the BRIEF qualifier is:

-BR[IEF]
  • By default, MUPIP INTEG uses the BRIEF qualifier.

  • Incompatible with: -FULL

-DMAXblocksize

Specifies the maximum actual size of a data-level block in the database; any data block which contains data in excess of this size causes integ to report the block number, its path, and an error. The format of the DMAXBLOCKSIZE qualifier is:

-DMAX[BLOCKSIZE][=integer]

-FAst

Checks only index blocks. FAST does not check data blocks.

The format of the FAST qualifier is:

-FA[ST]
  • -FAST produces results significantly faster than a full INTEG because the majority of blocks in a typical database are data blocks.

  • While INTEG -FAST is not a replacement for a full INTEG, it very quickly detects those errors that must be repaired immediately to prevent accelerating database damage.

  • By default, INTEG checks all active index and data blocks in the database.

  • -FAST reports include adjacency information.

  • Incompatible with: -TN_RESET.

-FIle

Specifies the name of the database file for the MUPIP INTEG operation. FILE requires exclusive (stand-alone) access to a database file and does not require a Global Directory. The format of the FILE qualifier is:

-FI[LE]
  • With stand-alone access to the file, MUPIP INTEG -FILE is able to check whether the reference count is zero. A non-zero reference count indicates prior abnormal termination of the database.

  • The -FILE qualifier is incompatible with the -REGION qualifier.

  • By default, INTEG operates on -FILE.

-FUll

Displays an expanded report for a MUPIP INTEG operation. With -FULL specified, MUPIP INTEG displays the number of index and data blocks in the directory tree and in each global variable tree as well as the total number of directory, index and data blocks. The format of the FULL qualifier is:

-FU[LL]
  • The -FULL qualifier is incompatible with the -BRIEF qualifier.

  • By default, INTEG reports are -BRIEF.

  • Use -FULL to have INTEG report all global names in a region or list of regions.

-IMAXblocksize

Specifies the maximum actual size of an index-level block in the database; any index block which contains data in excess of this size causes integ to report the block number, its path, and an error. The format of the IMAXBLOCKSIZE qualifier is:

-IMAX[BLOCKSIZE][=integer]

-Keyranges

Specify whether the MUPIP INTEG report includes key ranges that identify the data suspected of problems it detects. The format of the KEYRANGES qualifier is:

-[NO]K[EYRANGES]

By default, INTEG displays -KEYRANGES.

-MAP

Specifies the maximum number of "incorrectly marked busy errors" that MUPIP INTEG reports. The format of the MAP qualifier is:

-[NO]MAP[=max_imb_errors]
  • <max_imb_errors> specifies the threshold limit for the number of incorrectly marked busy errors.

  • -NOMAP automatically sets a high threshold limit of 1000000 (1 million) incorrectly marked busy errors (-MAP=1000000).

  • By default, INTEG reports a maximum of 10 map errors (-MAP=10).

[Note] Note

MUPIP INTEG reports all "incorrectly marked free" errors as they require prompt action. MAP does not restrict their reports.

An error in an index block prevents INTEG from processing potentially large areas of the database. A single "primary" error may cause large numbers of "secondary" incorrectly marked busy errors, which are actually useful in identifying valid blocks that have no valid index pointer. Because "real" or primary incorrectly marked busy errors only make "empty" blocks unavailable to the system, they are low impact and do not require immediate repair.

[Note] Note

After a database recovery with -RECOVER (for example, using -BEFORE_TIME) or -ROLLBACK (for example, using -FETCHRESYNC), the database may contain incorrectly marked busy errors. Although these errors are benign, they consume available space. Schedule repairs on the next opportunity.

-MAXkeysize

Specifies the maximum number of "key size too large" errors that a MUPIP INTEG operation reports. The format of the MAXKEYSIZE qualifier is:

-[NO]MAX[KEYSIZE][=integer]
  • By default, INTEG reports a maximum of 10 key size errors (-MAXKEYSIZE=10).

  • -NOMAXKEYSIZE removes limits on key size reporting so that INTEG reports all key size too large errors.

  • -NOMAXKEYSIZE does not accept assignment of an argument.

  • "Key size too large" errors normally occur only if a DSE CHANGE -FILEHEADER -KEY_MAX_SIZE command reduces the maximum key size.

-Online

Specifies that while a MUPIP INTEG operation is active, other processes can update the database without affecting the result of the backup. Allows checking database structural integrity to run concurrently with database updates. The format of the ONLINE qualifier is:

-[NO]O[NLINE]
  • -NOONLINE specifies that the database should be frozen during MUPIP INTEG.

  • By default, MUPIP INTEG is online.

  • Since MUPIP INTEG -ONLINE does not freeze database updates, it cannot safely correct errors in the "blocks to upgrade" and "free blocks" fields in the file header, while MUPIP INTEG -NOONLINE can correct these fields.

  • As it checks each database file, MUPIP INTEG -ONLINE creates a sparse file of the same size as the database. As each GT.M process updates the database, it places a copy of the old block in the sparse file before updating the database. For any database blocks with a newer transaction number than the start of the INTEG, MUPIP uses the copy in the sparse file. Thus, analogous with MUPIP BACKUP -ONLINE, INTEG reports on the state of the database as of when it starts, not as of when it completes. Note: a command such as ls -l command shows sparse files at their full size, but does not show actual disk usage. Use a command such as du -sh to see actual disk usage.

  • The environment variable gtm_snaptmpdir can be used to indicate a directory where MUPIP should place the snapshot files (used by MUPIP INTEG -ONLINE). If gtm_snaptmpdir does not exist, INTEG uses the location specified by gtm_baktmpdir and if neither of those environment variables is defined, INTEG places the snapshot files in the current directory at the time you issue the INTEG command. MUPIP and GT.M processes automatically cleans up these temporary snapshot files under a wide variety of conditions.

  • Temporary directory security settings must allow write access by the MUPIP process and by all processes updating the database. MUPIP creates the temporary file with the same access as the database file so processes updating the database can write to the temporary file. If the database is encrypted, the updating processes write encrypted blocks to the snapshot file and the MUPIP INTEG process must start with access to appropriate key information as it does even -NOONLINE.

  • MUPIP INTEG -NOONLINE [-FAST] {-REGION|-FILE} clears the KILLs in progress and Abandoned Kills flags if the run includes the entire database and there are no incorrectly marked busy blocks.

  • Only one online integ can be active per database region. If an online integ is already active, a subsequent one issues an error and immediately terminates. If an online integ does not successfully complete, GT.M cleans it up in one of the following ways:

    1. A subsequent online integ detects that an earlier one did not successfully complete and releases the resources held by the prior online integ before proceeding.

    2. If a MUPIP STOP was issued to the online integ process, the process cleans up any resources it held. Note: since the process was stopped the results of the integ may not be valid.

    3. subsequent MUPIP RUNDOWN ensures the release of resources held by prior unsuccessful online integs for the specified regions.

    4. For every 64K transactions after the online integ initiation, online integ checks GT.M health for improperly abandoned online integs and releases resources held by any it finds.

  • Incompatible with: -FILE, -TN_RESET (there should be no need to use -TN_RESET on a GT.M V5 database).

-Region

Specifies that the INTEG command identifies one or more regions rather than a database file. The format of the REGION qualifier is:

-R[EGION]=region-list
  • The region-list identifies the target of INTEG; region-list may specify more than one region of the current global directory in a list. INTEG treats regions names (separated by commas) as case-insensitive with optional wildcard characters * and ? expanded in M (ASCII) collation order. Remember to escape wildcard characters to protect them from inappropriate expansion by the shell. INTEG processes regions based on the order specified in the region-list.

  • The region-list argument may specify more than one region of the current Global Directory in a list separated with commas. INTEG -REGION requires the environment variable gtmgbldir to specify a valid Global Directory. For more information on defining gtmgbldir, refer to Chapter 4: “Global Directory Editor.

  • Because a KILL may briefly defer marking the blocks it releases "free" in the bit maps, INTEG -REGION may report spurious block incorrectly marked busy errors. These errors are benign. If these errors occur in conjunction with a "Kill in progress" error, resolve the errors after the "Kill in progress" error is no longer present.

  • By default, INTEG operates -FILE.

  • Incompatible with: -FILE, -TN_RESET

-Subscript

Specifies a global or a range of keys to INTEG. The global key may be enclosed in quotation marks (" "). Identify a range by separating two subscripts with a colon (:). -SUBSCRIPT cannot detect incorrectly marked busy errors. The format of the SUBSCRIPT qualifier is:

-SU[BSCRIPT]=subscript

Specify SUBSCRIPT only if the path to the keys in the subscript is not damaged. If the path is questionable or known to be damaged, use DSE to find the block(s) and INTEG -BLOCK.

Incompatible with: -BLOCK, -TN_RESET

-Stats

Specifies INTEG to check any active statistics database associated with the region(s) specified for the command. The format of the STATS qualifier is:

-[NO]ST[ATS]

Specify STATS only if you have reason to understand that statistics reporting is failing with database errors or reporting incorrect results. Because -FILE requires standalone access and statistic databases are automatically created and removed it is incompatible with -STATS. The default is NOSTATS.

Incompatible with: -BLOCK, -FILE, -TN_RESET

-TN_reset

Resets block transaction numbers and backup event recorded transaction numbers to one (1), and the current transaction number to two (2) which makes the backup event recorded transaction numbers more meaningful and useful. It also issues an advisory message to perform a backup.

The format of the TN_RESET qualifier is:

-TN[_RESET]
  • Transaction numbers can go up to 18,446,744,073,709,551,615. This means that a transaction processing application that runs flat out at a non-stop rate of 1,000,000 updates per second would need a TN reset approximately every 584,554 years.

  • The -TN_RESET qualifier rewrites all blocks holding data. If the transaction overflow resets to zero (0) database operation is disrupted.

  • The -TN_RESET qualifier is a protective mechanism that prevents the transaction overflow from resetting to 0.

  • By default, INTEG does not modify the block transaction numbers.

    [Important] Important

    There should never be a need for a -TN_RESET on a database with only V5 blocks, even when cleaning up after a runaway process.

  • The -TN_RESET qualifier is incompatible with the -FAST, -BLOCK, -REGION, and -SUBSCRIPT qualifiers.

[Note] Note

Any time a GT.M update opens a database file that was not properly closed, GT.M increments the transaction number by 1000. This automatic increment prevents problems induced by abnormal database closes, but users must always consider this factor in their operational procedures. The rate at which GT.M "uses up" transaction numbers is a function of operational procedures and real database updates.

-TRansaction

Specifies the maximum number of block transaction- number-too-large errors that MUPIP INTEG reports. The format of the TRANSACTION qualifier is:

-[NO]TR[ANSACTION][=integer]
  • -NOTRANSACTION removes limits on transaction reporting so MUPIP INTEG reports all transaction number errors.

  • -NOTRANSACTION does not accept assignment of an argument.

  • A system crash may generate many "block transaction number too large" errors. These errors can cause problems for BACKUP -INCREMENTAL and for transaction processing. Normally, the automatic increment of 1000 blocks that GT.M adds when a database is reopened averts these errors. If a problem still exists after the database is reopened, users can use a value in the DSE CHANGE -FILEHEADER -CURRENT_TN= command to quickly fix "block transaction number too large number" errors.

  • By default, INTEG reports a maximum of 10 block transaction errors (-TRANSACTION=10).

Examples for MUPIP INTEG

Example:

$ mupip integ -block=4 mumps.dat

This command performs a MUPIP INTEG operation on the BLOCK 4 of mumps.dat.

Example:

$ mupip integ -adjacency=20

A sample output from the above command follows:

Type           Blocks         Records          % Used      Adjacent
Directory           2             110          25.732            NA
Index            1170          341639          88.298             6
Data           340578          519489          99.268        337888
Free             6809              NA              NA            NA
Total          348559          861238              NA        337894
[Spanning Nodes:3329 ; Blocks:341403]

This example performs a MUPIP INTEG operation assuming that logically related data occupies 20 data blocks in the current database. The sample output shows that out of 1137 data blocks, 1030 data blocks are adjacent to each other. One may be able to improve the performance of a database if the all blocks are as adjacent as possible. "% Used" is the amount of space occupied across the in-use blocks divided by the space available in the in-use blocks, and thus represents the packing density for the in-use blocks (excluding local bit maps). Higher "% Used" may actually be undesirable from a performance perspective as they indicate a higher likelihood of block splits with upcoming updates.

Example:

$ mupip integ -brief mumps.dat

This command performs a MUPIP INTEG operation on the database mumps.dat. A sample output from the above command follows:

No errors detected by integ.
Type           Blocks         Records          % Used      Adjacent
Directory           2             110          25.732            NA
Index            1170          341639          88.298             4
Data           340578          519489          99.268        337617
Free             6809              NA              NA            NA
Total          348559          861238              NA        337621
[Spanning Nodes:3329 ; Blocks:341403]

Example:

$ mupip integ -fast mumps.dat

This command performs a MUPIP INTEG operation only on the index block of the database file mumps.dat. A sample output from the above command follows:

No errors detected by fast integ.
 
Type           Blocks         Records          % Used      Adjacent
Directory           2             110          25.732            NA
Index            1170          341639          88.298             4
Data           340578              NA              NA        337617
Free             6809              NA              NA            NA
Total          348559              NA              NA        337621

Note the NA entries for Data type. It means that the MUPIP INTEG -FAST operation checked only index blocks.

$ mupip integ -full mumps.dat

The sample output from the above command follows:

Directory tree
Level          Blocks         Records          % Used      Adjacent
    1               1               1           0.585           NA
    0               1             109          50.878           NA
Global variable ^#t
Level          Blocks         Records          % Used      Adjacent
    1               1               1           0.585             0
    0               1              80          49.609             1
Global variable ^versionContent
Level          Blocks         Records          % Used      Adjacent
    1               1               1           0.585             0
    0               1               1          94.018             0
Global variable ^x
Level          Blocks         Records          % Used      Adjacent
    1               1               2           1.464             0
    0               2             109          52.551             1

Example:

$ mupip integ -map=20 -maxkeysize=20 -transaction=2 mumps.dat

This command performs a MUPIP INTEG operation and restricts the maximum number of "key size too large" errors to 20.

Example:

$ mupip integ -map=20 -transaction=2 mumps.dat

This command performs a MUPIP INTEG operation and restricts the maximum number of "block transaction- number-too-large errors" to 2.

$ mupip integ -file mumps.dat -tn_reset

This command resets the transaction number to one in every database block.

Example:

$ mupip integ -subscript="^Parrots" mumps.dat

This example performs a MUPIP INTEG operation on the global variable ^Parrots in the database file mumps.dat.

Example:

$ mupip integ -subscript="^Amsterdam(100)":"^Bolivia(""Chimes"")" -region DEFAULT

This example performs a MUPIP INTEG operation all global variables greater than or equal to ^Amsterdam (100) and less than or equal to ^Bolivia("Chimes") in the default region(s).

[Note] Note

To specify a literal in the command string, use two double quotation marks for example, ^b(""c"").

INTRPT

Sends an interrupt signal to the specified process. The signal used is [POSIX] SIGUSR1. The format of the MUPIP INTRPT command is:

INTRPT process-id
[Important] Important

Ensure that signal SIGUSR1 is not be used by any C external function calls or any (initially non-GT.M) processes that use call-in support, as it is interpreted by GT.M as a signal to trigger the $ZINTERRUPT mechanism.

  • To INTRPT a process belonging to its own account, a process requires no UNIX privilege.

  • To INTRPT a process belonging to its own GROUP, a process requires UNIX membership in the user group of the target process privilege. To INTRPT a process belonging to an account outside its own GROUP, a process requires UNIX superuser privilege.

JOURNAL

Analyzes, extracts, reports, and recovers data using journal files. For a description of the JOURNAL command, refer to Chapter 6: “GT.M Journaling.

LOAD

Puts the global variable names and their corresponding data values into a GT.M database from a sequential file.

The format of the LOAD command is:

L[OAD] 
[-BE[GIN]=integer -E[ND]=integer 
-FI[LLFACTOR]=integer 
-FO[RMAT]={GO|B[INARY]|Z[WR]]} 
-[O]NERROR={STOP|PROCEED|INTERACTIVE} 
-S[TDIN]] file-name
[Caution] Caution

From an application perspective, performing a MUPIP LOAD operation while an application is running may result in an inconsistent application state for the database.

  • MUPIP LOAD uses the Global Directory to determine which database files to use.

  • LOAD supports user collation routines.

  • LOAD takes its input from the file defined by the file-name, which may be a UNIX file on any device that supports such files.

  • LOAD accepts files with DOS style termination.

  • MUPIP LOAD command considers a sequential file as encoded in UTF-8 if the environment variable gtm_chset is set to UTF-8. Ensure that MUPIP EXTRACT commands and corresponding MUPIP LOAD commands execute with the same setting for the environment variable gtm_chset.

  • For information on loading with an M "percent utility," refer to the %GI section of the "M Utility Routines" chapter in GT.M Programmer's Guide. LOAD is typically faster, but the %GI utility can be customized.

  • Press <CTRL-C> to produce a status message from LOAD. Entering <CTRL-C> twice in quick succession stops LOAD. A LOAD that is manually stopped or stops because of an internal error is incomplete and may lack application level integrity, but will not adversely affect the database structure unless terminated with a kill -9.

[Note] Note

The MUPIP EXTRACT or MUPIP LOAD procedure for large databases are time consuming due to the volume of data that has to be converted from binary to ZWR format (on source) and vice versa (on target). One must also consider the fact that the extract file can be very large for a large database. Users must ensure adequate storage support the size of the extract file and the space occupied by the source and target databases. In order to reduce the total time and space it takes to transfer database content from one endian platform to another, it is efficient to convert the endian format in-place for a database and transfer the converted database. See MUPIP ENDIANCVT for more information on converting the endian format of a database file.

The following sections describe the optional qualifiers of the MUPIP LOAD command.

-FOrmat

Specifies the format of the input file. If the format of the input file is not specified, MUPIP LOAD automatically detects file format (BINARY/ZWR/GO) based on the file header of the input file. If format is specified, it must match the actual format of the input file for LOAD to proceed.

The format codes are:

B[INARY] - Binary format
GO - Global Output format
Z[WR] - ZWRITE format
  • MUPIP LOAD detects file format (BINARY/ZWR/GO) based on the file header of extract files from MUPIP EXTRACT, ^%GO and DSE.

  • -FORMAT=BINARY only applies to Greystone Database Structure (GDS) files. A BINARY format file loads significantly faster than a GO or ZWR format file. -FORMAT=BINARY works with data in a proprietary format. -FORMAT=BINARY has one header record, therefore LOAD -FORMAT=BINARY starts active work with record number two (2).

  • -FORMAT={ZWR|GO} applies to text files produced by tools such as MUPIP EXTRACT or %GO.

  • For FORMAT={ZWR|GO} UTF-8 files not produced by MUPIP EXTRACT or %GO, the first line of the label must contain the case insensitive text "UTF-8".

  • For all -FORMAT={ZWR|GO} files not produced by MUPIP EXTRACT or %GO, the second line should contain the case insensitive test "ZWR" for zwr format or "GLO" for GO format and the two label lines must contain a total of more than 10 characters.

  • -FORMAT=GO expects the data in record pairs. Each global node requires one record for the key and one for the data.

  • -FORMAT=ZWR expects the data for each global node in a single record.

-BEgin

Specifies the record number of the input file with which LOAD should begin. Directing LOAD to begin at a point other than the beginning of a valid key causes an error. The format of the BEGIN qualifier is:

-BE[GIN]=integer
[Important] Important

Always consider the number of header records for choosing a -BEGIN point. See FORMAT qualifier for more information.

  • For -FORMAT=GO input, the value is usually an odd number. As -FORMAT=BINARY requires important information from the header, this type of load requires an intact file header regardless of the -BEGIN value.

  • For -FORMAT = ZWR input, each record contains a complete set of reference and data information. The beginning values are not restricted, except to allow two records for the header.

  • By default, LOAD starts at the beginning of the input file.

-End

Specifies the record number of the input file at which LOAD should stop. -END=integer must be greater than the -BEGIN=integer for LOAD to operate. LOAD terminates after processing the record of the number specified by -END or reaching the end of the input file. The format of the END qualifier is:

-E[ND]=integer

The value of -FORMAT=GO input should normally be an even number. By default, LOAD continues to the end of the input file.

-FIll_factor

Specifies the quantity of data stored in a database block. Subsequent run-time updates to the block fill the remaining available space reserved by the FILL_FACTOR. Blocks that avoid block splits operate more efficiently. The format of the FILL_FACTOR qualifier is:

-FI[LL_FACTOR]=integer
  • Reserves room and avoid unnecessary block split to accommodate the forecasted growth in a global variable that may experience significant rate of additions over a period.

  • Users having database performance issues or a high rate of database updates must examine the defined FILL_FACTORs. Unless the application only uses uniform records, which is not typical for most applications, FILL_FACTORs do not work precisely.

  • By default, LOAD uses -FILL_FACTOR=100 for maximum data density.

[Note] Note

FILL_FACTOR is useful when updates add or grow records reasonably uniformly across a broad key range. If updates are at ever ascending or descending keys, or if the record set and record sizes are relatively static in the face of updates, FILL_FACTOR won't provide much benefit.

-Onerror

Determines the MUPIP LOAD behavior when it encounters an error. The format of the ONERROR qualifier is:

-[O]NERROR={STOP|PROCEED|INTERACTIVE}
  • STOP causes MUPIP LOAD to exit immediately.

  • PROCEED proceeds to the next record.

  • INTERACTIVE prompts to continue or stop.

By default MUPIP LOAD exits on encountering an error.

-Stdin

Specifies that MUPIP LOAD takes input from standard input (stdin). The format of the STDIN qualifier is:

-S[TDIN]

Examples for MUPIP LOAD

Example:

$ mupip load ex_file.go

This command loads the content of the extract file ex_file.go to the current database.

Example:

$ mupip load -format=go big.glo

This command loads an extract file big.glo in the current database.

Example:

$ mupip load -begin=5 -end=10 rs.glo

This command begins MUPIP LOAD operation from record number 5 and ends at record number 10. Note that the value for BEGIN is an odd number. A sample output from the above command follows:

GT.M MUPIP EXTRACT
02-MAR-2011 18:25:47 ZWR
Beginning LOAD at record number: 5
LOAD TOTAL Key Cnt: 6 
Max Subsc Len: 7 
Max Data Len: 1
Last LOAD record number: 10

Example:

$ mupip load -fill_factor=5 reobs.glo

This command set the FILL_FACTOR to 5 for loading an extract file in the current database.

Example:

$cat big.glo | mupip load -stdin
$mupip load -stdin < big.glo

These commands loads the extract file big.glo using -stdin.

RCTLDUMP

Reports information related to relinkctl files and their associated shared memory segments. The format of the MUPIP RCTLDUMP command is:

MUPIP RCTLDUMP [dir1]

If the optional parameter dir1 is not specified, MUPIP RCTLDUMP dumps information on all its active auto-relink-enabled directories (those with with a *-suffix) identified by $gtmroutines. With a directory path specified for dir1, MUPIP RCTLDUMP reports information on the one directory. An example output follows. It lists the full path of the Object directory; its corresponding relinkctl file name; the number of routines currently loaded in this relinkctl file; the number of processes including the reporting MUPIP process that have this Relinkctl file open; the shared memory id and length of the Relinkctl shared memory segment; one or more Rtnobj shared memory segment(s); and a listing of all the routine names loaded in this file (lines starting with rec#...).

  • The Rtnobj shared memory line : All the length fields are displayed in hexadecimal. shmlen is the length of the allocated shared memory segment in bytes. shmused is the length that is currently used. shmfree is the length available for use. objlen is the total length of all the objects currently loaded in this shared memory. As GT.M allocates blocks of memory with sizes rounded-up to an integer power of two bytes, shmused is always greater than objlen; for example with an objlen of 0x1c0, the shmused is 0x200.

  • Lines of the form rec#... indicate the record number in the relinkctl file. Each relinkctl file can store a maximum of 1,000,000 records, i.e., the maximum number of routines in a directory with auto-relink enabled is one million. Each record stores a routine name (rtnname:), the current cycle for this object file record entry (cycle:) which gets bumped on every ZLINK or ZRUPDATE command, the hash of the object file last loaded for this routine name (objhash:), the number of different versions of object files loaded in the Rtnobj shared memory segments with this routine name (numvers:), the total byte-length of the one or more versions of object files currently loaded with this routine name (objlen:), the total length used up in shared memory for these object files where GT.M allocates each object file a rounded-up perfect 2-power block of memory (shmlen:), the number of times a routine has been superseded/replaced (superseded:).

Given a relinkctl file name, one can find the corresponding directory path using the Unix "strings" command on the Relinkctl file. For example, "strings /tmp/gtm-relinkctl-f0938d18ab001a7ef09c2bfba946f002", corresponding to the above MUPIP RCTLDUMP output example, would output "/obj" the corresponding directory name.

Example:

$ mupip rctldump .
Object Directory         : /tmp
Relinkctl filename       : /tmp/fis-gtm/V6.2-001_x86_64/gtm-relinkctl-61f9eb418212a24a75327f53106c1656
# of routines            : 1
# of attached processes  : 2
Relinkctl shared memory  : shmid: 11534344 shmlen: 0x57c6000
Rtnobj shared memory # 1 : shmid: 11567113 shmlen: 0x100000 shmused: 0x200 shmfree: 0xffe00 objlen: 0x1c0
 rec#1: rtnname: abcd cycle: 1 objhash: 0xedbfac8c7f7ca357 numvers: 1 objlen: 0x1c0 shmlen: 0x200 superseded: 1

REORG

Improves database performance by defragmenting and reorganizing database files and attempts to reduce the size of the database file. MUPIP REORG runs concurrently with other database activity, including updates. Competing activity generally increases the time required to perform a REORG, as well as that of the competing operations.

MUPIP REORG can also encrypt a database and/or change the encryption keys for database files "on the fly" while the database is in use.

The format of the MUPIP REORG command is:

REO[RG] 
[
 -D[OWNGRADE]
 -ENCR[YPT]=key
 -E[XCLUDE]=global-name-list
 -FILE=file-name
 -FILL[_FACTOR]=integer
 -I[NDEX_FILL_FACTOR]=integer
 -K[EEP]={pct% | blocks}
 -MIN[_LEVEL]=integer
 -NOCO[ALESCE]
 -NOSP[LIT]
 -NOSW[AP]
 -R[ESUME]
 -S[ELECT]=global-name-list
 -T[RUNCATE][=percentage]
 -UP[GRADE]
 -REG[ION] region-list
]
[Note] Note

While REORG optimizes the GDS structure of database files, it does not handle native file system file fragmentation. In most cases, fragmentation at the native file system level is more likely than fragmentation at the GDS structure level. Therefore, FIS recommends users create files with appropriate allocations and extensions, on disks with large amounts of contiguous free space. Use native utilities and MUPIP utilities (depending on operational procedures) to eliminate file fragmentation when database files have been extended more than a dozen times.

  • As REORG is IO intensive, running a REORG concurrently with normal database access may impact the operation of normal processes. As the GT.M database engine has a daemonless architecture, attempts to reduce the impact by reducing the priority of REORG can (perhaps counter-intuitively) exacerbate rather than alleviate the impact. To reduce the impact REORG has on other processes, use the gtm_poollimit environment variable to limit the number of global buffers used by the REORG.

  • MUPIP REORG does not change the logical contents of the database, and can run on either the originating instance or replicating instance of an LMS application. In such cases, resuming REORGs in process should be part of the batch restart. See "GT.M Database Replication" chapter for more information about running REORG on a dual site application.

  • Use MUPIP STOP (or <Ctrl-C> for an interactive REORG) to terminate a REORG process. Unless terminated with a kill -9, a REORG terminated by operator action or error is incomplete but does not adversely affect the database.

[Caution] Caution

REORG focuses on optimum adjacency and a change to even a single block can cause it to perform a large number of updates with only marginal benefit. Therefore, FIS recommends not running successive REORGs close together in time as that can provide minimal benefit for a significant increase in database and journal activity. For the same reason, FIS recommends careful research and planning before using the -RESUME qualifier or complex uses of -EXCLUDE and -SELECT.

Assume two scenarios of putting values of ^x(1) to ^x(10000). In the first scenarios, fill values in a sequential manner. In the second scenario, enter values for odd subscripts and then enter values for the even subscripts.

Scenario 1:

At the GT.M prompt, execute the following command sequence:

GTM>for i=1:1:10000 set ^x(i)=$justify(i,200)

Then, execute the following MUPIP INTEG command.

$ mupip integ -region "*"

This command produces an output like the following:

Integ of region DEFAULT
No errors detected by integ.
Type           Blocks         Records          % Used      Adjacent
Directory           2               2           2.490            NA
Index              29            2528          95.999             1
Data             2500           10000          82.811          2499
Free               69              NA              NA            NA
Total            2600           12530              NA          2500

Note the high density (percent used) for index and data blocks from the report.

Scenario 2:

At the GT.M prompt, execute the following command sequence:

GTM>for i=1:2:10000 s ^x(i)=$justify(i,200)
GTM>for i=2:2:10000 set ^x(i)=$justify(i,200)

Then, execute the following command:

$ mupip integ -region "*"

This command produces an output like the following:

Integ of region DEFAULT
No errors detected by integ.
Type           Blocks         Records          % Used      Adjacent
Directory           2               2           2.490            NA
Index             153            3902          29.211            57
Data             3750           10000          55.856          1250
Free               95              NA              NA            NA
Total            4000           13904              NA          1307

Note that there are more and less dense index and data blocks used than in scenario 1. MUPIP REORG addresses such issues and makes the database (depending on the FILL_FACTOR) more compact.

The optional qualifiers for MUPIP REORG are:

-Downgrade

Downgrades blocks to a prior major version DB format. Use REORG -DOWNGRADE only when you have determined there is a clear reason to downgrade the DB format of a database to a prior format and there are no conditions that preclude that possibility.

[Note] Note:

V7.0-000 and up do not support REORG -DOWNGRADE.

-Encrypt

Encrypts an unencrypted database or changes the encryption key of a database while the database continues to be used by applications. Whether or not the prior encryption uses non-zero initialization vectors (IVs), database blocks encrypted with the new key use non-zero IVs The format of the ENCRYPT qualifier is:

-ENCR[YPT]=<key>

MUPIP provides <key> to the encryption plugin. The reference implementation of the plugin expects a key with the specified name in the encryption configuration file identified by $gtmcrypt_config. The configuration file must contain an entry in the database section for each database file mapping to a region specified in <region-list> that names the specified key as its key. The -ENCRYPT flag is incompatible with all other command line flags of MUPIP REORG except -REGION, and performs no operation other than changing the encryption key. If the specified key is already the encryption key of a database region, MUPIP REORG -ENCRYPT moves on to the next region after displaying a message (on stderr, where MUPIP operations send their output).

As MUPIP REORG -ENCRYPT reads, re-encrypts, and writes every in-use block in each database file, its operations take a material amount of time on the databases of typical applications, and furthermore add an additional IO load to the system on which it runs. You can use the environment variable gtm_poollimit to ameliorate, but not eliminate, the impact, at the cost of extending execution times. To minimize impact on production instances, FIS recommends running this operation on replicating secondary instances, rather than on originating primary instances.

-ENCRYPT switches the journal file for each database region when it begins operating on it, and again when it completes, and also records messages in the syslog for both events.

As is the case under normal operation when MUPIP REORG -ENCRYPT is not active, journaled databases are protected against system crashes when MUPIP REORG -ENCRYPT is in operation: MUPIP JOURNAL -ROLLBACK / -RECOVER recovers journaled database regions (databases that use NOBEFORE journaling continue to require -RECOVER / -ROLLBACK -FORWARD).

Because a database file utilizes two keys while MUPIP REORG -ENCRYPT is underway, the database section of the configuration file provides for a single database file entry to specify multiple keys. For example, if the keys of database regions CUST and HIST, mapping to database files cust.dat and hist.dat in directory /var/myApp/prod, are to be changed from key1 to key2 using the command:

MUPIP REORG -ENCRYPT=key2 -REGION CUST,HIST

then the database section of the configuration file must at least have the following entries:

 database: {
     keys: ({
         dat: "/var/myApp/cust.dat";
         key: "key1";
     },{
         dat: "/var/myApp/cust.dat";
         key: "key2";
     },{
         dat: "/var/myApp/hist.dat";
         key: "key1";
     },{
         dat: "/var/myApp/hist.dat";
         key: "key2";
     })
 };

In other words, each database file entry can have multiple keys, and a key can be associated with multiple database files. With a configuration file that has multiple keys associated with the same database file, MUPIP CREATE uses the last entry. Other database operations use whichever key associated with the database file has a hash matching one in the database file header, reporting an error if no key matches. To improve efficiency when opening databases, you can delete entries for keys that are no longer used from the configuration file.

MUPIP REORG -ENCR[YPT] can encrypt an unencrypted database only if the following command:

    MUPIP SET -ENCRYPTABLE -REGION <region-list>

has previously marked the database "encryptable".

The command requires standalone access to the database. It performs some basic encryption setup checks and requires the gtm_passwd environment variable to be defined and the GNUPGHOME environment variable to point to a valid directory in the environment. Just as encrypted databases use global buffers in pairs (for encrypted and unencrypted versions of blocks), a database marked as encryptable has global buffers allocated in pairs (that is, the actual number of global buffers is twice the number reported by DSE DUMP -FILEHEADER) and requires correspondingly larger shared memory segments. To revert unencrypted but encryptable databases back to "unencryptable" state, use the command:

MUPIP SET -NOENCRYPTABLE -REGION <region-list>

The above command only requires standalone access, and the result depends on the state of the database. It:

  • is a no-op if the database is encrypted;

  • is disallowed if the database is partially (re)encrypted; and

  • prohibits encryption if the database is not encrypted.

Under normal operation, a database file has only one key. Upon starting a MUPIP REORG -ENCRYPT to change the key, there are two keys, both of whose hashes GT.M stores in the database file header. With a MUPIP REORG -ENCRYPT operation underway to change the key, normal database operations can continue, except for another MUPIP REORG -ENCRYPT or MUPIP EXTRACT in binary format. Other MUPIP operations, such as MUPIP BACKUP and MUPIP EXTRACT in ZWR format can occur. A MUPIP REORG -ENCRYPT operation can resume after an interruption, either unintentional, such as after a system crash and recovery, or intentional, that is, an explicit MUPIP STOP of the MUPIP REORG -ENCRYPT process. To resume the REORG operation, reissue the original command, including the key parameter. (Note that supplying a key other than the one used in the original command produces an error.)

After the MUPIP REORG -ENCRYPT process completes, subsequent MUPIP REORG -ENCRYPT operations on the same region(s) are disallowed until the following command is run:

MUPIP SET -ENCRYPTIONCOMPLETE -REGION <region-list>

Blocking subsequent MUPIP REORG -ENCRYPT operations after one completes provides time for a backup of the entire database before enabling further key changes. MUPIP SET -ENCRYPTIONCOMPLETE reports an error for any database region for which MUPIP REORG -ENCRYPT has not completed.

[Note] Note
  • FIS recommends rotating (changing) the encryption key of the database for better security. The frequency of encryption key rotation depends on your security requirements and policies.

  • MUPIP REORG -ENCRYPT does not enable switching between encryption algorithms. To migrate databases from Blowfish CFB to AES CFB requires that the data be extracted and loaded into newly created database files. To minimize the time your application is unavailable, you can deploy your application in a Logical Multi-Site (LMS) configuration, and migrate using a rolling upgrade technique. Refer to the Chapter 7: “Database Replication for more complete documentation.

-Exclude

Specifies that REORG not handle blocks that contain information about the globals in the associated list–this means they are neither reorganized nor swapped in the course of reorganizing other globals; -EXCLUDE can reduce the efficiency of REORG because it complicates and interferes with the block swapping actions that try to improve adjacency.

The format of the EXCLUDE qualifier is:

-E[XCLUDE]=global-name-list
  • Assume that a single MUPIP command organizes a subset of the globals in a database or region. If a second MUPIP REORG command selects the remaining globals, it may tend to disrupt the results of the first REORG by de-optimizing the previously organized blocks. This is because there is no information passed from the previous MUPIP REORG command to the next command. The EXCLUDE qualifier allows users to list the name of the previously REORGed globals, so that the MUPIP REORG bypasses the GDS blocks containing these globals.

  • If global-name-list contains globals that do not exist, REORG issues a message to the terminal and continues to process any specified globals that exist. If REORG is unable to process any globals, it terminates with an error.

  • Global-name-list can be an individual global name, a range of global names, or a list of names and prefixes followed by the wildcard symbol. For example:

    1. A global name, such as ACN.

    2. A range of global names, such as A7:B7.

    3. A list, such as A,B,C.

    4. Global names with the same prefix such as TMP*.

In the first case, REORG only excludes global ^ACN. In the second case, REORG excludes all global names in the collating sequence A7 to B7. For the third case, REORG excludes A, B, and C. In the last case, REORG excludes all globals prefixed with TMP.

  • Enclose wildcards in double-quotes ("") to prevent inappropriate expansion by the shell. The caret symbol (^) in the specification of the global is optional.

  • By default, REORG does not EXCLUDE any globals.

  • In case any global appears in the argument lists of both -SELECT and -EXCLUDE, REORG terminates with an error.

-FILE

Specifies which database to upgrade. The format of the FILE qualifier is:

FILE=file-name
  • The arguments for the FILE must be a fully qualified path to a database file.

-FILL_factor

Specifies how full you want each database block to be. This is a target number. Individual blocks may be more or less full than the fill factor. The format of the FILL_FACTOR qualifier is:

FILL[_FACTOR]=integer
  • The arguments for the FILL_FACTOR qualifier must be integers from 30 to 100. These integers represent the percentage of the data block that REORG can fill. By default, the FILL_FACTOR value is 100 for maximum data density.

  • Users who come upon database performance issues or a high rate of database updates must examine the defined FILL_FACTORs. Unless the application uses entirely uniform records, which is not typical for most applications, FILL_FACTORs do not work precisely.

  • The FILL_FACTOR for data that is relatively static, or grows by the addition of new nodes that collate before or after pre-existing nodes, should be 100 percent. The FILL_FACTOR for data that is growing by additions to existing nodes may be chosen to leave room in the typical node for the forecast growth for some period. Generally, this is the time between the LOAD and first REORG, or between two REORGs. This is also true for additions of nodes that are internal to the existing collating sequence.

-Index_fill_factor

Directs REORG to leave free space within index blocks for future updates. Arguments to this qualifier must be integers from 30 to 100 that represent the percentage of the index block that REORG can fill. REORG uses this number to decide whether to place more information in an index block, or create space by moving data to another block. The format of the INDEX_FILL_FACTOR qualifier is:

-I[NDEX_FILL_FACTOR]=integer

Under certain conditions, especially with large database block sizes, it may be possible to achieve faster throughput by using a smaller fill factor for index blocks than for data blocks. By default, the INDEX_FILL_FACTOR is the value of FILL_FACTOR regardless of whether that value is explicitly specified or implicitly obtained by default.

-Min_level

Directs REORG to only process blocks with a level greater than or equal to what is specified. -Min_level=1, for example, instructs REORG to only process index blocks. The format of the MIN_LEVEL qualifier is:

-M[IN_LEVEL]=integer

When the user intends to target only a subset of the blocks in a database for splitting, coalescing, and swapping, this setting can significantly reduce the overhead of doing so. -Min_level=1 can be understood as the REORG equivalent of an INTEG -FAST.

-Keep

For a MUPIP REORG -TRUNCATE, -KEEP allows the user to specify, as a decimal integer number of blocks or a percentage from 0% to 99% of the starting total blocks, the total amount of space the truncate operation should leave (not truncate) in the database file at the completion of other REORG operations. The format of the KEEP qualifier is:

-KEEP={pct%|blocks}
  • Where pct is a decimal integer percentage followed by a percent-sign (%) and alternatively blocks is a decimal integer number of blocks. If REORG cannot meet the keep value, it produces an informational message indicating that it did not perform any truncation, and how many free blocks it left.

-NOCOalesce

-NOCOALESCE specifies to MUPIP REORG to skip actions that increase block density. The format of the NOCOALESCE qualifier is:

-NOCO[alesce]
  • By default, MUPIP REORG attempts to rearrange blocks which are below the specified fill-factor to pack data more densely. More tightly packed data can decrease block I/O and reduce the storage requirements.

-NOSPlit

-NOSPLIT specifies to MUPIP REORG to skip actions that decrease block density. The format of the NOSPLIT qualifier is:

-NOSP[lit]
  • By default, MUPIP REORG attempts to rearrange blocks which are above the specified fill-factor to pack data less densely. Having empty space in blocks can reduce the need for block splits going forward, which may improve performance.

-NOSWap

-NOSWAP specifies to MUPIP REORG to skip actions that increase block adjacency. The format of the NOSWAP qualifier is:

-NOSW[ap]
  • By default, MUPIP REORG attempts to rearrange blocks so logically related blocks have adjacent block numbers. On rotating storage, this tends to improve performance; on solid state storage the results are device specific and may increase device wear. Swap activities tend to generate a lot of journal file volume.

-Resume

For an interrupted REORG operation, -RESUME allows the user to resume the REORG operation from the point where the operation stopped. REORG stores the last key value in the database file header. The format of the RESUME qualifier is:

-R[ESUME]
  • With RESUME specified, the program retrieves the last key value, from the database file header, and restarts operations from that key.

-Region

Specifies that REORG operate in the regions in the associated list and restricts REORG to the globals in those regions that are mapped by the current global directory; it does not have the same interactions as -EXCLUDE and -SELECT, but it does not mitigate those interactions when combined with them.

The format of the REGION qualifier is:

-R[EGION] region-list

region-list may specify more than one region of the current global directory in a list. Regions are case-insensitive, separated by a comma, and wildcards can be used to specify them. Any region-name may include the wildcard characters * and % (remember to escape them to protect them from inappropriate expansion by the shell). Any region name expansion occurs in M (ASCII) collation order.

-Select

Specifies that REORG reorganizes only the globals in the associated list; globals not on the list may be modified by block swaps with selected globals unless they are named with -EXCLUDE; -SELECT can be difficult to use efficiently because it tends to deoptimize unselected globals unless they are name in an -EXCLUDE list (which introduces inefficiency).

The format of the SELECT qualifier is:

-S[ELECT]=global-name-list
  • By default, REORG operates on all globals in all database files identified by the current Global Directory for the process executing the MUPIP command.

  • One of the functions performed by REORG is to logically order the globals on which it operates within the file. Unless the EXCLUDE and SELECT qualifiers are properly used in tandem, repeating the command with different selections in the same file wastes work and leaves only the last selection well organized.

  • If you enter the REORG -SELECT=global-name-list command and the specified globals do not exist, REORG issues a message to the screen and continues to process any specified globals that exist. If REORG is unable to process any globals, it terminates with an error.

  • Arguments for this qualifier may be an individual global name, a range of global names, or a list of names and prefixes followed by the wildcard symbol. The caret symbol (^) in the specification of the global is optional.

  • The global name can be:

    1. A global name, such as ACN

    2. A range of global names, such as A7:B7

    3. A list, such as A,B,C.

    4. Global names with the same prefix such as TMP*.

  • In the first case, REORG only includes global ^ACN. In the second case, REORG includes all global names in the collating sequence A7 to B7. For the third case, REORG includes A, B, and C. In the last case, REORG includes all globals prefixed with TMP.

  • By default, REORG selects all globals.

-Truncate

Specifies that REORG, after it has rearranged some or all of a region's contents, should attempt to reduce the size of the database file and return free space to the file system. TRUNCATE only applies to BG databases. The format of the TRUNCATE qualifier is:

-T[RUNCATE][=percentage]

The optional percentage (0-99) provides a minimum amount for the reclamation; in other words, REORG won't bother performing a file truncate unless it can give back at least this percentage of the file; the default (0) has it give back anything it can. TRUNCATE always returns space aligned with bit map boundaries, which fall at 512 database block intervals. TRUNCATE analyses the bit maps, and if appropriate, produces before image journal records as needed for recycled (formerly used) blocks; The journal extract of a truncated database file may contain INCTN records having the inctn opcode value 9 indicating that the specific block was marked from recycled to free by truncate.

[Note] Note

TRUNCATE does not complete if there is a concurrent online BACKUP or use of the snapshot mechanism, for example by INTEG.

[Note] Warning

Because any competing updates may interfere with MUPIP's ability to free space, minimize or prevent competing updates.

-UPgrade

Upgrades blocks to current DB version format. A REORG with the -UPGRADE option cannot run concurrently on a file or region with any other REORG on the same file or region. Use REORG -UPGRADE when it is a part of a release notes procedure to upgrade the DB version format of a database or when you encounter a database integrity error that requires running REORG -UPGRADE.

Examples for MUPIP REORG

Example:

$ mupip reorg 
Fill Factor:: Index blocks 100%: Data blocks 100%
   
Global: CUST (region DEFAULT)
Blocks processed    : 667340 
Blocks coalesced    : 601487 
Blocks split        : 0 
Blocks swapped      : 319211 
Blocks freed        : 646964 
Blocks reused       : 298814 
Blocks extended     : 0 
   
Global: HIST (region HIST)
%GTM-I-FILERENAME, File /var/myApp/prod/journals/hist.mjl is renamed to /var/myApp/prod/journals/hist.mjl_2015289165050
Blocks processed    : 337069 
Blocks coalesced    : 12888 
Blocks split        : 0 
Blocks swapped      : 329410 
Blocks freed        : 315998 
Blocks reused       : 308337
Levels Eliminated   : 1 
Blocks extended     : 0 
$

In this output:

  • Blocks processed - the number of blocks originally used by the global variable

  • Blocks coalesced - the number of blocks that were sufficiently compacted enough to free a block

  • Blocks split - the number of blocks expanded enough to require the allocation of a new block

  • Blocks swapped - the number of blocks moved to improve adjacency; this can exceed the number of blocks processed as a consequence of the movement of blocks

  • Blocks freed - the number of blocks formerly used that were released by a combination of swaps and coalesces

  • Blocks reused - blocks freed, and then reused

  • Levels eliminated - reduction in the depth of the global variable tree

  • Blocks extended - the number of blocks the database grew during the reorg

Note also that owing the database update activity of REORG, the hist.mjl journal file reached its limit, requiring MUPIP to switch the journal file.

Example:

$ mupip reorg -exclude="^b2a,^A4gsEQ2e:^A93"

This example performs a MUPIP REORG operation on all globals excluding ^b2a and all globals ranging from ^A4gsEQ2e to ^A93.

Example:

If the forecasted growth of a global is 5% per month from relatively uniformly distributed updates, and REORGs are scheduled every quarter, the FILL_FACTOR for both the original LOAD and subsequent REORGs might be 80 percent 100 - ((3 months + 1 month "safety" margin) * five percent per month). The REORG command based on the above assumptions is as follows:

$ mupip reorg -fill_factor=80 

Example:

The following example uses recorg -encrypt to encrypt a database "on the fly". This is a simple example created for demonstration purposes. It is NOT recommended for production use. Consult your GT.M support channel for specific instructions on encrypting an unencrypted database.

Create an empty default unencrypted database.

$gtm_dist/mumps -r ^GDE exit
  $gtm_dist/mupip create

Setup the GNUPG home directory.

export GNUPGHOME=$PWD/.helengnupg3    
mkdir $GNUPGHOME # Ensure that you protect this directory with appropriate permissions.  
chmod go-rwx $GNUPGHOME

Create a new key. Enter demo values. This example uses demo values from the database encryption example in the GT.M Acculturation Workshop document. Accept default values. Choose a strong passphrase.

gpg --gen-key  

Edit the key to add a new sub-key:

gpg --edit-key helen.keymaster@gt.m  

Type addkey, select option 6 RSA (encrypt only), and accept default values and execute the following commands:

gpg --gen-random 2 32 | gpg --encrypt --default-recipient-self --sign --armor > gtm_workshop_key.txt
gpg --decrypt < ./gtm_workshop_key.txt | gpg --encrypt --armor --default-recipient-self --output gtm.key

Refer to the 'man gpg; a description on the qualifiers for gpg.

Create a gtmcrypt_config file as following:

$ cat config
database: {
    keys:   (
              {
              dat: "/path/to/mumps.dat" ;
              key: "/path/to/gtm.key" ;
              }
            );
  }

Set the environment variable gtmcrypt_config to point to this config file.

export gtmcrypt_config=$PWD/config 

Set the enviroment varible gtm_passwd.

echo -n "Enter passphrase for gtm.key: " ; export gtm_passwd=`$gtm_dist/plugin/gtmcrypt/maskpass|cut -f 3 -d " "`

Execute the following commands:

$ mupip set -encryptable -region DEFAULT
$ mupip reorg -encrypt="gtm.key" -region DEFAULT
mupip reorg -encrypt="gtm.key" -region DEFAULT
Region DEFAULT : MUPIP REORG ENCRYPT started
Region DEFAULT : Database is now FULLY ENCRYPTED with the following key: gtm.key
Region DEFAULT : MUPIP REORG ENCRYPT finished

Execute the following command when encryption completes.

$ mupip set -encryptioncomplete -region DEFAULT
Database file /home/gtc_twinata/staff/nitin/tr11/mumps.dat now has encryption marked complete

Always keep the keys in a secured location. Always set gtmcrypt_config and gtm_passwd to access the encrypted database.

REPLICATE

Control the logical multi-site operation of GT.M. For more information on the qualifiers of the MUPIP REPLICATE command, refer to Chapter 7: “Database Replication .

RESTORE

Incrementally restores the output of the BACKUP -BYTESTREAM to a database file at the backup location.

The format of the RESTORE command is:

RES[TORE] [-NET[TIMEOUT]] [-[NO]E[XTEND]] dbfile bytestream-bkup-list|<TCP_socket_address>
  • dbfile identifies the name of the database file that RESTORE uses as a starting point.

  • When BACKUP -BYTESTREAM directs the output to disks or pipes, bytestream-bkup-list specifies a comma (,) seperated list of one or more bytestream files to RESTORE into the database file specified with file-name. The list and must be in sequential order, from the oldest transaction number to the most recent transaction number. bytestream-bkup-listmay also include a list of pipe commands.

    <TCP_socket_address> specifies a combination of IPv4 or IPV6 hostname and a port number (for example, tcp://hostname1:portno) for which RESTORE sets up a listening process to restore the bytestream data from an active BACKUP -BYTESTREAM process to the database file. In both these cases:

    • The transaction number in the first incremental backup must be one more than the current transaction number of the database. Otherwise, the integrity checking mechanism of MUPIP RESTORE produces an error.

    • You can incrementally restore BACKUP -BYTESTREAM data from either a TCP stream or multiple bytestream files to only one database file with one MUPIP RESTORE command.

  • If the BACKUP -BYTESTREAM was created using -TRANSACTION=1, create a new database with MUPIP CREATE and do not access it, except the standalone MUPIP commands INTEG -FILE, EXTEND, and SET before initiating the RESTORE.

  • For more information on the -NETTIMEOUT qualifier, refer to “-NETtimeout” in the MUPIP BACKUP section of this chapter.

-Extend

Specifies whether a MUPIP RESTORE operation should extend the database file automatically if it is smaller than the size required to load the data.

The format of the EXTEND qualifier is:

-[NO]E[XTEND]

M activity between backups may automatically extend a database file. Therefore, the database file specified as the starting point for a RESTORE may require an extension before the RESTORE. If the database needs an extension and the command specifies -NOEXTEND, MUPIP displays a message and terminates. The message provides the sizes of the input and output database files and the number of blocks by which to extend the database. If the RESTORE specifies more than one incremental backup with a file list, the database file may require more than one extension.

By default, RESTORE automatically extends the database file.

Examples for MUPIP RESTORE

$ mupip restore backup.dat $backup_dir/backup.bk1, $backup_dir/backup.bk2, $backup_dir/backup.bk3

This command restores backup.dat from incremental backups stored in directory specified by the environment variable backup_dir.

$ mupip restore gtm.dat '"gzip -d -c online5pipe.inc.gz |"'

This command uses a pipe to restore gtm.dat since its last DATABASE backup from the bytestream backup stored in online5pipe.inc.gz.

$ mupip backup -bytestream region1,region2 tcp://hostname1:port1,tcp://hostname1:port2 -nettimeout=420

This command starts a MUPIP process waiting for a listening MUPIP RESTORE processes to send bytestream data of region1 and region2.

$ mupip restore region1.dat tcp://hostname1:port1 -nettimeout=420

This command start a TCP listening process to receive the bytstream data from region1 of the previous MUPIP BACKUP -BYTSTREAM command.

$ mupip restore region2.dat tcp://hostname1:port2 -nettimeout=420

This command start a TCP listening process to receive the bytstream data from region2 of the previous MUPIP BACKUP -BYTSTREAM command. Note that you cannot start RESTORE for region2 before the backup of region1 completes.

RUNDOWN

When database access has not been properly terminated, RUNDOWN properly closes currently inactive databases, removes abandoned GT.M database semaphores, and releases any IPC resources used. Under normal operations, the last process to close a database file performs the RUNDOWN actions, and a MUPIP RUNDOWN is not required. If a database file is already properly rundown, a MUPIP RUNDOWN has no effect. If in doubt, it is always to safe to perform a rundown. FIS recommends the following method to shutdown a GT.M application or the system:

  • Terminate all GT.M processes, and

  • Rundown any and all database files that may be active.

MUPIP RUNDOWN checks for version mismatch. If there is a mismatch, it skips the region and continues with the next region. This makes it easier for multiple (non-interacting) GT.M versions to co-exist on the same machine. Note that GT.M does not support concurrent access to the same database file by multiple versions of the software.

The format of the MUPIP RUNDOWN command is:

RU[NDOWN] {-FILE file-name|-REGION region-list|-RELINKCTL [dir]|-OVERRIDE}

MUPIP RUNDOWN clears certain fields in a file that is already closed. This facilitates recovery from a system crash or other operational anomaly.

Use RUNDOWN after a system crash or after the last process accessing a database terminates abnormally. RUNDOWN ensures that open databases are properly closed and ready for subsequent use. RUNDOWN has no effect on any database that is actively being accessed at the time the RUNDOWN is issued.

A successful MUPIP RUNDOWN of a database region removes any current MUPIP FREEZE.

RUNDOWN -FILE can be directed to a statistics database file and works even if the corresponding actual database file does not exist.

To ensure database integrity, all system shutdown algorithms should include scripts that stop at GT.M processes and perform RUNDOWN on all database files.

The RUNDOWN command may include one of the following qualifiers:

-F[ile] 
-R[egion]=region-list
-RELinkctl [dir1] 
-Override

If the RUNDOWN command does not specify either -File or -Region, it checks all the IPC resources (shared memory) on the system and if they are associated with a GT.M database, attempts to rundown that file. MUPIP RUNDOWN with no argument removes any statistics database file resources associated with actual database file resources it can remove.

-File

Specifies that the argument is a file-name for a single database file. The -FILE qualifier is incompatible with the REGION qualifier. If the rundown parameter consists of a list of files, the command only operates on the first item in the list.

Incompatible with: -REGION

-Override

Overrides the protection that prevents MUPIP RUNDOWN from performing a rundown of a replication-enabled (with BEFORE_IMAGE) database or a non-replicated NOBEFORE-journaled database that was abnormally shutdown. The protection involves issuing the MUUSERLBK error for a previously crashed replication-enabled (with BEFORE IMAGE journaling) database and the MUUSERECOV error for a non-replicated or NOBEFORE-journaled database. Both these errors prevent complications related to data recovery from a journal file or a replication-enabled database.

-Region

The region-list identifies the target of the RUNDOWN. region-list may specify more than one region of the current global directory in a list. Regions are case-insensitive, separated by a comma, and wildcards can be used to specify them. Any region-name may include the wildcard characters * and % (remember to escape them to protect them from inappropriate expansion by the shell). Any region name expansion occurs in M (ASCII) collation order.

Use the wildcard "*" to rundown all inactive regions in a global directory.

Incompatible with: -FILE

When MUPIP RUNDOWN has no qualifier, it performs rundown on all inactive database memory sections on the node. Because this form has no explicit list of databases, it does not perform any clean up on regions that have no abandoned memory segments but may not have been shutdown in a crash.

-Relinkctl

Cleans up orphaned Relinkctl files. FIS strongly recommends avoiding actions that tend to make such cleanup necessary - for example, kill -9 of GT.M processes or ipcrm -m of active Relinkctl and/or Rtnobj shared memory segments.

If the optional dir1 is not specified, MUPIP RUNDOWN -RELINKCTL examines the environment variable $gtmroutines, attempts to verify and correct their attach counts and runs down all its inactive auto-relink-enabled directories (those with with a *-suffix). Alternatively, one can specify a directory path for the parameter dir1 and MUPIP RUNDOWN -RELINKCTL treats it as an auto-relink-enabled directory and runs down the resources associated with this one directory. It prints a RLNKCTLRNDWNSUC message on a successful rundown and a RLNKCTLRNDWNFL message on a failure (usually because live processes are still accessing the Relinkctl file).

SEMAPHORE

Reports the details of a space delimited list of semaphores IDs.

The format of the MUPIP SEMAPHORE command is:

MUPIP SEMAPHORE <sem-ids-list> 

SET

Use MUPIP SET for performance tuning and/or modifying certain database and journal file attributes.

The format of the SET command is:

SET {-FI[LE] file-name|-JN[LFILE] journal-file-name|-REG[ION] region-list}  
 -AC[CESS_METHOD]={BG|MM}
 -[NO]AS[YNCIO]
 -DATA[_RESERVED_BYTES]=integer
 -[NO]DE[FER_TIME][=seconds]
 -[NO]DEFER_ALLOCATE 
 -[NO]ENCRYPTA[BLE]
 -ENCRYPTI[ONCOMPELTE]
 -EX[TENSION_COUNT]=integer(no of blocks)
 -F[LUSH_TIME]=integer
 -FU[LLBLKWRT]={0|1|2}
 -G[LOBAL_BUFFERS]=integer
 -H[ARD_SPIN_COUNT]=integer
 -INDEX[_RESERVED_BYTES]=integer
 -[NO]INST[_FREEZE_ON_ERROR]
 -JN[LFILE] journal-file-name journal-file-quals
 -K[EY_SIZE]=bytes
 -[NO]LCK_SHARES_DB_CRIT
 -L[OCK_SPACE]=integer
 -M[UTEX_SLOTS]=integer
 -N[ULL_SUBSCRIPTS]=value
 -[NO]Q[DBRUNDOWN]
 -[NO]REA[D_ONLY]
 -REC[ORD_SIZE]=bytes
 -REG[ION] region-list
 -REP[LICATION]={ON|OFF}
 -RES[ERVED_BYTES]=integer
 -SL[EEP_SPIN_COUNT]=integer
 -SPIN_SLEEP_M[ASK]=hex_mask
 -[NO]STAT[S]
 -STATSD[B_ALLOCATION]=integer(no of blocks)
 -[NO]STD[NULLCOLL]
 -T[RIGGER_FLUSH]=integer
 -W[AIT_DISK]=integer
 -WR[ITES_PER_FLUSH=integer
  • The file-name, journal_file_name, region-list or -REPLICATION qualifier identify the target of the SET.

  • The SET command must include one of the following target qualifiers which determine whether the argument to the SET is a file-name or a region-list.

-File

Specifies that the argument is a file-name for a single database file. The format of the FILE qualifier is:

-F[ILE]

Incompatible with: -JNLFILE, -REGION and -REPLICATION

-Jnlfile

Specifies that the argument is a journal-file-name. The format of the JNLFILE qualifier is:

-JNLF[ILE] journal-file-name

Incompatible with: -FILE, -REGION and -REPLICATION

-Region

Specifies that the argument is a region-list which identifies database file(s) mapped by the current Global Directory. The format of the REGION qualifier is:

-R[EGION] region-list

The region-list identifies the target of SET. region-list may specify more than one region of the current global directory in a list. Regions are case-insensitive, separated by a comma, and wild-cards can be used to specify them. Any region-name may include the wild-card characters * and % (remember to escape them to protect them from inappropriate expansion by the shell). Any region name expansion occurs in M (ASCII) collation order.

Incompatible with: -FILE, -JNLFILE and -REPLICATION

-REPlication

Specifies whether replication is on or off. The format of the REPLICATION qualifier is:

-REP[LICATION]={ON|OFF}

Incompatible with: -JNLFILE

The following sections describe the action qualifiers of the MUPIP SET command exclusive of the details related to journaling and replication, which are described in Chapter 6: “GT.M Journaling and Chapter 7: “Database Replication. All of these qualifiers are incompatible with the -JNLFILE and -REPLICATION qualifiers.

-ACcess_method

Specifies the access method (GT.M buffering strategy) for storing and retrieving data from the database file. The format of the ACCESS_METHOD qualifier is:

-AC[CESS_METHOD]=code

For more information on specifying the ACCESS_METHOD, refer to “Segment Qualifiers”.

-ASyncIO

Specifies whether to use asynchronous I/O for an access method BG database, rather than using synchronous I/O through the file system cache. ASYNCIO is incompatible with the MM access method and an attempt to combine the two with MUPIP SET produces a ASYNCIONOMM error. The format of the ASYNCIO qualifier is:

-[NO]AS[YNCIO]

For more information on specifying ASYNCIO,refer to “Segment Qualifiers”.

-DATA_reserved_bytes

Specifies the size for GT.M to reserve in data-level database blocks. DATA_RESERVED_BYTES can be used as a user-managed fill factor when it is appropriate to have a different level of sparseness for data and index blocks. The format of the DATA_RESERVED_BYTES qualifier is:

-DATA[_RESERVED_BYTES]=size
  • The minimum DATA_RESERVED_BYTES is 0 bytes. The maximum DATA_RESERVED_BYTES = Block Size - Max Key Size - 40 (Block/Record header overheads). The default DATA_RESERVED_BYTES is 0 bytes.

-Defer_time

Specifies, in MM access mode, the multiplying factor applied to the flush time to produce a wait after an update before ensuring a journal buffer write to disk; the default is 1. A value of 2 produces a wait of double the flush time. -NODEFER_TIME or a value of -1 turns off timed journal writing, leaving the journal, under light update conditions, to potentially get as stale as the epoch time. Note that, in MM mode without the sync_io option set, absent a VIEW("JNLFLUSH") from the application, GT.M only fsyncs the journal at the epoch. The format of the DEFER_TIME qualifier is:

-[NO]D[efer_time][=seconds]

-DEFER_Allocate

With -DEFER_ALLOCATE, GT.M instructs the file system to create the database file as a sparse file. Before using -DEFER_ALLOCATE, ensure that your underlying file system supports sparse files. By default UNIX file systems, and GT.M, use sparse (or lazy) allocation, which defers actual allocation until blocks are first written. The format of the DEFER_ALLOCATE qualifier is:

-[NO]DEFER_Allocate
  • Utilities such as du report typically show lower disk space usage for a database file with -DEFER_ALLOCATE because GT.M instructs the file system to defer disk space allocation to the time when there is an actual need. With -NODEFER_ALLOCATE, such utilities report higher disk space usage count as GT.M instructs the file system to preallocate disk space without waiting for a need to arise.

  • -DEFER_ALLOCATE makes database file extensions lighter weight. However, disk activity may tend towards causing fragmentation.

  • To switch an existing database file so it immediately preallocates all blocks, first use MUPIP SET -NODEFER_ALLOCATE to set the switch in the database file header, followed by MUPIP EXTEND -BLOCKS=n, where n >= 0. Failures to preallocate space produce a PREALLOCATEFAIL error.

  • The default is DEFER_ALLOCATE.

-Epochtaper

Tries to minimize epoch duration by reducing the number of buffers to flush by GT.M and the file system (via an fsync()) as the epoch (time-based or due to journal file auto-switch) approaches. Epoch tapering reduces the impact of I/O activity during an epoch event. Application that experience high load and/or need to reduce latency may benefit from epoch tapering. The format of the -EPOCHTAPER qualifier is:

-[NO]EPOCHTAPER

-ENCRYPTAble

Performs some basic encryption checks and marks the database as encryptable. Note that marking a database as encryptable does not encrypt the database.For more information on encrypting a database, refer to “-Encrypt”. The format of the ENCRYPTABLE qualifier is:

-[NO]ENCRYPTA[BLE]

-ENCRYPTIoncomplete

Checks whether a prior MUPIP REORG -ENCRYPT completed successfully and marks encryption as complete. For usage scenarios of MUPIP SET -ENCRYPTIONCOMPLETE, refer to “-Encrypt”. The format of the ENCRYPTIONCOMPLETE qualifier is:

-ENCRYPTI[ONCOMPELTE]

-EXtension_count

Specifies the number of GDS blocks by which an existing database file extends. A file or region name is required. This qualifier requires standalone access. The format of the EXTENSION_COUNT qualifier is:

-EX[TENSION_COUNT]=integer 

For more information on specifying the EXTENSION_COUNT, refer to “Segment Qualifiers”.

-Flush_time

Specifies the amount of time between deferred writes of stale cache buffers. The default value is 1 second and the maximum value is 1 hour. -FLUSH_TIME requires standalone access. The format of the FLUSH_TIME qualifier is:

-F[LUSH_TIME]=[[[HOURS:]MINUTES:]SECONDS:]CENTISECONDS

-FUllblkwrt

Determines whether GT.M writes only valid database blocks contents, or a full block including meaningless trailing content. Full block writes are more efficient with some secondary storage because they avoid read-before-write. The format of the FULLBLKWRT qualifier is:

-FU[LLBLKWRT]={0|1|2}
  • When -FULLBLKWRT=2, a process writes all newly allocated database blocks in their entirety regardless of their actual valid contents. This relieves some file systems from tracking as much unallocated space and thus reduces file system metadata maintenance.

  • When -FULLBLKWRT=1, a process writes entire file system blocks in their entirety regardless of their actual valid contents, on some file systems, this avoids reading in advance of most writes and thus reduces file system load and increases response time.

  • When -FULLBLKWRT=0 (the default), a process writes only valid data. FIS advises using the same value of -FULLBLKWRT for all processes.

Note that when the file system block size and the database block size are the same there is no difference between the settings of 1 and 2.

-Global_buffers

Specifies the number of cache buffers for a BG database. This qualifier requires standalone access.The format of the GLOBAL_BUFFERS qualifier is:

-G[LOBAL_BUFFERS]=integer

For more information on ways to determine good working sizes for GLOBAL_BUFFERS, refer to “Segment Qualifiers”.

In general, increasing the number of global buffers improves performance by smoothing the peaks of I/O load on the system. However, increasing the number of global buffers also increases the memory requirements of the system, and a larger number of global buffers on memory constrained systems can increase the probability of the buffers getting swapped out. If global buffers are swapped out, any performance gain from increasing the number of global buffers will be more than offset by the performance impact of swapping global buffers. Most applications use from 1,000 to 4,000 global buffers for database regions that are heavily used. FIS does not recommend using fewer than 256 buffers except under special circumstances.

The minimum is 64 buffers and the maximum is 2,097,151 buffers, but may vary depending on your platform. By default, MUPIP CREATE establishes GLOBAL_BUFFERS using information entered in the Global Directory.

On many UNIX systems, default kernel parameters may be inadequate for GT.M global buffers, and may need to be adjusted by a system administrator.

-Hard_spin_count

Specifies the maximum amount of time for processes to sleep while waiting to obtain critical sections for shared resources, principally those involving databases. The format of the -SPIN_SLEEP_MASK qualifier is:

-HARD_SPIN_COUNT=integer

The mutex hard spin count specifies the number of attempts to grab the mutex lock before initiating a less CPU-intensive wait period. The format of -HARD_SPIN_COUNT is:

  • The default value is 128

  • Except on the advice of your GT.M support channel, FIS recommends leaving the default values unchanged in production environments, until and unless, you have data from testing and benchmarking that demonstrates a benefit from a change.

-INDEX_reserved_bytes

Specifies the size for GT.M to reserve in index-level database blocks. INDEX_RESERVED_BYTES can be used as a user-managed fill factor when it is appropriate to have a different level of sparseness for data and index blocks. The format of the INDEX_RESERVED_BYTES qualifier is:

-INDEX[_RESERVED_BYTES]=size
  • The minimum INDEX_RESERVED_BYTES is 0 bytes. The maximum INDEX_RESERVED_BYTES = Block Size - Max Key Size - 40 (Block/Record header overheads). The default INDEX_RESERVED_BYTES is 0 bytes.

-INST_freeze_on_error

Enables or disables custom errors in a region to automatically cause an Instance Freeze.

[Note] Note

GT.M creates a STATSDB region with INST_FREEZE_ON_ERROR disabled, preventing errors associated with such a region from causing an instance freeze even when INST_FREEZE_ON_ERROR for the base region is enabled.

This flag modifies the "Inst Freeze on Error" file header flag. The format of the INST_FREEZE_ON_ERROR qualifier is:

-[NO]INST[_FREEZE_ON_ERROR]

For more information on creating a list of custom errors that automatically cause an Instance Freeze, refer to “Instance Freeze”.

For more information on promptly setting or clearing an Instance Freeze on an instance irrespective of whether any region is enabled for Instance, refer to the Starting the Source Server” section of the Database Replication chapter.

-Journal

Specifies whether the database allows journaling and, if it does, characteristics for the journal file.:

[Note] Note

In regions that have journaling enabled and on, users can switch journal files without either requiring standalone access or freezing updates.

The format of the JOURNAL qualifier is:

-[NO]J[OURNAL][=journal-option-list]
  • -NOJOURNAL specifies that the database does not allow journaling. And also it does not accept an argument assignment.

  • -JOURNAL specifies journaling is allowed. It takes one or more arguments in a journal-option-list.

For detailed description of the all JOURNAL qualifiers and its keywords, refer to SET -JOURNAL Options ”.

-Key_size

Specifies the maximum key size in bytes for storing and retrieving data from the global database file. The maximum supported size is 1019 bytes. The format of the KEY_SIZE qualifier is:

-K[EY_SIZE=bytes

For more information on KEY_SIZE, refer to “Region Qualifiers”.

-Lck_shares_db_crit

Specifies whether LOCK actions share the same resource and management as the database or use a separate resource and management. The format of the LCK_SHARES_DB_CRIT qualifier is:

 -[NO]LC[K_SHARES_DB_CRIT]

The default is Sep(arate)/FALSE.

For more information, refer to the -[NO]L[OCK_CRIT] section of GDE “Region Qualifiers”.

-Lock_space

Specifies the number of pages allocated to the management of M locks associated with the database. The size of a page is always 512 bytes. The format of the LOCK_SPACE qualifier is:

-L[OCK]_SPACE=integer
  • The maximum LOCK_SPACE is 262144 pages.

  • The minimum LOCK_SPACE is 10 pages.

  • The default LOCK_SPACE is 40 pages.

  • For more information on LOCK_SPACE, refer to “Segment Qualifiers”.

  • This qualifier requires standalone access.

-Mutex_slots

Sets the size of a structure that GT.M uses to manage contention for the principal critical section for a database on AIX. Performance issues may occur when there are many processes contending for database access and if this structure cannot accommodate all waiting processes. Therefore, FIS recommends setting this value to a minimum of slightly more than the maximum number of concurrent processes you expect to access the database.

The minimum value is 64 and the maximum value is 32768. The default value is 1024. The format of the MUTEX_SLOTS qualifier is:

-M[UTEX_SLOTS]=integer

-Null_subscripts

Controls whether GT.M accepts null subscripts in database keys.

Usage:

-N[ULL_SUBSCRIPTS]=value
  • value can either be T[RUE], F[ALSE], ALWAYS, NEVER, or EXISTING. See GDE chapter for more information on these values of null_subscript.

  • Prohibiting null subscripts can restrict access to existing data and cause GT.M to report errors.

  • The default value is never.

-PROblksplit

Specifies the approximate number of records a block in the region must exceed before GT.M considers a proactive block split. The format of the -PROBLKSPLIT qualifier is:

-PRO[BLKSPLIT]=integer
  • Proactive consideration occurs when a mini-transaction retries updating an data block more than once due to contention.

  • GT.M never performs proactive block splitting inside a TP transaction.

  • Proactive block splits tend to make globals require more blocks and potentially deeper trees.

  • A value of one (1) indicates to always consider proactive splits, which might be useful for regions used to hold globals with a first subscript of, for example, $job.

  • A value of five (5) indicates that GT.M considers proactive block split only when the number of records in a block exceed 5.

  • The default is zero (0). It means that GT.M does not consider proactive block splitting by default.

-Qdbrundown

Shortens normal process shutdown when a large number of processes accessing a database file need to shutdown almost simultaneously, for example, in benchmarking scenarios or emergencies. The format of the QDBRUNDOWN qualifier is:

-[NO]Q[DBRUNDOWN]

When a terminating GT.M process observes that a large number of processes are attached to a database file and QDBRUNDOWN is enabled, it bypasses checking whether it is the last process accessing the database. Such a check occurs in a critical section and bypassing it also bypasses the usual RUNDOWN actions which accelerates process shutdown removing a possible impediment to process startup. By default, QDBRUNDOWN is disabled.

Note that with QDBRUNDOWN there is a possibility that the last process to exit might leave the database shared memory and IPC resources in need of cleanup. Except after the number of concurrent processes exceeds 32Ki, QDBRUNDOWN minimizes the possibility of abandoned resources, but it cannot eliminate it. When using QDBRUNDOWN, use an explicit MUPIP command such as RUNDOWN or JOURNAL -RECOVER or -ROLLBACK of the database file after the last process exits, to ensure the cleanup of database shared memory and IPC resources; not doing so risk database damage.

When a database has QDBRUNDOWN enabled, if the number of attached processes ever exceeds 32Ki, GT.M stops tracking the number of attached processes, which means that it cannot recognize when the number reaches zero (0) and the shared resources can be released. The process that detects this event issues a NOMORESEMCNT in the system log. This means an orderly, safe shutdown requires a MUPIP JOURNAL -ROLLBACK -BACKWARD for replicated databases, a MUPIP JOURNAL -RECOVER -BACKWARD for unreplicated journaled databases and a MUPIP RUNDOWN for journal-free databases.

-PArtial_recov_bypass

Sets the CORRUPT_FILE flag in the database file header to FALSE. The CORRUPT_FILE flag indicates whether a region completed a successful recovery. The format of the PARTIAL_RECOV_BYPASS qualifier is:

-PA[RTIAL_RECOV_BYPASS]

For more information, refer to the CORRUPT_FILE qualifier in CHANGE -FIleheader Qualifiers”.

-Read_only

Indicates whether GT.M should treat an MM access method segment as read only for all users, including root. This designation augments UNIX authorizations and prevents any state updates that normally might require an operational action for a database with no current accessing (attached) processes. Setting the -READ_ONLY attribute on a database file with BG access method or setting the access method to BG on a -READ_ONLY database produces an error. The GT.M help databases have -READ_ONLY set by default. The format of the READ_ONLY qualifier is:

-[NO]REA[D_ONLY]

-NOREAD_ONLY makes a database file writable for users who have write permissions on the database file. Note that because of the way GT.M handles semaphores for READ_ONLY database files it does not enforce standalone access for setting the characteristic from READ_ONLY to NOREAD_ONLY. However, making a change from READ_ONLY to NOREAD_ONLY without standalone access will likely cause problems, such as errors on termination and failure to release IPC resources that would require additional MUPIP commands to clean up. Therefore FIS recommends using other means such as the following based on fuser return of one (1) to verify there are no processes are accessing the file:

fuser <db-filename> | awk -F: '{if(length($NF))exit(1)}' && $gtm_dist/mupip set -noread_only -file <db-filename>
[Note] Note

When the first process connects to a database, it creates a access-control semaphore as part of management of the shared resource. However, when a process connects to a -READ_ONLY database, each create a private copy of the in-memory structures for the database and thus a private semaphore.

-RECord_size

Specifies the maximum record size in bytes for storing and retrieving data from the global database file. The maximum supported size is 1MiB bytes. The format of the RECORD_SIZE qualifier is:

-REC[ORD_SIZE=bytes

For more information on KEY_SIZE, refer to “Region Qualifiers”.

-REServed_bytes

Specifies the size for GT.M to reserve in both data and index database blocks. RESERVED_BYTES is generally used as a user-managed fill factor. The format of the RESERVED_BYTES qualifier is:

-RES[ERVED_BYTES]=size
  • The minimum RESERVED_BYTES is 0 bytes. The maximum RESERVED_BYTES = Block Size - Max Key Size - 40 (Block/Record header overheads). The default RESERVED_BYTES is 0 bytes.

-SLeep_spin_count

Specifies the number of times a process suspends its activity while waiting to obtain critical sections for shared resources, principally those involving databases. The format of the -SLEEP_SPIN_COUNT qualifier is:

-SLEEP_SPIN_COUNT=integer
  • integer is the number times the process yields to the OS scheduler or sleeps (depending in the SPIN_SLEEP_LIMIT) after exhausting its hard spin count and before enquing itself to be awakened by another process releasing the shared resource mutex.

  • The default is 128.

  • Except on the advice of your GT.M support channel, FIS recommends leaving the default values unchanged in production environments, until and unless, you have data from testing and benchmarking that demonstrates a benefit from a change.

-Spin_sleep_mask

Specifies the maximum amount of time for processes to sleep while waiting to obtain critical sections for shared resources, principally those involving databases. The format of the -SPIN_SLEEP_MASK qualifier is:

-SPIN_SLEEP_MASK=hex_mask
  • hex_mask is a hexadecimal mask that controls the maximum time (in nanoseconds) the process sleeps on a sleep spin.

  • The default is zero (0) which causes the process to return control to the UNIX kernel to be rescheduled with no explicit delay. When the value is non-zero, the process waits for a random value between zero (0) and the maximum value permitted by the mask.

  • Except on the advice of your GT.M support channel, FIS recommends leaving the default values unchanged in production environments, until and unless, you have data from testing and benchmarking that demonstrates a benefit from a change.

-STATS

Specifies whether GT.M should permit statistics sharing for this region. This characteristic permits operational exclusion of statistics sharing for a region. The format of the STATS qualifier is:

-[NO]STATS
  • At database creation, GDE controls this characteristic, which, by default it specifies as STATS (on). When on, this characteristic causes GT.M to create a small MM database for the associated region to hold the shared statistics.

  • If a process tries and fails to open a statsDB, it disables itself from maintaining the shared statistics. It does not, however, disable subsequently starting processes from maintaining the shared statistics.

-StatsDB_allocation

Specifies the initial number of GDS blocks for the shadow stats regions when the database region is first created. This qualifier requires standalone access and a file or region name. The format of the STATSDB_ALLOCATION qualifier is:

-STATSD[B_ALLOCATION]=integer
  • GT.M implicitly doubles this block count each time it needs to extend the associated statsdb.

  • The minimum STATSDB_ALLOCATION is 128 blocks.

  • The maximum STATSDB_ALLOCATION is 8,388,607 blocks.

  • By default, GDE provides an initial STATSDB_ALLOCATION of 2050 blocks for use by MUPIP CREATE.

-STDnullcoll

Specifies whether GT.M uses standard MUMPS collation or GT.M collation for null-subscripted keys. FIS strongly recommends that you use STDNULLCOLL and against using this non-standard null collation, which is the default for historical reasons. The format of the STDNULLCOLL qualifier is:

-[NO]STD[NULLCOLL]

-Trigger_flush

Specifies the decimal value, in buffers, for the threshold at which processes start flushing dirty buffers after each update. The format of the TRIGGER_FLUSH qualifier is:

-T[RIGGER_FLUSH]=integer

-Version

Sets the block format version (Desired DB Format field in the file header) for all subsequent new blocks. The format of the VERSION qualifier is:

[Note] Note:

V7.0-000 and up do not support the -VERSION option.

-V[ERSION]={V5|V6}
  • V6 block format is compatible with the V5 block format. The longer key and longer records (spanning nodes) features of V6 format are automatically disabled when used with GT.M V5.* versions.

  • For more information on the upgrading or downgrading your database, refer to the release notes document of your current GT.M version(s).

-WAit_disk

Specifies the seconds to wait for disk space before giving up on a database block write, where zero (0) means to give an error immediately without waiting. The format of the WAIT_DISK qualifier is:

-WA[IT_DISK]=seconds

-WRites_per_flush

Specifies the decimal number of blocks to write in each flush. The default value is 7. The format of the WRITES_PER_FLUSH qualifier is:

-WR[ITES_PER_FLUSH]=integer

Examples for MUPIP SET

Example:

$ mupip set -journal=on,nobefore -region "*"

This example enables NOBEFORE image journaling and turns on journaling for all regions.

$ mupip set -version=V5 -file mumps.dat
Database file mumps.dat now has desired DB format V5

This example disables the V6 extensions for database file mumps.dat.

Example:

mupip set -flush_time=01:00:00:00 -region DEFAULT

This example sets flush time to 1 hour. You can also specify flush time in any combination of [[[HOURS:]MINUTES:]SECONDS:]CENTISECONDS. MUPIP interprets -FLUSH_TIME=360000 or -FLUSH_TIME=00:60:00:00 as -FLUSH_TIME=01:00:00:00.

Example:

$ mupip set -region REPTILES -inst_freeze_on_error

This example enables custom errors in region REPTILES to cause an Instance Freeze.

SIZE

Estimates and reports the size of global variables using a format that is similar to the one that appears at the end of the MUPIP INTEG -FULL report. In comparison with MUPIP INTEG -FAST -FULL, MUPIP SIZE provides the option of choosing any one of the three estimation techniques to estimate the size of global variables in a database file. These techniques vary in measurement speed and estimate accuracy. The format of the MUPIP SIZE command is:

MUPIP SI[ZE] [-h[euristic]=estimation_technique] [-se[lect]=global-name-list] [-r[egion]=region-list] [-a[djacency]=integer] [-su[bscript]]=global-list

The optional qualifiers of MUPIP SIZE are:

-Heuristic=estimation_technique

Specifies the estimation technique that MUPIP SIZE should use to estimate the size of global variables. The format of the -HEURISTIC qualifier is:

-h[euristic]={sc[an][,level=<lvl>] | a[rsample][,samples=<smpls>] | i[mpsample][,samples=<smpls>]}
  • smpls is the number of samples and must be greater than zero (0)

  • lvl is a positive or negative tree level designation and -(level of the root block) <= lvl <= (level of the root block)

estimation-technique is one of the following:

  • scan,level=<lvl>

    Traverses the global variable tree and counts the actual number of records at levels from the root down to the level specified by lvl; the number of records at a level is the same as the number of blocks at the next lower level. The default is 1, which gives the count of level 0 blocks, which are the blocks containing data rather than metadata. If the given level is non-negative, it is the lowest block level of the global for which the count is requested. So, 0 means all blocks, 1 means all index blocks, 2 means all index blocks of level 2 and above, and so on. SCAN counts a negative level from the root of the global tree where -1 means children of the root.

    Specifying, a level 0 to get a record count for data increases the processing work close to an order of magnitude.

  • arsample,samples=<smpls>

    Uses acceptance/rejection sampling of random tree traversals to estimate the number of blocks at each level. It continues until the specified number of samples (default is 1,000) is accepted.

  • impsample,samples=<smpls>

    Uses importance sampling of random tree traversals to weight each sample of the specified number of samples (default is 1,000) in order to estimate size of the tree at each level.

  • If -HEURISTIC is not specified, MUPIP SIZE uses the ARSAMPLE,SAMPLE=1000 estimation technique.

The 2 sigma column for the two sampling techniques addresses the dispersion of the samples (in blocks) by giving the probability (rounded to a whole percentage) that the actual value falls farther away from the reported value by more than two sigma; in other words, larger values indicate less confidence in the accuracy of the result. With the scan method the "sample" is "complete," so any inaccuracy comes from concurrent updates.

[Important] Important

For large databases, MUPIP SIZE is faster than MUPIP INTEG -FAST -FULL. IMPSAMPLE is expected to be the fastest estimation technique, followed by ARSAMPLE and then SCAN.

In terms of accuracy, MUPIP INTEG -FAST -FULL is the most accurate.

-Adjacency=integer

Specifies the logical adjacency of data blocks that MUPIP SIZE should assume during estimation. By default, MUPIP SIZE assumes -ADJACENCY=10 and reports the logical adjacency in the "Adjacent" column of the MUPIP SIZE report. Note that adjacency is only a proxy for database organization and its usefulness may be limited by the technology and configuration of your secondary storage. See the INTEG section of this chapter for additional comments on adjacency.

-Select

Specifies the global variables on which MUPIP SIZE runs. -SELECT is incompatible with -SUBSCRIPT.If neither -SELECT or -SUBSCRIPT is specified, MUPIP SIZE selects all global variables in the specified region(s).

The format of the SELECT qualifier is:

-s[elect]=global-name-list

global-name-list can be:

  • A comma separated list of global variables. For example, -select='^g1,^g4'. This would select only globals g1 and g4.

  • A range of global variables denoted by start:end syntax. For example, -select='^g1:^g4'. This selects all globals between g1 and g4, inclusive.

  • A global variable with wildcards. For example, -select='^g*'. This selects all globals which begin with the letter g.

  • "*" to select all global variables.

-Region

Specifies the region on which MUPIP SIZE runs. If REGION is not specified, MUPIP SIZE selects all regions. The format of the REGION qualifier is:

-R[EGION]=region-list

Examples:

$ mupip size -heuristic="impsample,samples=2000" -select='^y*' -region="AREG"

This example estimates the size of all global variable starting with "y". It uses importance sampling with 2000 samples on the region AREG.

$ mupip size -heuristic="scan,level=-1"

This example counts the number of blocks and records at 1 level below the root of the database tree.

$ mupip size -heuristic="arsample" -select='^g1:^g3'

This example estimates the size of global variables g1, g2 and g3 using accept/reject sampling with the default number of samples regardless of the region in which they reside.

-Subscript

Specifies the subscripted/non-subscripted global variables on which MUPIP SIZE runs. -SUBSCRIPT is incompatible with -SELECT.

The format of the SUBSCRIPT qualifier is:

-su[bscript]=global-list

global-name-list can be:

  • A range of global variables denoted by start:end syntax. For example, -subscript="^g1:^g4".

  • A range of subscripted global variables denoted by start:end syntax. For example, -subscript="^g(1):^g(4)".

  • String subscipts require sufficient quotes to make it though the shell parsing to reach MUPIP. For example, -select='^g1(""""a""""):^g1(""""b"""")'.

[Note] Note

Apart from randomness caused by sampling heuristics, MUPIP SIZE also has randomness from concurrent updates because it does not use the snapshot technique that MUPIP INTEG uses.

STOP

Terminates a GT.M image. The image executes an orderly disengagement from all databases that are currently open by the process, and then exits. A MUPIP STOP performs a kill -15 and therefore may also be used to stop non-GT.M images.

The format of the STOP command is:

MUPIP ST[OP] process-id
  • Use the shell command ps to display a list of active process names and process identifiers (PIDs).

  • To STOP a process belonging to its own account, a process requires no privileges. To STOP a process belonging to another account, MUPIP STOP must execute as root.

[Caution] Caution

On receipt of a MUPIP STOP signal, a GT.M process cleans up its participation in managing the database before shutting down. On receipt of three MUPIP STOP signals in a row within a minute, a GT.M process shuts down forthwith without cleaning up - the equivalent of a kill -9 signal. This can result in structural database damage, because GT.M does not have sufficient control of what happens in response to an immediate process termination to protect against database damage under all circumstances.

In all cases, on receipt of a MUPIP STOP, a process will eventually terminate once it gets the resources needed to clean up. Use three MUPIP STOPs in a row only as a last resort, and when you do, perform a MUPIP INTEG at your earliest opportunity thereafter to check for database structural damage, and repair any damage following the procedures in Chapter 11 (Maintaining Database Integrity).

You may never have to perform a MUPIP STOP if your application is designed in a way that it reduces or eliminates the probability of a process getting in the final try of a transaction. For more information, refer to the Programmers Guide.

TRIGGER

Examines or loads trigger definitions. The format of the MUPIP TRIGGER command is:

TRIGGER {-TRIG[GERFILE]=<trigger_definitions_file> 
[-NOPR[OMPT]]|[-SELE[CT][=name-list|*][<select-output-file>]|-UPGRADE}

Before you run the MUPIP TRIGGER command:

  1. Set the value of the environment variable gtmgbldir: to specify the value of a current global directory.

  2. Ensure that the key size, record size, block size of your database is sufficient for storing all planned trigger definitions. You may have to set the key and record sizes larger than the database content would otherwise require.

The qualifiers of the MUPIP TRIGGER command are as follows:

TRIGgerfile=<trigger_definitions_file>

Loads a trigger definition file to the database. The format of the TRIGGERFILE qualifier is:

-TRIG[GERFILE]=<trigger_definitions_file> [-NOPR[OMPT]]
  • For information on the syntax and usage of a trigger definition file, refer to the Triggers chapter and the $ZTRIGGER() section in the Functions chapter of the GT.M Programmer's Guide.

  • A MUPIP TRIGGER -TRIGGERFILE operation occurs within a transaction boundary, therefore, if even one trigger from the trigger definition file fails to parse correctly, MUPIP TRIGGER rolls back the entire trigger definition file load. Trigger maintenance operations reserve their output until the transaction commits at which time they deliver the entire output in a consistent way. MUPIP TRIGGER operations have an implicit timeout of zero (0), meaning the read must succeed on the first try or the command will act as if it received no input.

  • MUPIP TRIGGER -TRIGGERFILE ignores blank lines and extra whitespace within lines. It treats lines with a semi-colon in the first position as comments and ignores their content.

  • MUPIP TRIGGER compiles the XECUTE action string and rejects the load if the compilation has errors.

  • Always specify the same value for the environment variable gtm_chset during loading and executing triggers. If you specify different values of gtm_chset during loading and executing triggers, MUPIP TRIGGER generates a run-time error (TRIGINVCHSET). GT.M does not prevent a process from updating different nodes with triggers using a different character set, however, GT.M prevents a process from updating the same triggering node with different character sets. Your coding practice, for all database updates, should be to ensure that you provide the same value for gtm_chset during load compilation and run-time compilation.

  • MUPIP TRIGGER replicate trigger definitions as logical actions from an originating/primary instance to a replicating/secondary instance based on LGTRIG journal records. This permits the instances to have different sets of triggers and differing database layouts (for example, different # of regions, different block sizes, different maximum-record-size, and so on).

  • MUPIP TRIGGER error messages associated with loading triggers limit trigger expression source lines to 80 characters including a trailing ellipsis to indicate there was more text, and they also replace any non-graphic characters with a dot (.)

  • GT.M triggers apply to spanning regions. When $ZTRIGGER() or MUPIP TRIGGER define triggers that apply to globals spanning multiple regions, each of the spanned regions install a definition.

  • Incompatible with: -SELECT

[Note] Note
The trigger update summary reports count not only names and option changes as "modified" but also cases where a -COMMANDS list changed, even though those are functionally additions or deletions of separate trigger definitions.

SELECT=name-list

Provides a facility to examine the current trigger definition. SELECT produces a list of the current triggers for a comma-separate list of global variables or trigger names. The format of the SELECT qualifier is:

-SELE[CT][=name-list*][ <select-output-file>]
  • Name-list can include global names, delimited with a leading caret (^), and/or trigger names (user-defined or auto-generated) with no leading caret. You can specify a trailing asterisk(*) with either.

  • With no arguments specified, GT.M treats -SELECT as -SELECT="*" and extracts a list of all current triggers.

  • Optionally, you can specify a file name to redirect the output of the command. If you do not specify a file name, MUPIP TRIGGER prompts for a file name. If you respond with an empty string (RETURN), MUPIP TRIGGER directs the output to STDOUT.

  • MUPIP TRIGGER -SELECT displays all output including errors on STDOUT.

  • For Trigger definition reporting operations, $ZTRIGGER("SELECT") and MUPIP TRIGGER -SELECT, return a non-zero exit status when their selection criteria encounter an error in the select.

  • MUPIP TRIGGER -SELECT works even if a multi-line XECUTE string does not terminate with a newline character. For more information on multi-line XECUTE strings, refer to the -xecute="|<<strlit1"|>> section under Trigger Definition File in the Triggers chapter and the $ZTRIGGER() section in the Functions chapter of the GT.M Programmer's Guide.

    in the Programmers Guide.
[Note] Note

The output from the MUPIP TRIGGER -SELECT command may not be identical to your trigger definition file. This is because GT.M converts some semantically identical syntax into a single internal representation; while -SELECT output may not be identical to the -TRIGGERFILE input, it has the same meaning. Additionally, MUPIP TRIGGER -SELECT displays a field called "Cycle" as part of a comment. Cycle is the number of trigger definition updates (addition, modification, or deletion) performed on a global node.

[Important] Important

MUPIP TRIGGER treats the deletion of a non-existent trigger as a success; if that is the only operation, or one of a set of successful operations, it returns success 0 to the shell. Also, MUPIP TRIGGER returns failure in case of trigger selection using trigger names where the number after the pound-sign (#) starts with a 0 (which is an impossible auto-generated trigger name).

UPGRADE

Upgrades older trigger definitions into current format.

The format of the UPGRADE qualifier is:

-UPGRADE

If GT.M encounters an old trigger definition it produces a NEEDTRIGUPGRD message. To preserve the possibility of a straightforward downgrade to an earlier version, perform a select "*" action with MUPIP TRIGGER (or $ZTRIGGER() and save the result. Note that TRIGGER -UPGRADE assumes that the existing trigger definitions are properly defined; if the prior release has produced defective triggers delete them with a wild-card ("*"), and redefine the triggers in the new release. In the event of a downgrade, delete "*" all triggers before the downgrade and insert the saved version from before the upgrade. Attempting to perform a MUPIP TRIGGER -UPGRADE on a database without write authorization to the database produces a TRIGMODREGNOTRW error. The -UPGRADE qualifier is not compatible with any other MUPIP TRIGGER qualifier. Trigger upgrades from older versions may produce journal records based on the prior format that a MUPIP JOURNAL -RECOVER cannot process correctly, therefore, FIS recommends you do them with journaling off, and start with a backup and fresh journal files after the trigger upgrade.

Examples for MUPIP TRIGGER

This section provides step-by-step instructions for creating, modifying, and deleting triggers. Triggers affect all processes updating a database unlike, for example, environment variables such as $gtmroutines which work on a per process basis. Therefore, FIS recommends that you should always have carefully planned procedures for changing triggers in your production environment.

To create a new trigger for global node ^Acct("ID"):

  1. Using your editor, create a trigger definition file called triggers.trg with the following entry:

    +^Acct("ID") -name=ValidateAccount -commands=S -xecute="Write ""Hello Earth!"""
  2. Execute a command like the following:

    $ mupip trigger -triggerfile=triggers.trg

    This command adds a trigger for ^Acct("ID"). On successful trigger load, this command displays an output like the following:

    File triggers.trg, Line 1: ^Acct trigger added with index 1
    =========================================
    1 triggers added
    0 triggers deleted
    0 trigger file entries not changed
    0 triggers modified
    ========================================= 

    Now, every S[et] operation on the global node ^Acct("ID") executes the trigger.

  3. Execute a command like the following:

    $ mupip trigger -select="^Acct*"

    This command displays the triggers. A sample output looks like the following:

    ;trigger name: ValidateAccount# cycle: 1
    +^Acct("ID") -name=ValidateAccount -commands=S -xecute="Write ""Hello Earth!""" 

To modify an existing trigger for global node ^Acct("ID"):

You cannot directly replace an existing trigger definition with a new one. With the exception of -NAME and -OPTIONS, to change an existing trigger, you have to delete the existing trigger definition and then add the modified trigger definition as a new trigger. Note that GT.M performs two different trigger comparisons to match trigger definitions depending on whether or not S[ET] is the trigger invocation command. If there is a S[ET], then the comparison is based on the global name and subscripts, PIECES, [Z]DELIM, and XECUTE. If there is no SET, GT.M compares only the global node with subscripts and the -XECUTE code value.

  1. Begin by executing the following command:

    $ mupip trigger -select="^Acct*"Output file: 
  2. Specify trigger_mod.trg as the output file. This file contains entries like the following:

    ;trigger name: ValidateAccount# cycle: 1
    +^Acct("ID") -name=ValidateAccount -commands=S -xecute="Write ""Hello Earth!"""
  3. Using your editor, open trigger_mod.trg and change + (plus) to - (minus) for the trigger definition entry for ValidateAccount and add a new trigger definition for ^Acct("ID"). To avoid inconsistent application behavior, it is important to replace an old trigger with a new one in the same transaction (Atomic). The trigger_mod.trg file should have entries like:

    ;trigger name: ValidateAccount# cycle: 1
    -^Acct("ID") -name=ValidateAccount -commands=Set -xecute="Write ""Hello Earth!"""
    ;trigger name: ValidateAccount#
    +^Acct("ID") -name=ValidateAccount -commands=Set -xecute="Write ""Hello Mars!""" 
  4. Execute a command like the following:

    $ mupip trigger -triggerfile=trigger_mod.trg
  5. This command displays an output like the following:

    File trigger_mod.trg, Line 1: ^Acct trigger deleted
    File trigger_mod.trg, Line 3: ^Acct trigger added with index 1
    =========================================
    1 triggers added
    1 triggers deleted
    0 trigger file entries not changed
    0 triggers modified
    =========================================

    Congratulations! You have successfully modified the xecute string of ValidateAccount with the new one.

To delete an existing trigger for global node ^Acct("ID"):

  1. Begin by executing the following command:

    $ mupip trigger -select="^Acct*"Output file:
  2. Specify trigger_delete.trg as the output file. This file contains entries like the following:

    ;trigger name: ValidateAccount# cycle: 3
    +^Acct("ID") -name=ValidateAccount -commands=S -xecute="Write ""Hello Mars!"""
  3. Using your editor, change + (plus) to - (minus) for the trigger definition entry for ValidateAccount. Alternatively, you can create a file with an entry like -ValidateAccount.

  4. Now, execute a command like the following:

    $ mupip trigger -triggerfile=trigger_delete.trg

    This command displays an output like the following:

     File trigger_delete.trg, Line 2: ^Acct trigger deleted
    =========================================
    0 triggers added
    1 triggers deleted
    0 trigger file entries not changed
    0 triggers modified
    =========================================

You have successfully deleted trigger "ValidateAccount".

To change a trigger name for global node ^Acct("ID"):

  1. Using your editor, create a new file called trigger_rename.trg and add a trigger definition entry for ValidateAcct with the same trigger signature as ValidateAccount. Your trigger definition would look something like:

    +^Acct("ID") -name=ValidateAcct -commands=S -xecute="Write ""Hello Mars!"""
  2. Verify that the ValidateAccount trigger exists by executing the following command:

    $ mupip trigger -select="^Acct*"Output file:
  3. Respond with an empty string (Press Enter). Confirm that the trigger summary report contains an entry like the following:

    ;trigger name: ValidateAccount# cycle: 3
    +^Acct("ID") -name=ValidateAccount -commands=S -xecute="Write ""Hello Mars!"""
  4. Now, execute a command like the following:

    $ mupip trigger -triggerfile=trigger_rename.trg

    This command displays an output like the following:

    =========================================
    0 triggers added
    0 triggers deleted
    0 trigger file entries not changed
    1 triggers modified
    =========================================

    You have successfully changed the trigger name ValidateAccount to ValidateAcct.

UPGRADE

Upgrades a number of V6 database characteristics to a transitional V7 database format (V7m). This is the first stage in upgrading a V6 database to the V7 format. This command must be run standalone and does not take a long time. The remainder of the upgrade is done by MUPIP REORG -UPGRADE which completes the remaining index block upgrades with standalone access.

The format of the MUPIP UPGRADE command is:

UP[GRADE] [-FILE file-name | [-REGION] region-list]
  • Relocates blocks to make space for an expanded master bit map

  • Removes global names without any data, so called "dead" globals

  • Upgrades the database directory tree blocks to V7m

  • Changes the starting VBN (virtual block number) to values greater than or equal to 8193

  • Expands the existing master bit map

  • Sets the database format to V7m upon completion

Example for MUPIP UPGRADE

Example:

$ mupip upgrade -file mumps.dat

This example starts the first stage of the upgrade of mumps.dat to V7 format.