diff --git a/docs/Users_Guide/load_data.rst b/docs/Users_Guide/load_data.rst index 4cb2fee..6d91606 100644 --- a/docs/Users_Guide/load_data.rst +++ b/docs/Users_Guide/load_data.rst @@ -1,36 +1,59 @@ -********** -Background -********** +*************** +Using METdbLoad +*************** The METdbLoad module provides support for inserting MET output data (as .stat files) into a relational database (mysql, mariadb, or aurora). + +Create Database +--------------- + Before using the METdbLoad module, the database **must** exist and have the proper permissions -(i.e. grant privileges to insert, delete, update, and index). Next, use *mv_mysql.sql* and the mysql command -line client (https://dev.mysql.com/doc/refman/en/mysql.html) to create the tables corresponding to the MET line types. -The *mv_mysql.sql* file is located in the METdataio/METdbLoad/sql/ directory. +(i.e. grant privileges to insert, delete, update, and index). -.. dropdown:: Create MET linetype tables - mysql -udbuser -pdbpasswd dbtable_name) as seen in the XML specification file are omitted for simplicity. Indentation is used to indicate hierarchical relationships between elements.* + *These are element names. The XML angle brackets (<>) as seen in the XML load specification file are omitted for simplicity. Indentation is used to indicate hierarchical relationships between elements.* .. dropdown:: load_spec @@ -356,7 +377,7 @@ expand). Remember to update the username and password that is applicable to your - any digits 0-9 - _, . , - (underscore, period, dash) - **Determine whether to use folder_tmpl or load_files to define where your input data resides (descriptions below):** + **Determine whether to use folder_tmpl or load_files to define where the input data resides (descriptions below):** *The following defines the location of the input data to be loaded into the database based on data organized by datetime (and/or any other criteria).* @@ -455,7 +476,7 @@ expand). Remember to update the username and password that is applicable to your - .. dropdown:: The "folder_dates" name attribute was assigned in the date_list portion of the XML specification file + .. dropdown:: The "folder_dates" name attribute was assigned in the date_list portion of the XML load specification file **** @@ -525,7 +546,7 @@ expand). Remember to update the username and password that is applicable to your - .. dropdown:: the "valid_dates" name attribute value was assigned in the date_list portion of the XML specification file + .. dropdown:: the "valid_dates" name attribute value was assigned in the date_list portion of the XML load specification file **** @@ -682,11 +703,17 @@ directory. The *path-to-METdataio-source* is the directory where the METdataio python met_db_load.py /path-to/load_specification.xml +If logging is desired, redirect output to a log file (via &> command): + +.. code-block:: ini + + python met_db_load.py /path-to/load_specification.xml &> log/your_logname.log & + - Replace *path-to-METdataio-source* to the location where the METdataio source code is saved. -- Replace the *path-to* with the location where the load_specification.xml XML specification file was saved. +- Replace the *path-to* with the location where the load_specification.xml XML load specification file was saved. Refer to the section **Create the XML Specification File** and expand the drop-down instructions -"The following is an explanation of the required and optional elements and any limitations" for details on what is expected in your XML specification file. +"The following is an explanation of the required and optional elements and any limitations" for details on what is expected in the XML load specification file. @@ -730,9 +757,9 @@ Troubleshooting * - Solution: - This error is typically encountered when one of the following conditions exist as a result of failing the XML validation step: - - the order of the elements in the XML specification file is inconsistent with the order expected - - the XML specification file is missing one or more mandatory elements + - the order of the elements in the XML load specification file is inconsistent with the order expected + - the XML load specification file is missing one or more mandatory elements - one or more elements has exceeded size limits specified in the XML schema - there are additional XML elements that are not expected - **Refer to the section **Create the XML Specification File** to verify that the XML specification file is correct.** + **Refer to the section **Create the XML Load Specification File** to verify that the XML load specification file is correct.**