Create or Upgrade Perfmon4j SQL Database - FollettSchoolSolutions/perfmon4j GitHub Wiki
For the SQLAppender Perfmon4j uses Liquibase to maintain (creations/update) the tables in a SQL database.
This database has been tested on Microsoft SQL Server, however every effort has been made to use generic SQL and it should run on MySQL, Postgres, or any other database supported by Liquibase.
To Create a Database
- Create an empty database and a user that has create/update/delete schema access.
- Continue to the update steps
To Update an Existing Database
There are 2 artifacts created in the perfmon4j-dbupgrade project:
Artifact name | Description |
---|---|
perfmonm4j-dbupgrade-*.jar | The Classes |
perfmonm4j-dbupgrade-*.run.jar | The Fat Jar with Classes and dependencies. |
To execute dbcreate/upgrade
- Use the run.jar version (this is a fat jar containing additional dependencies).
- Run the .run.jar executable jar using the specified command line.
Example
java -jar perfmon4j-dbupgrader.run.jar driverJarFile=.\lib\sqljdbc4.jar driverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver jdbcURL=jdbc:sqlserver://localhost;DatabaseName=perfmon4j userName=perfmon4j password=mypassword
Command Line Options
Option | Description | Required | Notes |
---|---|---|---|
driverJarFile | Location of jar file containing the JDBC Driver | Yes | |
driverClass | Fully qualified class name of the jdbc driver | Yes | |
jdbcURL | JDBC url as specified by the chosen jdbc driver | Yes | |
userName | The SQL user name | Yes | User must have permissions to create schema objects in the specified database |
password | The SQL user's password | Yes | |
sqlOutputScript | If specified a SQL script will be created that can be used to apply the updates to the database later | No | Example: sqlOutputScript=./updateScript.sql |