Overview

Database

Overview

PAMGuard stores data from many modules in a database. The database not only stores detector output, but also detector configuration and settings so that it will effectively form a single document at the end of the cruise, detailing how PAMGuard was set up and what was detected.

Adding a database module

From the File>Add Modules>Utilities menu select ‘Database’ to add a database to your configuration.

Configuring the database

PAMGuard can use either MySQL or SQLite databases. Support for Microsoft Access databases has been removed with the upgrade from Java 7 to Java 8. See here for information on how to convert old Access databases to one of the supported formats.

The setup for each databases type is slightly different, but operation and integration into the rest of PAMGuard is the same.

To configure the database, go to the File>Database Selection… menu to open the Database Selection dialog. At the top of the dialog, select either MySQL, Microsoft Access or OpenOffice from the drop down list. Then refer to specific instructions for each database type below.

Configure an SQLite database

Configure a MySQL database

Configure a Microsoft Access database

Choosing a database system

Which database system you use is largely a matter of personal choice.

An excellent article on the advantages and disadvantages of SQLite and MySQL is available here.

Basically, SQLite is a single file database (rather like MS Access) which can easily be backed up and copied between machines just like any other data file. MySQL is a server based database which is much harder to move between computers but can better handle multiple users accessing the same data simultaneously. So if you’re in the field collecting data on a laptop, you’re almost definitely better off with SQLite. On the other hand, if you have the technical know how and want a managed database system back at the lab, you might consider MySQL as a solution.

The latest PAMGuard versions contain excellent facilities for moving data between different database systems.

Adding tables to the database

PAMGuard will automatically add the necessary tables to your database.

If a new detector module is added to PAMGuard at any point, the database module is notified and will add the additional tables required.

If a module is removed and a table is no longer needed, that table will be left in the database unaltered.

Should the definition of a table change due to the new release of a module which outputs additional information, any additional columns required will be automatically added to existing tables.

Other alterations

You may add other tables and queries to the database without affecting PAMGuard operation. Additional tables will be ignored by PAMGuard.

You can even add additional columns to tables which are used by PAMGuard and these additional columns will also be ignored.

However, you should not change the format of any existing columns and do not create relationships between tables which may not always be satisfied or PAMGuard may be unable to write data to the database.