Hvrcatalogexport, hvrcatalogimport

From HVR
Jump to: navigation, search
Previous: hvradapt
Next: hvrcompare
Command Reference


hvrcatalogexport – Export from hub database into HVR catalog document.
hvrcatalogimport – Import from HVR catalog document into hub database.


hvrcatalogexport [–cchn...] [–C] [–d] [–g] [–hclass] [–l] [–uuser] hubdb catdoc
hvrcatalogimport [–hclass] [–uuser] hubdb catdoc


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).

Command hvrcatalogimport loads the information from the supplied HVR catalog document into the HVR catalogs in the hub database.

The first argument hubdb specifies the connection to the hub database. This can be an Oracle, Ingres, SQL Server, DB2, DB2 for I, PostgreSQL or Teradata database depending on its form. See further section 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.


This section describes the options available for the commands hvrcatalogexport and hvrcatalogimport.

SC-Hvr-ExportCatalogs demo01.png
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 Specify hub database. Valid values are oracle, ingres, sqlserver, db2, db2i, postgresql, and teradata. See also section 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 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 (see also section 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).


<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_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_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_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_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"/>


Folder-icon.png HVR_HOME
├─ Folder-icon.png demo
└─ Folder-icon.png hvr_demo01
├─ hvr_demo01_def.xml Catalog document for channel definition.
├─ hvr_demo01_cnf_gm_example.xml Catalog document for group membership.
└─ hvr_demo01_cnf_loc_oracle_example.xml Catalog document for HVR locations.
└─ Folder-icon.png HVR_HOME
└─ hvr_catalog.dtd Catalog Document Type Definition.