Use MS SQL Server as your repository database (Archive installation)
This article includes the steps for using MS SQL Server as the host database for the Pentaho Server in an archive installation.
Before you begin
Prerequisites
Before you prepare your Pentaho Repository, prepare your environment:
Components
The Pentaho Repository resides on the database you installed during environment preparation.
It consists of these components:
Jackrabbit Contains the solution repository, examples, security data, and report content data.
Quartz Holds data related to scheduling reports and jobs.
Hibernate Holds data related to audit logging.
(Optional) Pentaho Operations Mart Reports on system usage and performance.
Initialize MS SQL Server Pentaho Repository database
The sections in this topic take you through the steps to initialize the MS SQL Server Pentaho Repository database.
To initialize MS SQL Server so it serves as the Pentaho Repository, run SQL scripts to create the Hibernate, Quartz, Jackrabbit (JCR), and Pentaho Operations Mart components.
CAUTION: Use the ASCII character set when you run these scripts. Do not use UTF-8. Text string length limitations can cause the scripts to fail.
CAUTION: If you have a different password or user, update the examples to match your configuration.
CAUTION: Pentaho 10.2.0.0 and earlier use the Quartz 1.x library, which uses a QRTZ5_ prefix in the database. Pentaho 10.2.0.1 and later use Quartz 2.x, which uses a QRTZ6_ prefix. When you upgrade from an earlier version, create the QRTZ6_ tables by repeating the Quartz database creation step. You can optionally migrate schedules with the migration script. Always back up your data before you proceed.
Important: If you do not complete the Quartz upgrade, Pentaho Server fails at startup. You will see a “Missing Quartz library database error” exception in catalina.log.
Step 1: Adjust MS SQL Server configuration settings
Configure these MS SQL Server settings in Microsoft SQL Server Management Studio (or a similar tool).
Select SQL Server and Windows Authentication Mode to use mixed authentication.
Enable TCP/IP for MS SQL Server.
Make sure MS SQL Server listens on an external IP, not localhost.
Step 2: Change default passwords
For production, follow best practices to change the default passwords in the SQL scripts.
Note: If you are evaluating Pentaho, you may want to skip this step.
Browse to the
<*your pentaho directory*>/pentaho-server/data/sqlserverfolder.Modify these create scripts as needed for your existing setup (user, password, database, and other required information):
create_jcr_sqlServer.sqlcreate_quartz_sqlServer.sqlcreate_repository_sqlServer.sqlpentaho_mart_sqlserver.sql
Save and close the files.
Step 3: Run SQL scripts
When upgrading from previous Pentaho versions (including 10.2.0.0 GA to 10.2.0.1 and later), manually initialize a new Quartz database. This creates a new Quartz library in the repository database. Back up your data before you proceed.
Run the SQL creation scripts.
Note: You may need administrator permissions to run these scripts on the host OS server.
Back up your data. See Back up your existing Pentaho products and install Pentaho 11.0.
If the Pentaho Server is running, stop it. For instructions, see Stop and start the Pentaho Server and repository.
Make sure your MS SQL Server instance is running.
Open a
sqlcmdutility window, or run these scripts from Microsoft SQL Server Management Studio, in this order:<*your pentaho directory*>/pentaho-server/data/sqlserver/create_jcr_sqlServer.sql<*your pentaho directory*>/pentaho-server/data/sqlserver/create_quartz_sqlServer.sql<*your pentaho directory*>/pentaho-server/data/sqlserver/create_repository_sqlServer.sql<*your pentaho directory*>/pentaho-server/data/sqlserver/pentaho_mart_sqlserver.sql
The Quartz database, Jackrabbit and MS SQL Server repositories, and Pentaho Operations Mart are created. The new Quartz scheduler table prefixed with
QRTZ6_is created. Any existingQRTZ5_scheduler database is retained. Starting the Pentaho Server at this point results in an empty schedule.If you want to retain your existing scheduler database, open the
migrate_old_quartz_data_sqlserver.sqlfile.Modify the migration script as needed for your existing setup (user, password, database, and other required information), then save it.
Run the migration script:
<*your pentaho directory*>/pentaho-server/data/sqlserver/migrate_old_quartz_data_sqlserver.sql
The original Quartz scheduler database is migrated to the new Quartz database.
Note: The original QRTZ5_ data is retained. You can delete it after you confirm migration is successful.
Note: You unpacked the Pentaho Operations Mart SQL file while preparing your environment. See Prepare your Windows environment for an archive install or Prepare your Linux environment for an archive install.
Step 4: Verify MS SQL Server initialization
Note: Unless you changed it in Step 1, the default password for each username below is password.
After you run the scripts, verify that the databases and user roles were created properly:
Open MS SQL Server Management Studio.
Log in as
hibuser.In Object Explorer, navigate to
hibernateand verify that you can see the tables.If you installed Pentaho Operations Mart, log in as
pentaho_operations_mart.In Object Explorer, navigate to
pentaho_operations_martand verify that you can see the tables.Log in as
jcr_user.In Object Explorer, navigate to
jackrabbitand verify that you can see the tables. The Jackrabbit tables may not appear until you start Pentaho for the first time.Log in as
pentaho_user.In Object Explorer, navigate to
quartzand verify that you can see the tables.Exit MS SQL Server Management Studio.
Configure MS SQL Server Pentaho Repository database
After you initialize your repository database, configure Quartz, Hibernate, Jackrabbit, and Pentaho Operations Mart for an MS SQL Server database.
By default, the examples in this section assume MS SQL Server running on port 1433. They also use the default password.
CAUTION: If you use a different port or password, update the examples to match your configuration.
Step 1: Set up Quartz on MS SQL Server
Event information, such as scheduled reports, is stored in the Quartz JobStore. During installation, indicate where the JobStore is located by modifying quartz.properties.
Open
pentaho/server/pentaho-server/pentaho-solutions/system/scheduler-plugin/quartz/quartz.properties.In the
#_replace_jobstore_propertiessection, setorg.quartz.jobStore.driverDelegateClass:Save the file.
Step 2: Set Hibernate settings for MS SQL Server
Modify the Hibernate settings file to specify where Pentaho should find the Pentaho Repository Hibernate configuration file.
Note: The Hibernate database is also where Pentaho Server stores the audit logs used as source data for Pentaho Operations Mart.
The files in this section are located in pentaho/server/pentaho-server/pentaho-solutions/system/hibernate.
Open
hibernate-settings.xml.Find the
<config-file>tags. Changepostgresql.hibernate.cfg.xmltosqlserver.hibernate.cfg.xml.From:
To:
Save and close the file.
Step 3: Replace default version of audit log file with MS SQL Server version
Since you are using MS SQL Server to host the Pentaho Repository, replace audit_sql.xml with the MS SQL Server version.
Locate
pentaho-solutions/system/dialects/sqlserver/audit_sql.xml.Copy it into the
pentaho-solutions/systemdirectory.
Step 4: Modify Jackrabbit repository information for MS SQL Server
Edit repository.xml to change the default Jackrabbit repository to MS SQL Server.
Navigate to
pentaho/server/pentaho-server/pentaho-solutions/system/jackrabbit.Open
repository.xml.Locate and verify or change the configuration so that the MS SQL Server lines are uncommented, and the MySQL, Oracle, and PostgreSQL lines are commented out.
Item
Code Section
Repository
DataStore
Workspaces
PersistenceManager (1st part)
Versioning
PersistenceManager (2nd part)
DatabaseJournal
Perform Tomcat-specific connection tasks
After your repository is configured, configure your web application server to connect to the Pentaho Repository.
In this step, you make JDBC and JNDI connections to the Hibernate, Jackrabbit, and Quartz components.
Note: By default, Pentaho Server is configured to be deployed and run on Tomcat. Connections are already specified. Modify Tomcat context.xml only if you changed the default ports or passwords.
Step 1: Download driver and apply to the Pentaho Server
To connect to a database (including the Pentaho Repository database), download and copy a JDBC driver to the Pentaho Server and the web application server.
Note: Due to licensing restrictions, Pentaho cannot redistribute some third-party database drivers. You must download and install the file yourself.
Download a JDBC driver
.jarfrom your database vendor or a third-party driver developer. See JDBC drivers reference.Copy the JDBC driver
.jartopentaho/server/pentaho-server/tomcat/lib.Copy
hsqldb-2.3.2.jartopentaho-server/tomcat/libif you want to retain the Pentaho sample data.
Step 2: Modify JDBC connection information in the Tomcat XML file
Database connection and network information (such as user name, password, driver class, host, and port) is stored in context.xml. Modify it to match your environment.
CAUTION: If you use a different user name, password, or port, update the examples to match your environment.
Consult your database documentation to determine the JDBC class name and connection string for your Pentaho Repository database.
Navigate to
server/pentaho-server/tomcat/webapps/pentaho/META-INF.Open
context.xml.Add the following resources if they do not already exist:
Note: Depending on your MS SQL Server configuration, you may be able to set
trustServerCertificate=true. See Connecting with encryption.Modify user names, passwords, driver class information, host, and port to match your environment.
Comment out any resource references that refer to other databases.
Verify your database validation query is set to
validationQuery="select 1".Save and close
context.xml.
Start your server
After you complete the archive installation steps, start Pentaho Server.
See Starting the Pentaho Server after an archive installation.
Last updated
Was this helpful?

