mrebuild Utility - Convert MKEYED File Format

Syntax

mrebuild {-r} {-n} {-2} {-p} {-kkeynum}{-ecrypt password} {-c | -cnew password} sourcedestination
mrebuild -ddir {-r} {-n} {-2} {-p} {-kkeynum}{-ecrypt password} {-c | -cnew password} source {source...}
mrebuild -s {-p} {-kkeynum}{-ecrypt password} source {source...}

Description

The mrebuild utility can be used to:

  • Convert MKEYED files from one format to another.

  • Rebuild MKEYED files in the same format.

  • Scan MKEYED files for corruption.

The mrebuild utility is available in Revision 2.22 and later, and supersedes the mkconvert utility. The capabilities of mrebuild are tied to the capabilities of the revision of the PRO/5 or Visual PRO/5 client. For example, the mrebuild utility that comes with Visual PRO/5 Revision 3.x can create 64-bit files. The mrebuild utilities that ship with earlier revisions cannot handle 64-bit files.

64-bit MKEYED files are not supported on Windows 98. Attempting to open or erase a 64-bit MKEYED file under Windows 98 will cause an !ERROR=153 (file system does not support large files). However, access to these 64-bit files through the PRO/5 Data Server is fully supported.

Note that attempting to create a 64-bit file on a filesystem that does not have Large Files enabled causes the mrebuild utility to create the file as a 2-GB file (it will not return an error).

Parameter

Description

-2

Rev.3.x only. Creates a 2-GB destination file instead of a 64-bit destination file. It can be used to convert 64-bit MKEYED files to standard MKEYED files. It can also be used to rebuild standard MKEYED files without converting them to 64-bit MKEYED files. If a standard MKEYED file cannot accommodate all of the active records in the source without exceeding 2GB, the conversion will fail when the destination file reaches 2GB.

-128

Encrypt, destination files with AES-128, regardless of whether or not the source files are encrypted.

-256

Encrypt, destination files with AES-256, regardless of whether or not the source files are encrypted with AES-256.

-c

Prompt for a new encryption password. Use this option to re-encrypt a file with a different password. Pressing Enter when prompted for the new password will create an unencryption destination file.

-cpassword

New encryption password for the destination files. Note that entering the password on the command line instead of at the mrebuild password prompt is a potential security risk on multiuser systems since the process command line might visible to other users via process status utilities such as "ps".

-ddir

Rev.3.x only. Directory to save multiple converted or rebuilt files. Uses the second syntax example.

-epassword

Password for encrypted files. mrebuild will prompt for the password if this option is not used. Note that entering the password on the command line instead of at the mrebuild password prompt is a potential security risk on multiuser systems since the process command line might visible to other users via process status utilities such as "ps".

-kkeynum

Causes the specified key chain to be used instead of the primary key chain. This can provide some assistance when attempting to salvage records from a damaged MKEYED file that had not been converted to recoverable format. Do not use this utility to salvage records from a damaged recoverable MKEYED file, use the mkrecover utility.

-n

Creates a non-recoverable destination file, regardless of whether or not the source file was a recoverable MKEYED file. It can be used to convert recoverable MKEYED files to non-recoverable MKEYED files, or to rebuild a non-recoverable MKEYED file. Starting in Rev 3.x, the destination file is a 64-bit non-recoverable MKEYED file unless the -2 option is also specified.

-p

Prevents mrebuild from exiting with an error when the file cannot be locked for exclusive access. This option can be used when the source file is located on a read-only device, such as a CD-ROM, and this utility cannot lock the file.

Using this option in an environment where another user can change the file while this utility is running will result in an incomplete or corrupted destination file. This is because this utility relies on cached headers and key tables and does not continuously verify that the key table was not rearranged by another user adding, renaming, or removing keys (which would significantly increase the time to convert the file).

-r

Creates a recoverable destination file regardless of whether or not the source file was a recoverable MKEYED file. It can be used to convert non-recoverable MKEYED files to recoverable MKEYED files, or to rebuild a recoverable MKEYED file. Starting in Rev 3.x, the destination file is a 64-bit recoverable multi-keyed file, unless the –2 option is also specified.

-s

Scans the source file without converting it. It can be used to verify that the specified key chain and all the data records in the source file are readable. Uses the third syntax example.

destination

Name and path of the converted file.

source

Name and path of the file to be converted.

Read/Write Capabilities

The following identifies the versions of the mrebuild utility and its read/write capabilities:

Revision

Read/Write 2-GB?

Read/Write 4-GB?

Read/Write 64-Bit?

Visual PRO/5 and PRO/5 2.23+ without 4-GB support

Yes/Yes

No/No

No/No

PRO/5 2.23+ with 4-GB support

Yes/Yes

Yes/Yes

No/No

PRO/5 3.0+

Yes/Yes

Yes/No

Yes/Yes

The mrebuild utility cannot convert non-4-GB files to 4-GB files. Use the OPEN verb with MODE="4GB".

Converting MKEYED Files to Another Format

To Convert

Option(s)

Example

2-GB, 4-GB, or 64-bit to recoverable 64-bit(Rev 3.x only)
2-GB to 2-GB recoverable (Rev 2.2x)
4-GB to 4-GB recoverable (Rev 2.2x only)

-r

mrebuild –r accts recovaccts

2-GB, 4-GB, or 64-bit to recoverable 2-GB (Rev 3.x only)

-r -2

mrebuild –r –2 accts recovaccts

Multiple files to recoverable 64-bit (Rev. 3.x only)

-ddir -r

mrebuild –d/regional/west –r accts1
accts2 accts3

Multiple files to recoverable 2-GB (Rev. 3.x only)

-ddir -r -2

mrebuild –d/regional/west –r –2
accts1 accts2 accts3 accts4

Recoverable/non-Recoverable 2-GB, 4-GB, or 64-bit to non-recoverable 64-bit (Rev 3.x only) Recoverable 2-GB to non-recoverable 2-GB (Rev 2.2x)
Recoverable 4-GB to non-recoverable 4-GB (Rev 2.2x only)

-n

mrebuild –n recovaccts accts

Recoverable 2-GB, 4-GB, or 64-bit to non-recoverable 2-GB (Rev. 3.x only)

-n -2

mrebuild –n –2

Multiple recoverable files to non-recoverable 64-bit (Rev. 3.x only)

-ddir -n

mrebuild –d/regional/west –n accts1
accts2 accts3

Multiple recoverable files to non-recoverable 2-GB (Rev. 3.x only)

-ddir -n -2

mrebuild –d/regional/west –n –2
accts1 accts2 accts3 accts4

In PRO/5 Rev. 3.x, 64-bit MKEYED files can be created using SETOPTS 7 $80$. MS-DOS wildcards cannot be used for multiple file conversions.

Rebuilding MKEYED Files in the Same Format

To Rebuild

Option(s)

Example

64-bit(Rev 3.x only)
2-GB (Rev 2.2x)

-n

mrebuild –n accts rebuiltaccts

2-GB (Rev 3.x only)

-n -2

mrebuild –n –2 accts rebuiltaccts

64-bit recoverable(Rev 3.x only)
2-GB recoverable (Rev 2.2x)

-n

mrebuild –r recovaccts rebrecovaccts

2-GB recoverable (Rev 3.x only)

-n-2

mrebuild –n-2 recovaccts rebrecovaccts

Multiple 64-bit (Rev. 3.x only)

-ddir -n

mrebuild –d/regional/west –n accts1
accts2 accts3

Multiple 2-GB (Rev. 3.x only)

-ddir -n -2

mrebuild –d/regional/west –n –2
accts1 accts2 accts3

Multiple recoverable 64-bit (Rev. 3.x only)

-ddir -r

mrebuild –d/regional/west –r accts1
accts2 accts3

Multiple recoverable 2-GB (Rev. 3.x only)

-ddir -r -2

mrebuild –d/regional/west –r –2
accts1 accts2 accts3

Do not use the mrebuild utility to rebuild corrupted recoverable files. Use the mkrecover utility. The mrebuild utility does not support the rebuilding of 4-GB files, with the exception of the version that ships with PRO/5 2.23 with 4-GB support.

Scanning Files MKEYED files for Corruption

To scan one or more files for corruption, use the –s option, as seen in the following example:

mrebuild –s acct1 acct2 acct3 acct4

Note: The mrebuild utility verifies that all active records are readable. It does not check unused data or key blocks. Because of this, files that have a bad unused key block can pass mrebuild -s but cause an !ERROR=7 when a new record is added or a key is changed.

Return Codes

When mrebuild is invoked from a script or with the SCALL() function, it uses the return codes listed below:

0

No problems occurred.

1

Source file is partially unreadable.

2

Source file is completely unreadable.

3

Can't open the source file

4

Can't lock the source file.

5

Can't create/open the destination file.

6

Can't write to the destination file.

7

Command line syntax error.

8

Can't initialize the file system.

9

Insufficient memory.

See Also

Alphabetical Utilities

Functional Listing of Utilities