Sql tables and catalogs, Example 2, Sql index tables – HP Integrity NonStop J-Series User Manual
Page 45
![background image](/manuals/397231/45/background.png)
One-time Synchronization
HP AutoSYNC User’s Guide—522580-017
3-7
SQL Tables and Catalogs
Example 2
File $DATA.DB.ACCT has its alternate key ACCTAK on subvolume $KEYS.DBKEYS.
To synchronize the file and alternate key file to identically named files on the
destination system, use the following command:
To synchronize the $DATA.DB.ACCT and its alternate key file to different volumes and
subvolumes on the destination system, use the following SYNC commands, specifying
a MAPNAMES file to describe the mapping of the volume and subvolume names:
SQL Tables and Catalogs
If a SQL table is duplicated, it must be registered in a SQL catalog. If the
synchronization is local (source system and destination system are the same), the
same catalog is used. If the destination is on a remote system, and a catalog that has
the same name exists on the destination, the destination’s catalog is used.
You may specify a specific SQL catalog through the CATALOG option or by adding
CATALOGS entries in the mapnames-file of the MAPNAMES option. See paragraph
File and Catalog Name Mapping using MAPNAMES
on page 3-10 below for details.
The SQL catalog, whether specified or not, can be automatically created by using the
AUTOCREATECATALOG option.
SQL Index Tables
If you synchronize a SQL table, any indexes defined for that table are implicitly
synchronized with the SQL base table as follows:
•
If the index tables reside on the same subvolume in the source file set, they are
synchronized with the base table.
•
If the index tables reside in a different subvolume than the base table in the source
file set, use the MAPNAMES option to specify the mapping of the source names to
the destination names.
The destination file set must be defined using a filename that has the wild-card
character asterisk (*); otherwise SQL tries to restore indexes and base table to the
same filename.
SYNC $*.DB*.ACCT* TO \DEST.*.*.*;
SYNC $DATA.DB.ACCT TO \DEST.$BACK.*.*, MAPNAMES mapacct...;
SYNC $KEYS.DBKEYS.ACCTAK TO \DEST.$BACKEYS.*.*, MAPNAMES mapacct...;
where the MAPNAMES file mapacct contains the following entries:
$DATA TO $BACK
$KEYS TO $BACKEYS
SYNC $DATA.SQLTBL.MYTBL TO \DEST.$DATA.SQLTBL.MYTBL*;!