Caché provides a utility to convert a Caché database from a big-endian
to a little-endian format, and vice versa. It is called
cvendian,
for
con
vert
endian.
This is useful when moving a database among platforms of the two types.
Supported big-endian platforms are HP PA-RISC, IBM pSeries, and Sun Sparc; supported
little-endian platforms are HP Alpha and Intel.
You can run
cvendian on either the machine that has the files
to be converted or the machine that will be using the converted files. For example,
to convert a database from a little-endian to a big-endian machine, you can perform
the conversion on the little-endian machine and then transfer the database to the
big-endian machine, or you can transfer the file first, and then convert it.
Note:
Users converting databases to run on OpenVMS systems must convert them on the
source machine instead of the OpenVMS target machine.
To convert a database, the process is:
-
Make a copy of your database files, since the utility replaces the
source file(s) with the converted file(s).
-
Run
cvendian using the syntax as described below.
-
After converting a multivolume database file, use the
^LABEL utility
to rename the directory in each volume. To do this, use the
Caché
Terminal, go to the %SYS namespace. Call
^LABEL with
the
Do command and it will prompt you for input:
USER>zn "%SYS"
%SYS>Do ^LABEL
Enter the name of the directory in which the database is
stored. For a multi-volume database, enter the name of the
primary volume's directory, even if you want to relabel a
secondary volume. For a multi-volume legacy 2K database, you
should enter the name of the secondary volume directory if
you need to relabel it.
Directory:
cvendian file1 [file2 ... file8]
where
file1 through
file8 are the files
to convert; each file listed can include a complete pathname. The
file2 through
file8 arguments
are for a multivolume database; if you are converting a multivolume database, you
must specify all the volumes on the command line, in order.
The utility performs the following actions:
-
Autodetects which format the database uses
-
Displays format information and other information
-
-
Displays a message indicating success or failure
For multivolume databases, if the files are out of order or the list is not
complete, the utility does not perform any conversions and the files are left as they
are.
Suppose you are converting a database for use on Solaris Sparc from Windows
XP. Since Sparc and Intel have incompatible data representations, you need to convert
from little-endian format (for Intel) to big-endian format (for Sparc). If you run
cvendian on
the Windows machine before moving the file to the Solaris machine, the output looks
something like this:
C:\CacheSys\Bin>cvendian c:\\temp\solarisdb\cache.dat
This database is little-endian.
This database has a block size of 8192 bytes.
This is a BIG database.
This database has 1 volume and 1 map.
The last block in the primary volume is 18176.
Original manager directory is c:\\temp\solarisdb\
No extension volumes.
Done converting c:\temp\solarisdb\cache.dat to big-endian
C:\CacheSys\Bin>
Note:
The
cvendian output statement
This is a BIG database. refers
to the database using the standard Caché 8-KB blocks instead of 2-KB blocks.
It is not a comment on the amount of space that the database is using or the database's
use of a big-endian format.
You would then move the converted file to the Solaris machine.