1 LMCP The LMCP utility creates and manages the transaction logs used by DECdtm services. CAUTION Some of the LMCP commands can corrupt data. See the OpenVMS System Manager's Manual for why you might want to use the LMCP utility, and how to use it safely. 2 CONVERT_LOG Creates a new transaction log and copies records from an existing transaction log to the new one. Use the CONVERT LOG command when you want to move a transaction log or change its size. CAUTION If a node already has a transaction log, using the CONVERT LOG command to create a new one can corrupt data. See the OpenVMS System Manager's Manual for information on how to use the CONVERT LOG command. Requires: o The CMKRNL privilege. o READ access to the existing transaction log and the directory it is in. o READ and WRITE access to the directory in which the new transaction log is to be created. Format CONVERT LOG old-filespec new-filespec 3 Parameters old-filespec The file specification of the transaction log whose records are to be copied. The CONVERT LOG command uses the following defaults: o If you omit the disk and directory, the CONVERT LOG command looks for the transaction log in the directories pointed to by the logical SYS$JOURNAL, which must be defined in executive mode in the system logical name table. o If you omit the file type, the CONVERT LOG command uses .LM$JOURNAL. new-filespec The file specification of the new transaction log to be created. For DECdtm services on a node to use the transaction log, the file must have a name of the form SYSTEM$node.LM$JOURNAL, where node is the name of the node. The CONVERT LOG command uses the following defaults: o If you omit the disk and directory, the CONVERT LOG command creates the new transaction log in the first accessible directory pointed to by the logical SYS$JOURNAL, which must be defined in executive mode in the system logical name table. o If you omit the file type, the CONVERT LOG command uses .LM$JOURNAL. 3 /OWNER /OWNER=uic Specifies the owner of the new transaction log. Specify the owner using the standard UIC format, as described in the OpenVMS User's Manual. 3 /SIZE /SIZE=size Specifies the size of the new transaction log in blocks. The minimum size is 100 blocks. If you omit this qualifier, the new transaction log is created with the default size of 4000 blocks. 3 Description The CONVERT LOG command creates a new transaction log and copies all active transaction records from the specified transaction log into the new one. 3 Example LMCP> CONVERT LOG/SIZE=6000 DISK$LOG2:[LOGFILES]SYSTEM$RED.LM$OLD - _LMCP> DISK$LOG2:[LOGFILES]SYSTEM$RED.LM$JOURNAL This example creates a 6000-block transaction log called SYSTEM$RED.LM$JOURNAL in directory DISK$LOG2:[LOGFILES]. It then copies all active transaction records from the existing transaction log, SYSTEM$RED.LM$OLD in directory DISK$LOG2:[LOGFILES], into the new transaction log. 2 CREATE_LOG Creates a new transaction log. CAUTION If a node already has a transaction log, using the CREATE LOG command to create a new one can corrupt data. Requires READ and WRITE access to the directory in which the transaction log is to be created. Format CREATE LOG filespec 3 Parameter filespec The file specification of the transaction log to be created. For DECdtm services on a node to use the transaction log, it must have a name of the form SYSTEM$node.LM$JOURNAL, where node is the name of the node. The CREATE LOG command uses the following defaults: o If you omit the disk and directory, the CREATE LOG command creates the transaction log in the first accessible directory pointed to by the logical SYS$JOURNAL, which must be defined in executive mode in the system logical name table. o If you omit the file type, the CREATE LOG command uses .LM$JOURNAL. If you specify a disk and directory not pointed to by SYS$JOURNAL a warning message is displayed. However, the transaction log is still created. The transaction log will not be used until either: o SYS$JOURNAL is modified to point to the disk and directory where the log was created or o You move the new transaction log to a directory pointed to by SYS$JOURNAL. 3 /NEW_VERSION Forces the CREATE LOG command to create a new version of an existing transaction log. CAUTION Creating a new version of an existing transaction log can lead to data corruption. The data in the two transaction logs cannot be merged. Once it has started using the new transaction log, DECdtm services cannot access any transaction records in the old transaction log. 3 /OWNER /OWNER=uic Specifies the owner of the transaction log. Specify the owner using the standard UIC format, as described in the OpenVMS System User's Manual. 3 /SIZE /SIZE=size Specifies the size of the transaction log in blocks. The minimum size is 100 blocks. If you omit this qualifier, the transaction log is created with the default size of 4000 blocks. 3 Example LMCP> CREATE LOG/SIZE=5000 DISK$LOG1:[LOGFILES]SYSTEM$ORANGE.LM$JOURNAL This example creates a 5000-block transaction log for node ORANGE in DISK$LOG1:[LOGFILES]. 2 DUMP Displays the contents of a transaction log. Requires READ access to the transaction log and the directory it is in. Format DUMP filespec 3 Parameter filespec The file specification of the transaction log whose contents you want to display. The DUMP command uses the following defaults: o If you omit the disk and directory, the DUMP command looks for the transaction log in the directories pointed to by the logical SYS$JOURNAL, which must be defined in executive mode in the system logical name table. o If you omit the file type, the DUMP command uses .LM$JOURNAL. 3 /ACTIVE Selects records only for active transactions. 3 /FORMAT Determines whether the contents of the transaction log are displayed as formatted records. Specify both the /NOFORMAT and the /HEX qualifiers to display the contents of the transaction log in hexadecimal only. If the /NOFORMAT qualifier is specified without the /HEX qualifier, only the transaction log header is displayed. 3 /HEX Specifies that the contents of the transaction log are displayed as both ASCII characters and hexadecimal longwords. Specify both the /NOFORMAT and /HEX qualifiers to display the contents of the transaction log in hexadecimal only. 3 /LOGID /LOGID=logid Selects records only for transactions that have participants using the specified log. The logid is in the Log ID field, to the right of the Type field. The value you specify must be exactly as it appears in the display, including hyphens. Note that you can use this qualifier only with the /RM qualifier. 3 /OUTPUT /OUTPUT[=filespec] Requires READ and WRITE access to the directory in which the output file is to be created. Specifies where the output from the DUMP command is sent. If you omit this qualifier, output is sent to the current SYS$OUTPUT device (usually your terminal). To send the output to a file, use the /OUTPUT qualifier. If you do not supply a file specification, the output is sent to the file LMCP_DUMP.LIS in your default directory. 3 /RM /RM=name Selects records only for transactions that have participants whose names begin with the specified value. The participant name is shown in the Name field, and is output in both ASCII and hexadecimal. If the participant name includes undisplayable characters, you can select records for that participant by using the hexadecimal form of its name. When specifying the hexadecimal form of the name, you must convert it by reversing the pairs in the hexadecimal number. For example, if the participant name is: Name (11): "SYSTEM$RED" (4445 52244D45 54535953) the value you specify for the /RM qualifier is: /RM=%X53595354454D24524544 3 /STATE Selects records only for transactions in either the Committed or Prepared states. 3 /TID /TID=transaction_id Selects records only for the specified transaction. The transaction_id is shown in the Transaction ID field. The value you specify must be exactly as it appears in the display, including hyphens. 3 Example LMCP> DUMP/RM="RMS$" DISK$LOGFILE:SYSTEM$BLUE.LM$JOURNAL This example displays the contents of the transaction log for node BLUE, selecting only transactions in which RMS Journaling is participating. 2 HELP Gives help on LMCP commands. Format HELP [help-topic [help-subtopic]] . . . 2 REPAIR Changes the state of transactions. CAUTION The REPAIR command can corrupt data. Use it only if none of the resource managers participating in the transaction provides a means of changing transaction states. Requires: o The CMKRNL privilege. o READ and WRITE access to the transaction log and the directory it is in. Format REPAIR filespec 3 Parameter filespec The file specification of the transaction log containing the transactions whose states you want to change. The REPAIR command requires the following: o The logical SYS$JOURNAL must be defined in executive mode in the system logical name table. o The transaction log must be in a directory pointed to by the logical SYS$JOURNAL. o The file type of the transaction log must be .LM$JOURNAL. The REPAIR command uses the following defaults: o If you omit the disk and directory, the REPAIR command looks for the transaction log in the directories pointed to by the logical SYS$JOURNAL. o If you omit the file type, the REPAIR command uses .LM$JOURNAL. 3 /LOGID /LOGID=logid Selects records only for transactions that have participants using the specified log. The logid is in the Log ID field, to the right of the Type field in the output from the DUMP command. The value you specify must be exactly as it appears in the display, including hyphens. Note that you can use this qualifier only with the /RM qualifier. 3 /RM /RM=name Selects records only for transactions that have participants whose names begin with the specified value. The participant name is shown in the Name field in the output from DUMP, and is output in both ASCII and hexadecimal. If the participant name includes undisplayable characters, you can select records for that participant by using the hexadecimal form of its name. When specifying the hexadecimal form of the name, you must convert it by reversing the pairs in the hexadecimal number. For example, if the participant name is: Name (11): "SYSTEM$RED" (4445 52244D45 54535953) the value you specify for the /RM qualifier is: /RM=%X53595354454D24524544 3 /STATE Selects records only for transactions in either the Committed or Prepared states. 3 /TID /TID=transaction_id Selects records only for the specified transaction. The transaction_id is shown in the Transaction ID field in the output from the DUMP command. The value you specify must be exactly as it appears in the display, including hyphens. 3 Description Use the REPAIR command to change the state of transactions. CAUTION The REPAIR command can corrupt data. Use it only if none of the resource managers participating in the transaction provides a means of changing transaction states. Use this command only if none of the resource managers participating in the transaction provides a means of changing the transaction state. For example, if Rdb is a participant in the transaction, do not use REPAIR; use the Rdb Management (RMU) utility commands instead. Similarly, if DBMS is a participant, use the Database Operator (DBO) utility commands. Change the transaction state only when you already know the outcome of the transaction and need to manually update the transaction log immediately. You might want to do this because, for example, you have lost the network link to a remote node. When you use the REPAIR command you use qualifiers to specify which transactions you want to change. By default, the REPAIR command selects all transactions. Once you have selected the transactions to change, you enter the REPAIR subcommand mode. Within this mode, the prompt changes to REPAIR> and you have a set of additional subcommands, described in Subcommands of the REPAIR Command. You use these commands either to manually change the state of the transaction, or to select the next transaction that matches your selection criteria. Table 12-1 Subcommands of the REPAIR Command Subcommand Action ABORT Specifies that a Prepared transaction is to be aborted by removing its record from the transaction log. This writes a record of type Forgotten for the transaction. Note that DECdtm services use the presumed abort logging protocol. COMMIT Specifies that a Prepared transaction is to be committed. This writes a record of type Committed for the transaction. EXIT Returns to the LMCP> prompt. FORGET Specifies that a Committed transaction can be removed from the transaction log. This writes a record of type Forgotten for the transaction. NEXT Displays the next transaction that matches your selection criteria. LMCP displays each of the selected transactions in turn, so that you can change them. For each selected transaction, you can either use the ABORT, COMMIT, and FORGET subcommands to change the state of the transaction, or use the NEXT subcommand to select the next transaction. To exit from the REPAIR subcommand mode, enter the EXIT subcommand or press Ctrl/Z. 3 Example LMCP> REPAIR/STATE=PREPARED/RM="RMS$" DISK$JOURNALS:[LOGFILES]SYSTEM$ORANGE In this example transactions to be modified are selected from the transaction log for node ORANGE. The transactions selected are those that match both of the following criteria: o RMS Journaling is participating in the transaction. o The transaction is in the Prepared state. 2 SHOW_LOG Displays information about transaction logs. Requires READ access to the transaction logs and the directories they are in. Format SHOW LOG [filespec] 3 Parameter filespec The file specification of the transaction logs you want to display information about. This can include the percent (%) and asterisk (*) wildcard characters. The SHOW LOG command uses the following defaults: o If you omit the disk and directory, the SHOW LOG command looks for the transaction log in the directories pointed to by SYS$JOURNAL, which must be defined in executive mode in the system logical name table. o If you omit the file type, the SHOW LOG command uses .LM$JOURNAL. 3 /CURRENT Displays information about the local node's transaction log. This includes the number of checkpoints and stalls that have occurred since DECdtm services started on this node. Note that you can use this qualifier only if you omit the parameter to the SHOW LOG command. 3 /FULL Lists all attributes of the transaction logs. For each transaction log, both the full file specification of the transaction log and its size are displayed. If you do not specify which transaction log you want to display, the SHOW LOG command lists all transaction logs of the form SYSTEM$*.LM$JOURNAL, in all directories pointed to by the logical SYS$JOURNAL, which must be defined in executive mode in the system logical name table. 3 /OUTPUT /OUTPUT[=filespec] Requires READ and WRITE access to the directory in which the output file is to be created. Specifies where the output of the SHOW LOG command is sent. If you omit this qualifier, output is sent to the current SYS$OUTPUT device (usually your terminal). To send the output to a file, use the /OUTPUT qualifier. If you do not supply a file specification, the output is sent to the file LMCP_SHOW.LIS in your default directory. 3 Example LMCP> SHOW LOG/FULL Directory of DISK$JOURNALS:[LOGFILES] DISK$JOURNALS:[LOGFILES]SYSTEM$BLUE.LM$JOURNAL;1 End of file block 4002 / Allocated 4002 Log Version 1.0 Log File UID: 647327A0-2674-11C9-8001-AA00040069F8 Penultimate Checkpoint: 000000001A39 0039 Last Checkpoint: 000000001C8A 008A Total of 1 file. Directory of DISK$RED:[LOGFILES] DISK$RED:[LOGFILES]SYSTEM$RED.LM$JOURNAL;1 End of file block 4002 / Allocated 4002 Log Version 1.0 Log File UID: 17BB9140-2674-11C9-8001-AA0004006AF8 Penultimate Checkpoint: 000000ECADE5 41E5 Last Checkpoint: 000000F1O5FC 41FC Total of 1 file. Directory of DISK$LOGFILES:[LOGS] DISK$LOGFILES:[LOGS]SYSTEM$YELLOW.LM$JOURNAL;1 End of file block 1002 / Allocated 1002 Log Version 1.0 Log File UID: 590DAA40-2640-11C9-B77A-08002B14179F Penultimate Checkpoint: 00000C8B4819 2019 Last Checkpoint: 00000C8BC15B 335B Total of 1 file. Total of 3 files in 3 directories. This example displays full details about the transaction logs in all directories pointed to by the logical SYS$JOURNAL. This logical is defined in executive mode in the system logical name table.