1 – DATABASE
Creates the basic OpenVMS Registry database files in the location specified by the SYS$REGISTRY logical. The command creates an empty database and loads the predefined keys. If you enter this command and the database files already exist, the utility does not overwrite the existing files. The system displays a warning that the files already exist. If you want to create a new OpenVMS Registry database, you must first delete all previous versions of the database files. If you delete the OpenVMS Registry database files, you will lose all keys, subkeys, and values stored in the OpenVMS Registry. This command requires the SYSPRV privilege. The following table lists and describes the OpenVMS Registry database files. File Description REGISTRY$ROOT.DAT Root of the database REGISTRY$USERS.REG HKEY_USERS tree REGISTRY$LOCAL_MACHINE.REG HKEY_LOCAL_MACHINE tree REGISTRY$MASTER.RLG The master commit log file REGISTRY$REPLY.RLG Log file that tracks modification requests to the OpenVMS Registry database Format: CREATE DATABASE
1.1 – Qualifiers
1.1.1 /WAIT
/WAIT=seconds (default = 90) /NOWAIT Specifies the maximum amount of time, in seconds, that you are willing to wait for command completion. If the Registry server does not complete the request in the specified interval, REG$CP returns REG-F-NORESPONSE. The default interval is 90 seconds. /NOWAIT is equivalent to specifying /WAIT=0, but there may still be a short wait period.
1.1.2 /VERSION
/VERSION=version-number (default = 2) Specifies how to format the database. Specify a version number of 1 to create a non-indexed database. Specify a version number of 2 to create an indexed database. NOTE OpenVMS Registry servers running on OpenVMS V7.3-1 or later support both version 1 and version 2 databases. OpenVMS Registry servers prior to OpenVMS V7.3-1 support version 1 databases only.
1.2 – Examples
REG> CREATE DATABASE By default, this command regenerates the basic OpenVMS Registry database files using version 2 format (indexed database). REG> CREATE DATABASE/VERSION=1 This command causes the basic OpenVMS Registry database files to be regenerated using version 1 format (non-indexed database).
2 – KEY
Creates one or more keys in the OpenVMS Registry database. This command requires the SYSPRV privilege or the REG$UPDATE rights identifier. Format: CREATE KEY key-name[,...] key-name[,...] Specifies the name of the key to create. You can create multiple keys by separating the keys with commas.
2.1 – Qualifiers
2.1.1 /CACHE_ACTION
/CACHE_ACTION=value Specifies the cache attribute for the new key. The value can be WRITEBEHIND (write to disk later) or WRITETHRU (write to disk immediately). If you omit /CACHE_ACTION, the system creates the key with the cache attribute set to REG$K_WRITEBEHIND.
2.1.2 /CLASS_NAME
/CLASS_NAME=string Specifies the class name of the key.
2.1.3 /LINK
/LINK=(TYPE=value, NAME=key-name) Defines the key as a link to another key. The link value must be one of the following: o SYMBOLICLINK o NONE To remove a link, enter the following: /LINK=(TYPE=NONE,NAME="")
2.1.4 /SECPOLICY
/SECPOLICY=policy Defines the security policy for the key. Currently the only valid policy is NT_40.
2.1.5 /VOLATILE
/VOLATILE=level /NONVOLATILE (default) Specifies whether or not the new key is volatile. If you are running the OpenVMS Registry on a standalone OpenVMS system, volatile keys are lost when the system reboots. If you are running the OpenVMS Registry in an OpenVMS cluster, volatile keys are lost when all nodes in the cluster are rebooted. The values for level are as follows: o NONE (same as /NONVOLATILE) o CLUSTER
2.1.6 /WAIT
/WAIT=seconds (default = 90) /NOWAIT Specifies the maximum amount of time, in seconds, that you are willing to wait for command completion. If the Registry server does not complete the request in the specified interval, REG$CP returns REG-F-NORESPONSE. The default interval is 90 seconds. /NOWAIT is equivalent to specifying /WAIT=0, but there may still be a short wait period.
2.1.7 /WRITEBEHIND
/WRITEBEHIND /NOWRITEBEHIND (default) Specifies when the information can be written to disk. /WRITEBEHIND specifies that the information can be written to disk later. /NOWRITEBEHIND specifies write-through operation (that is, the information must be written to disk immediately).
2.2 – Example
REG> CREATE KEY/CACHE_ACTION=WRITEBEHIND HKEY_USERS - _REG> \GUEST, HKEY_USERS\SYSTEM Creates the GUEST and SYSTEM keys under the HKEY_USERS entry point. The keys are created with the write-behind attribute.
3 – SNAPSHOT
Creates a snapshot of the OpenVMS Registry database. That is, the system writes all cached OpenVMS Registry keys or values and makes a copy of the OpenVMS Registry database files. The OpenVMS Registry server copies database files to the location specified by /DESTINATION (SYS$REGISTRY by default), using the file extension .RSS (Registry SnapShot). To restore the snapshot, shut down all applications using the Registry, shut down the Registry server, and copy the files to SYS$REGISTRY, renaming them with the .REG file extension. NOTE When you restore the database from a snapshot, you lose all modifications that were made to the database since the last snapshot was taken. By default the OpenVMS Registry server creates a snapshot automatically every 24 hours and retains the five most recent snapshot files. This command requires the SYSPRV privilege. Format: CREATE SNAPSHOT
3.1 – Qualifiers
3.1.1 /DESTINATION
/DESTINATION=file-spec Controls where the system will write the snapshot files. By default, the system creates the snapshot in the location specified by the SYS$REGISTRY logical. If you specify the /DESTINATION qualifier but do not provide a valid directory, the system creates the snapshot files in the directory in which you started the OpenVMS Registry server.
3.1.2 /VERSIONS
/VERSIONS=number Specifies how many previous versions of the snapshot files to keep.
3.1.3 /WAIT
/WAIT=seconds (default = 90) /NOWAIT Specifies the maximum amount of time, in seconds, that you are willing to wait for command completion. If the Registry server does not complete the request in the specified interval, REG$CP returns REG-F-NORESPONSE. The default interval is 90 seconds. /NOWAIT is equivalent to specifying /WAIT=0, but there may still be a short wait period.
3.2 – Example
REG> CREATE SNAPSHOT/DESTINATION=SYS$REGISTRY/VERSION=3 Creates a snapshot of the OpenVMS Registry database in the SYS$REGISTRY directory. If more than three versions of the OpenVMS Registry database snapshot files exist, the system deletes the oldest version (the same as purge/keep=3 command).
4 – VALUE
Specifies the data component for the specified key. If the value does not exist, the command creates the value. This command requires the SYSPRV privilege or the REG$UPDATE rights identifier. Format: CREATE VALUE key-name key-name Specifies the name of the key for which you will set the value.
4.1 – Qualifiers
4.1.1 /DATA
/DATA=value The value can be one of the following: o String (for example, /DATA=COSMOS) o An array of strings separated by a comma and enclosed in parentheses (for example, /DATA=(COSMOS,Noidea) o A longword in binary, octal, decimal, or hexadecimal format. %B, %O, %D, and %X, or 0B, 0O, 0D, and 0X prefixes specify the format. The default is decimal. Examples: /DATA=%X1A0FCB (hex) /DATA=0X1A0FCB (hex) /DATA=%D1234 (decimal) /DATA=1234 (decimal, by default) NOTE You cannot specify the /INPUT qualifier with /DATA.
4.1.2 /FLAGS
/FLAGS=flag Specifies the data flags value. This is an application-dependent 64-bit flag specified as a decimal number or as a hexadecimal number preceded by 0x or %X.
4.1.3 /INPUT
/INPUT=filename Specifies that the value data is to be read from a file. The input value data can be specified in one of the following formats. With the exception of SZ, the format is specified by a keyword at the start of the file. The keyword can be entered in uppercase or lowercase. Input records following a keyword can span multiple lines; use "\" at the end of any continuation lines. o SZ: a null-terminated Unicode string Enter SZ data by enclosing the record in quotes. You do not specify an SZ keyword for this input value type. You cannot continue the quoted string to a second line. "This is Unicode Data." o DWORD: A 32-bit number. The data following the DWORD keyword is interpreted as a single, 32-bit value. It can be entered as a single value or as a list of values, separated by commas, with the least significant value first, provided the total is 32 or fewer bits. For example, the following valid specifications are equivalent: dword:44332211 DWORD:11,22,33,44 Dword:2211,4433 The following specifications are invalid because the total always exceeds 32 bits: dword:5544332211 dword:11,22,33,44,55 dword:2211,554433 o EXPAND_SZ: A string of Unicode characters. The data following the EXPAND_SZ keyword is interpreted as a list of 4-byte Unicode values. For example: expand_sz:43,44,45 This example stores the Unicode string "CDE". o MULTI_SZ: A concatenated array of SZ strings. The data following the MULTI_SZ keyword is interpreted as a list of 4-byte Unicode values, specifying two or more terminated SZ strings. For example: MULTI_SZ:52,61,69,6e,00,53,6c,65,65,74,00,53,6e,6f,77,00 This example stores the Unicode strings "Rain", "Sleet", and "Snow". o HEX: Binary data. The data following the HEX keyword is interpreted as a list of hex values. For example: HEX:0F,C0,F0,FF o DEC: Binary data. The data following the DEC keyword is interpreted as a list of decimal values. For example: DEC:15,192,240,255 o OCT: Binary data. The data following the OCT keyword is interpreted as a list of octal values. For example: OCT:17,300,360,377 o BIN: Binary data. The data following the BIN keyword is interpreted as a list of binary values. For example: BIN:1111,11000000,11110000,11111111 NOTES o The input format is similar to the IMPORT and EXPORT file format. o The input data type is independent of the data storage type, which is specified by the /TYPE_CODE qualifier. o When you specify a binary input type (HEX, DEC, OCT or BIN) for each value in the record, the data is stored in the fewest bytes possible. No alignment is performed. To insure proper alignment, always enter any list of values as byte values. This input should be a stream of byte values, with the least significant byte first. For example: DEC:253, 254, 255, 256, 257 (bytes/words, unaligned) DEC:253, 0, 254, 0, 255, 0, 256, 257 (bytes/words, word aligned) DEC:253, 0, 254, 0, 255, 0, 0, 1, 0, 2 (byte stream, word aligned) o The input and storage types must be compatible. For example, you cannot specify value type DWORD (which means that the stored data is 4 bytes) and then input the SZ string "A" because then the SZ string would consist of the character 00000041 and the terminator 00000000, which cannot fit in a DWORD. Attempting this will result in a REG-E-INVDATA error. However, specifying an empty string ("") does work and stores just the terminator. Conversely, the input type DWORD specifies an input data length of 4 bytes. You cannot specify value type SZ and input type DWORD:00000041 because SZ strings must be terminated. The only valid DWORD you can enter in this case is 00000000. o When specifying /INPUT, you cannot specify the /DATA qualifier.
4.1.4 /LINK
/LINK=(TYPE=value, NAME=key-name) Defines the key as a link to another key. The link value must be one of the following: o SYMBOLICLINK o NONE To remove a link, enter the following: /LINK=(TYPE=NONE,NAME="")
4.1.5 /NAME
/NAME=string Specifies the name of the new value.
4.1.6 /TYPE_CODE
/TYPE_CODE=type Specifies the type of the new value. The type value must be one of the following: o SZ: a null-terminated Unicode string o EXPAND_SZ: a string of Unicode characters o MULTI_SZ: a concatenated array of SZ strings o DWORD: a 32-bit number o BINARY: raw binary data
4.1.7 /WAIT
/WAIT=seconds (default = 90) /NOWAIT Specifies the maximum amount of time, in seconds, that you are willing to wait for command completion. If the Registry server does not complete the request in the specified interval, REG$CP returns REG-F-NORESPONSE. The default interval is 90 seconds. /NOWAIT is equivalent to specifying /WAIT=0, but there may still be a short wait period.
4.1.8 /WRITEBEHIND
/WRITEBEHIND /NOWRITEBEHIND (default) Specifies when the information can be written to disk. /WRITEBEHIND specifies that the information can be written to disk later. /NOWRITEBEHIND specifies write-through operation (that is, the information must be written to disk immediately).
4.2 – Examples
REG> CREATE VALUE/DATA=COSMOS/TYPE=SZ/NAME=COMPUTERNAME - _REG> HKEY_LOCAL_MACHINE\NODE This example creates the COMPUTERNAME value for the key HKEY_LOCAL_MACHINE\NODE and sets its type to SZ and its data value to "COSMOS". REG> CREATE VALUE HKEY_USERS\CVEX1/NAME=SZ-HEX/TYPE=SZ/INPUT=SYS$INPUT HEX:41,00,00,00,42,00,00,00,43,00,00,00,44,00,00,00,45,00,00,00,\ 46,00,00,00,00,00,00,00 This example creates the SZ-HEX value for the key HKEY_USERS\CVEX1 and sets its type to SZ. The data is entered as hex data. In this particular case, the data equates to the Unicode string "ABCDEF". It would be simpler to enter ABCDEF as a string. However, this format provides the capability of entering any Unicode value, including those you may not be able to input directly as a string. $ CREATE POWERS2.DAT DEC:2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,\ 131072,262144,524288,1048576,2097152,4194304,8388608,16777216,\ 33554432,67108864,134217728,268435456,536870912,1073741824 REG> CREATE VALUE - HKEY_USERS\CVEX2/NAME=BIN-FILE/TYPE=BINARY/INPUT=POWERS2.DAT This example creates data file POWERS2.DAT containing a series of decimal values. Next the user creates the value BIN-FILE for the key HKEY_USERS\CVEX2 and sets its type to BINARY. The raw binary data is read from file POWERS2.DAT to BIN-FILE.