## 2 Methodology
### Procedure for Loading the Monitoring Data into the Database  
Once the structure of the RDBMS system was designed, the next step was its development and the subsequent loading of information into the databases that constitute it. First, a common database must be created. The table structure of this database was done manually, directly working within the MariaDB administrator, adapting it to the needs that were found in the different PV installations to be analysed. Conversely, the structure of the individual databases was created following the procedure shown below. When a new PV plant is going to be analysed, the first step is to enter manually in the common database only the name of this new plant and its location, so that there is a record in the database of a new plant for which no information previously existed. The next step is to create an individual database for this new plant. The process was implemented in such a way that the creation of this individual database is automated, and its structure is generated according to the characteristics of the new plant. For this purpose, a script was generated to carry out the migration process of the files containing the data monitored in this plant. In this process, information about the set of elements that monitor information in the plant, inverters, string current metering devices and possible environmental sensors, is initially extracted from these files and, based on them, code in SQL language is automatically generated to create the physical model or table structure of the individual database, suitable for the data monitored by these elements to be stored in them. In addition, this process automatically transfers to the common database the identification codes of all the inverters and sensors that record information, and the set of parameters that are measured. Then, the migration process is interrupted, so that all the information corresponding to the elements of this installation is completed manually in the common database, making use of the manufacturers' specifications and the configuration of the plant modules associated with each inverter or string metering device, provided by the company that operates and maintains the plant. Once all this information is completed, the migration process continues, and now all the monitored data is automatically saved in the corresponding tables of the individual database that has been created. As indicated, free software resources were used for these developments, programming a series of Python scripts and using SQL language to work with the databases. The entire structure of tables, views and procedures of the individual databases was prepared by a Python function named _create_db_structure_ during the execution of the data migration process, where SQL files are created with everything necessary for its creation. To facilitate the migration process, a pure-Python MySQL client library named _pymysql_ was used with which an auxiliary class was created with a series of functions and properties that facilitate the interaction with the database implemented with MariaDB. In this way, functions were developed to check if a certain record is already included in the tables in order to avoid data duplication. In the case of migrating data of an installation from which monitored data is already stored in the individual database, the process is simplified, and only the last step is carried out, in which the new data is transferred to the tables of the individual database that had to be created previously. In order to carry out the data migration process described above, it is important to analyse the structure of the files generated in the monitoring of PV plants, which may vary from one inverter model to another. These files can have different formats, specifically, in this paper, both CSV and XML format files have been worked with. For each type, their structure is usually standardised, so it was possible to automate the reading and migration process.