*********************** Database Loading Module *********************** The database loading module is used to insert, update, and delete MET output data in the database. The tool is invoked using the mv_load.sh script. The usage statement: .. code-block:: none ---- MVLoad ---- Usage: mv_load load_spec_file [-index] where "load_spec_file" specifies the XML load specification document "-index" indicates that no data should be loaded, and only the indexing commands applied ---- MVLoad Done ---- The **load_spec_file** passes information about the MET output files to load into the database to the loading module. It is an XML file thats top-level tag is which contains the following elements, divided into functional sections: **:** Please reference the `Common XML Structures `_ documentation. **:** Please reference the `Common XML Structures `_ documentation. **:** **TRUE** or **FALSE**, this option indicates whether or not to load STAT data. Default: TRUE. **:** **TRUE** or **FALSE**, this option indicates whether or not to load MODE data. Default: TRUE. **:** **TRUE** or **FALSE**, this option indicates whether or not to load MODE TD data. Default: TRUE. **:** **TRUE** or **FALSE**, this option indicates whether or not to load matched pair data. Default: FALSE. **:** **TRUE** or **FALSE**, this option indicates whether or not to load observed rank data. Default: FALSE. **:** **TRUE** or **FALSE**, this option indicates whether or not to force load paths/files that are already present. Default: FALSE. **:** **TRUE** or **FALSE**, this option indicates the desired volume of output from the load module, with TRUE resulting in more information and FALSE resulting in less information. Default: FALSE. **:** An integer indicating the number of MET output file rows that are inserted with each INSERT statement. Default: 1. **:** **TRUE** or **FALSE**, this option indicates whether a database query check for stat header information should be performed - **WARNING:** enabling this feature could significantly increase load time. Default: TRUE. **NOTE:** **** has been removed; remove it from the XML load specification document. **:** **TRUE** or **FALSE**, this option indicates whether a database query check for MODE header information should be performed - **WARNING:** enabling this feature could significantly increase load time. Default: TRUE. **:** **TRUE** or **FALSE**, this option indicates whether a database query check for MODE TD header information should be performed - **WARNING:** enabling this feature could significantly increase load time. Default: TRUE. **:** **TRUE** or **FALSE**, this option indicates whether database indexes should be dropped prior to loading new data. Default: FALSE. **:** **TRUE** or **FALSE**, this option indicates whether database indexes should be created after loading new data. Default: TRUE. **:** The name of the group for the user interface. **:** The description of the database. | **:** A list structure containing individual MET output files to load into the database. | | **:** Contains a single MET output file to load. | **:** A template string describing the file structure of the input MET files, which is populated with values specified in the **** tag structure. | **:** A tree structure containing values used to populate the **** template. | | **:** A template value, its name is specified by the attribute name, and its values are specified by its children **** tags. | | **:** A single template value which will slot into the template in the value specified by the parent field's name. | | **:** Specifies a previously declared **** element, using the name attribute, which represents a list of dates in a particular format. **:** A list structure containing the MET output file line types to load. If omitted, all line types are loaded. **:** Contains a single MET output file line type to be loaded, for example, CNT. **:** If present, creates a record in the instance_info database database table with a note containing the body of this tag **: TRUE** or **FALSE**, this option indicates whether or not to save the load xml; only effective if **** is present - default: TRUE **Note** If is used, at least one of entry should be presented. For example, if the path is: .. code-block:: XML /path/to/data change it to .. code-block:: XML /path/to/{type} data Example ======= Here is a simple example: .. code-block:: XML kemosabe:3306 metvdb_hwt pgoldenb pgoldenb 2010051914V 06 3600 yyyyMMddHH'V' false 1 true false true Group name true true true false /d1/data/{model}/{vx_mask}/{valid_time} arw nmm FULL SWC In this example, the load module would attempt to load any files with the suffix .stat in the following folders. This list would end at the date specified by the named folder_dates. .. code-block:: none /d1/data/arw/FULL/2010051914V /d1/data/arw/SWC/2010051914V /d1/data/nmm/FULL/2010051914V /d1/data/nmm/SWC/2010051914V /d1/data/arw/FULL/2010051915V /d1/data/arw/SWC/2010051915V /d1/data/nmm/FULL/2010051915V /d1/data/nmm/SWC/2010051915V ... Troubleshooting =============== .. _test: .. list-table:: * - Error: - ** ERROR: Caught class com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry 'CT07-NMM-LIN-R2-0-2005-07-15 12:00:00-2005-07-15 12:00:00-0-2005' for key 2 * - Solution: - This error is caused by trying to insert a stat_header record into the database when an identical one already exists. If identical stat_header information is present in more than one stat file, set the value to true. This setting will reduce performance, because the stat_header table is checked for duplicate stat_header each time a row is inserted. However, if a stat_header row already exists in the table with the insert information, then the existing record will be used instead of trying to insert a dupilcate.