Hvrcatalogexport, hvrcatalogimport
Name
hvrcatalogexport - Export from hub database into HVR catalog document.
hvrcatalogimport - Import from HVR catalog document into hub database.
Synopsis
hvrcatalogexport [-cchn...] [-C] [-d] [-g] [-hclass] [-l] [-uuser] hubdb catdoc
hvrcatalogimport [-hclass] [-uuser] hubdb catdoc
Description
Command hvrcatalogexport extracts information from the HVR catalog tables in the hub database and writes it into file catdoc. HVR catalog document catdoc is an XML file which follows the HVR catalog Document Type Definition (DTD).
You can export the information about:
- Locations (see the hvr_location catalog table)
- Channel Definitions (see the hvr_channel, hvr_table, hvr_column, hvr_loc_group and hvr_action catalog tables)
- Group Membership (see the hvr_loc_group_member catalog table)
- Configuration Action (see the hvr_config_action catalog table).
Configuration Action
Configuration Actions are the actions defined at a location level. In HVR GUI, when an action is defined on a location (by right-clicking the location), the option Configuration Action is automatically selected in the New Action dialog. However, when an action is defined for a channel, location group or table (by right-clicking the channel, location group or table), the option Configuration Action needs to be manually selected in the New Action dialog to apply this action to a specific location.
You can select to export information from all the catalog tables or separately for each of the items from the above list.
Command hvrcatalogimport loads the information from the supplied HVR catalog document into the HVR catalogs in the hub database.
The argument hubdb specifies the connection to the hub database. For more information about supported hub databases and the syntax for using this argument, see Calling HVR on the Command Line.
An HVR catalog document file can either be created using command hvrcatalogexport or it can be prepared manually, provided it conforms to the HVR catalog DTD.
Options
This section describes the options available for the commands hvrcatalogexport and hvrcatalogimport.
Parameter | Description |
---|---|
-cchn | Only export catalog information for channel chn. |
-C | Only export information from configuration action catalog hvr_config_action. |
-d | Only export information from channel definition catalogs hvr_channel, hvr_table, hvr_column, hvr_loc_group and hvr_action. |
-g | Only extract information from group membership catalog hvr_loc_group_member. |
-hclass | Location class of the hub database. Valid values for class are db2, db2i, ingres, mysql, oracle, postgresql, sqlserver, or teradata. For more information, see Calling HVR on the Command Line. |
-l | Only export information from location catalog hvr_location. |
-uuser[/pwd] | Connect to hub database using DBMS account user. For some databases (e.g. SQL Server) a password pwd must also be supplied. |
HVR Catalog DTD
HVR catalog documents are XML files that must conform to the HVR catalog Document Type Definition (DTD). A formal specification of this DTD can be found in file HVR_HOME/lib/hvr_catalog.dtd. Most XML tags in the DTD are directly equivalent to a table or row of the HVR Catalog Tables.
The root tag of the HVR catalog DTD is <hvr_catalog>. This root tag contains "table" tags named <hvr_channels>, <hvr_tables>, <hvr_columns>, <hvr_loc_groups>, <hvr_actions>, <hvr_locations>, <hvr_loc_group_members> and <hvr_config_actions>. Most table tags contain a special optional attribute chn_name. This special attribute controls the amount of data that is deleted and replaced as the HVR catalog document is loaded into the catalog tables. For example, a document that contains <hvr_actions chn_name="hvr_demo01"> would imply that only rows for channel hvr_demo01 should be deleted when the document is imported. If the special attribute chn_name is omitted then all rows for that catalog table are deleted.
Each table tag contains tags that correspond to rows in the catalog tables. These 'row' tags are named <hvr_channel>, <hvr_table>, <hvr_column>, <hvr_loc_group>, <hvr_action>, <hvr_location>, <hvr_loc_group_member> and <hvr_config_action>. Each of these row tags has an attribute for each column of the table. For example, tag <hvr_tables> could contain many <hvr_table> tags, which would each have attributes chn_name, tbl_name and tbl_base_name.
Some attributes of a row tag are optional. For example, if attribute col_key of <hvr_column> is omitted it defaults to 0 (false), and if attribute tbl_name of tag <hvr_action> is omitted then it defaults to '*' (affect all tables).
Example
<syntaxhighlight source lang="xml"> <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hvr_catalog SYSTEM "http://www.hvr-software.com/dtd/1.0/hvr_catalog.dtd"> <hvr_catalog version="1.0"> <hvr_channels chn_name="hvr_demo01"> <hvr_channel chn_name="hvr_demo01" chn_description="Simple reference channel."/> </hvr_channels> <hvr_tables chn_name="hvr_demo01"> <hvr_table chn_name="hvr_demo01" tbl_name="dm01_order" tbl_base_name="dm01_order"/> <hvr_table chn_name="hvr_demo01" tbl_name="dm01_product" tbl_base_name="dm01_product"/> </hvr_tables> <hvr_columns chn_name="hvr_demo01"> <hvr_column chn_name="hvr_demo01" tbl_name="dm01_order" col_sequence="1" col_name="prod_id" col_key="1" col_datatype="integer4"/> <hvr_column chn_name="hvr_demo01" tbl_name="dm01_order" col_sequence="2" col_name="ord_id" col_key="1" col_datatype="integer4"/> <hvr_column chn_name="hvr_demo01" tbl_name="dm01_order" col_sequence="3" col_name="cust_name" col_datatype="varchar" col_length="100"/> <hvr_column chn_name="hvr_demo01" tbl_name="dm01_order" col_sequence="4" col_name="cust_addr" col_datatype="varchar" col_length="100" col_nullable="1"/> <hvr_column chn_name="hvr_demo01" tbl_name="dm01_product" col_sequence="1" col_name="prod_id" col_key="1" col_datatype="integer4"/> <hvr_column chn_name="hvr_demo01" tbl_name="dm01_product" col_sequence="2" col_name="prod_price" col_datatype="float8"/> <hvr_column chn_name="hvr_demo01" tbl_name="dm01_product" col_sequence="3" col_name="prod_descrip" col_datatype="varchar" col_length="100"/> </hvr_columns> <hvr_loc_groups chn_name="hvr_demo01"> <hvr_loc_group chn_name="hvr_demo01" grp_name="CEN" grp_description="Headquarters"/> <hvr_loc_group chn_name="hvr_demo01" grp_name="DECEN" grp_description="Decentral"/> </hvr_loc_groups> <hvr_actions chn_name="hvr_demo01"> <hvr_action chn_name="hvr_demo01" grp_name="CEN" act_name="DbCapture"/> <hvr_action chn_name="hvr_demo01" grp_name="DECEN" act_name="DbIntegrate"/> </hvr_actions> </hvr_catalog> </syntaxhighlight>