docs.intersystems.com
Home  /  System Administration  /  Specialized System Tools and Utilities  /  Using cvendian for Byte Order Conversion


Specialized System Tools and Utilities
Using cvendian for Byte Order Conversion
[Back] 
InterSystems: The power behind what matters   
Search:  


This chapter describes a utility to convert the byte order of an InterSystems database for migration between Big-endian and Little-endian platforms. It also provides an option to report on the byte order of a given database.
Introduction to cvendian
InterSystems provides a utility to convert the byte order of an InterSystems database from Big-endian (that is, most-significant byte first) to Little-endian (that is, least-significant byte first), and vice versa. It is called cvendian, for convert endian. This is useful when moving a database among platforms of the two types. It also provides an option to report on the byte order of a given database.
For information about the Endianness of supported platforms, see “Platform Endianness” in the online InterSystems Supported Platforms document for this release.
Important:
You cannot use this utility on a mounted database.
Location of Utility
The cvendian utility is the file install-dir\Bin\cvendian.exe.
Conversion Process
You can run cvendian on either the system that has the files to be converted or the system that will be using the converted files.
For example, to convert a database from a Little-endian to a Big-endian system, you can perform the conversion on the Little-endian system and then transfer the database to the Big-endian system, or you can transfer the file first, and then convert it.
Note:
This utility does not work for backup and journal files. You must restore databases on a platform of the same endian, move the restored databases to the different endian platform, and then use the cvendian utility to convert the databases.
To convert a database, the process is:
  1. Make a copy of your database files, because the utility replaces the source files with the converted files.
  2. Run cvendian using the syntax described in the Utility Syntax section.
Utility Syntax
With the cvendian endian utility, you can specify the desired byte order, or you can report the current byte order without conversion. Use the following syntax:
cvendian [-option] file
The option argument is one of the following:
You can shorten the options to their initial letter. If this is a conversion request (-big or -little), and the database already has the specified byte order, the utility displays a warning message and stops processing.
If you do not provide the option argument, the utility converts the database from the existing byte order to the other byte order. It is recommended, however, that you use the option argument.
The file argument is the file to convert, and can include a complete pathname.
The utility performs the following actions:
Example
For example, suppose you are converting a database for use on IBM AIX® for Power System-64 from Windows Server 2016. This means you must convert from Little-endian (for Intel) to Big-endian (for POWER). The output from running cvendian on the Windows system before moving the file to the AIX system looks similar to this:
C:\IrisSys\Bin>cvendian -big c:\temp\powerdb\iris.dat

This database is little-endian.
This database has a block size of 8192 bytes.

This database has 1 volume and 1 map.
The last block in the primary volume is 18176.

Original manager directory is c:\temp\powerdb\

No extension volumes.

Done converting c:\temp\powerdb\iris.dat to big-endian

C:\IrisSys\Bin>
You can now move the converted database file to the AIX system.