Use Oracle as your repository database (Manual installation)
This article includes the steps for installing Oracle as the host database for the Pentaho Server in a manual installation of Pentaho.
Before you begin
Before you prepare your Pentaho Repository, you must prepare either a Windows or Linux environment.
The Pentaho Repository resides on the database that you installed during the Windows or Linux environment preparation step, and consists of the following components:
Jackrabbit
Contains the solution repository, examples, security data, and content data from reports that you use Pentaho software to create.
Quartz
Holds data that is related to scheduling reports and jobs.
Hibernate
Holds data that is related to audit logging.
(Optional) Pentaho Operations Mart
To report on system usage and performance.
Initialize Oracle Pentaho Repository database
To initialize Oracle so that it serves as the Pentaho Repository, you will need to run several SQL scripts to create the Hibernate, Quartz, Jackrabbit (JCR), and Pentaho Operations Mart components.
The sections in this article take you through the steps to initialize the Oracle Pentaho Repository database.
Step 1: Change default passwords
Procedure
Browse to the pentaho/server/pentaho-server/data/oracle10g/ directory.
Use any text editor to change the passwords in these SQL scripts:
- create_jcr_ora.sql
- create_quartz_ora.sql
- create_repository_ora.sql
- pentaho_mart_oracle.sql
Step 2: Run SQL scripts
Run the SQL scripts in the table below.
Run these scripts from the Command Prompt window or from a terminal window that runs SQL*Plus.
Action | SQL Script |
Create Quartz | > start <your filepath>/create_quartz_ora.sql |
Create Hibernate repository | > start <your filepath>/create_repository_ora.sql |
Create Jackrabbit | > start <your filepath>/create_jcr_ora.sql |
Create Pentaho Operations mart | > start <your filepath>/pentaho_mart_oracle.sql |
Step 3: Verify Oracle initialization
After you run the scripts, perform the following steps to verify that databases and user roles have been created:
Procedure
Open the Terminal or Command Prompt window that is running SQL*Plus.
Make sure that users have been created by running: SELECT USERNAME FROM DBA_USERS
If your databases do not appear, go to the beginning of these instructions and try running the scripts again.
Exit from SQL*Plus.
Configure Oracle Pentaho Repository database
Now that you have initialized your repository database, you will need to configure Quartz, Hibernate, Jackrabbit, and Pentaho Operations Mart for an Oracle database.
By default, the examples in this section are for a Oracle database that runs on port 1521. The default password is also in these examples.
Step 1: Set up Quartz on Oracle
Event information, such as scheduled reports, is stored in the Quartz JobStore. During the installation process, you must indicate where the JobStore is located by modifying the quartz.properties file.
Open the pentaho/server/pentaho-server/pentaho-solutions/system/quartz/quartz.properties file in any text editor.
Locate the #_replace_jobstore_properties section and set the org.quartz.jobStore.driverDelegateClass as shown:
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
Locate the # Configure Datasources section and set the org.quartz.dataSource.myDS.jndiURL equal to Quartz, as shown:
org.quartz.dataSource.myDS.jndiURL = Quartz
Save the file and close the text editor.
Step 2: Set Hibernate settings for Oracle
The files in this section are located in the pentaho/server/pentaho-server/pentaho-solutions/system/hibernate directory.
Perform the following steps to specify where Pentaho can find the Hibernate configuration file.
Procedure
Open the hibernate-settings.xml file in a text editor. Find the <config-file> tags and change postgresql.hibernate.cfg.xml to oracle10g.hibernate.cfg.xml as shown.
From:
<config-file>system/hibernate/postgresql.hibernate.cfg.xml</config-file>
To:
<config-file>system/hibernate/oracle10g.hibernate.cfg.xml</config-file>
Save and close the file.
Step 3: Replace default version of audit log file with Oracle version
Since you are using Oracle to host the Pentaho Repository, you need to replace the audit_sql.xml file with one that is configured for Oracle.
Procedure
Locate the pentaho-solutions/system/dialects/oracle10g/audit_sql.xml file.
Copy it into the pentaho-solutions/system directory.
Step 4: Modify Jackrabbit repository information for Oracle
Procedure
Navigate to the pentaho/server/pentaho-server/pentaho-solutions/system/jackrabbit and open the repository.xml file with any text editor.
As shown in the table below, locate and verify or change the code so that the Oracle lines are not commented out, but the MySQL, PostgreSQL, and MS SQL Server lines are commented out.
Item Code Section Repository <FileSystem class="org.apache.jackrabbit.core.fs.db.OracleFileSystem"> <param name="driver" value="javax.naming.InitialContext"/> <param name="url" value="java:comp/env/jdbc/jackrabbit"/> <param name="schemaObjectPrefix" value="fs_repos_"/> <param name="tablespace" value="pentaho_tablespace"/> </FileSystem>
DataStore <DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore"> <param name="driver" value="javax.naming.InitialContext"/> <param name="url" value="java:comp/env/jdbc/jackrabbit"/> <param name="databaseType" value="oracle"/> <param name="minRecordLength" value="1024"/> <param name="maxConnections" value="3"/> <param name="copyWhenReading" value="true"/> <param name="tablePrefix" value=""/> <param name="schemaObjectPrefix" value="ds_repos_"/> </DataStore>
Workspaces <FileSystem class="org.apache.jackrabbit.core.fs.db.OracleFileSystem"> <param name="driver" value="javax.naming.InitialContext"/> <param name="url" value="java:comp/env/jdbc/jackrabbit"/> <param name="schemaObjectPrefix" value="fs_ws_"/> <param name="tablespace" value="pentaho_tablespace"/> </FileSystem>
PersistenceManager (1st part) <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.OraclePersistenceManager"> <param name="driver" value="javax.naming.InitialContext"/> <param name="url" value="java:comp/env/jdbc/jackrabbit"/> <param name="schema" value="oracle"/> <param name="schemaObjectPrefix" value="${wsp.name}_pm_ws_"/> <param name="tablespace" value="pentaho_tablespace"/> </PersistenceManager>
Versioning <FileSystem class="org.apache.jackrabbit.core.fs.db.OracleFileSystem"> <param name="driver" value="javax.naming.InitialContext"/> <param name="url" value="java:comp/env/jdbc/jackrabbit"/> <param name="schemaObjectPrefix" value="fs_ver_"/> <param name="tablespace" value="pentaho_tablespace"/> </FileSystem>
PersistenceManager (2nd part) <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.OraclePersistenceManager"> <param name="driver" value="javax.naming.InitialContext"/> <param name="url" value="java:comp/env/jdbc/jackrabbit"/> <param name="schema" value="oracle"/> <param name="schemaObjectPrefix" value="pm_ver_"/> <param name="tablespace" value="pentaho_tablespace"/> </PersistenceManager>
DatabaseJournal <Journal class="org.apache.jackrabbit.core.journal.OracleDatabaseJournal"> <param name="revision" value="${rep.home}/revision.log" /> <param name="driver" value="javax.naming.InitialContext"/> <param name="url" value="java:comp/env/jdbc/jackrabbit"/> <param name="schema" value="oracle"/> <param name="schemaObjectPrefix" value="J_C_"/> <param name="janitorEnabled" value="true"/> <param name="janitorSleep" value="86400"/> <param name="janitorFirstRunHourOfDay" value="3"/> </Journal>
Using JBoss
Perform Tomcat-specific connection tasks
After your repository has been configured, you must configure the web application servers to connect to the Pentaho Repository. In this step, you will make JDBC and JNDI connections to the Hibernate, Jackrabbit, and Quartz components.
The next couple of sections guide you through the process of working with the JDBC drivers and connection information for Tomcat.
Step 1: Download driver and apply to the Pentaho Server
Procedure
Download a JDBC Driver JAR from your database vendor or a third-party driver developer.
Copy the JDBC driver JAR you just downloaded to the pentaho/server/pentaho-server/tomcat/lib folder.
Copy the hsqldb-2.3.2.jar file to pentaho-server/tomcat/lib if you want to retain the sample provided by Pentaho.
Step 2: Modify JDBC Connection Information in the Tomcat context.xml File
If you have chosen to use an Pentaho Repository database other than Oracle, you also need to modify the values for the validationQuery parameters in this file.
Procedure
Consult your database documentation to determine the JDBC class name and connection string for yourPentaho Repository database.
Navigate to the pentaho-server/tomcat/webapps folder and use a ZIP extraction utility (such as 7-Zip, Winzip, or Archive) to view the contents of the pentaho.war file.
Open the context.xml file with any text editor.
Add the following code to the file if it does not already exist and replace
XE
in the URL setting to reflect the name of your schema.<Resource name="jdbc/Hibernate" auth="Container" type="javax.sql.DataSource" factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory" maxActive="20" minIdle="0" maxIdle="5" initialSize="0" maxWait="10000" username="hibuser" password="password" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@localhost:1521/XE" validationQuery="select 1 from dual" jdbcInterceptors="ConnectionState" defaultAutoCommit="true"/> <Resource name="jdbc/Audit" auth="Container" type="javax.sql.DataSource" factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory" maxActive="20" minIdle="0" maxIdle="5" initialSize="0" maxWait="10000" username="hibuser" password="password" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@localhost:1521/XE" validationQuery="select 1 from dual"/> <Resource name="jdbc/Quartz" auth="Container" type="javax.sql.DataSource" factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory" maxActive="20" minIdle="0" maxIdle="5" initialSize="0" maxWait="10000" username="quartz" password="password" testOnBorrow="true" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@localhost:1521/XE" validationQuery="select 1 from dual"/> <Resource name="jdbc/PDI_Operations_Mart" auth="Container" type="javax.sql.DataSource" factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory" maxActive="20" minIdle="0" maxIdle="5" initialSize="0" maxWait="10000" username="pentaho_operations_mart" password="password" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@localhost:1521/XE" validationQuery="select 1 from dual"/> <Resource name="jdbc/pentaho_operations_mart" auth="Container" type="javax.sql.DataSource" factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory" maxActive="20" minIdle="0" maxIdle="5" initialSize="0" maxWait="10000" username="pentaho_operations_mart" password="password" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@localhost:1521/XE" validationQuery="select 1 from dual"/> <Resource name="jdbc/live_logging_info" auth="Container" type="javax.sql.DataSource" factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory" maxActive="20" minIdle="0" maxIdle="5" initialSize="0" maxWait="10000" username="pentaho_dilogs" password="password" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@localhost:1521/XE" validationQuery="select 1 from dual"/> <Resource name="jdbc/SampleData" auth="Container" type="javax.sql.DataSource" factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory" maxActive="20" minIdle="0" maxIdle="5" initialSize="0" maxWait="10000" username="pentaho_user" password="password" driverClassName="org.hsqldb.jdbcDriver" url="jdbc:hsqldb:hsql://localhost/sampledata" validationQuery="select 1 from dual"/> <Resource name="jdbc/SampleDataAdmin" auth="Container" type="javax.sql.DataSource" factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory" maxActive="20" minIdle="0" maxIdle="5" initialSize="0" maxWait="10000" username="pentaho_admin" password="password" driverClassName="org.hsqldb.jdbcDriver" url="jdbc:hsqldb:hsql://localhost/sampledata" validationQuery="select 1 from dual"/> <Resource name="jdbc/jackrabbit" auth="Container" type="javax.sql.DataSource" factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory" maxActive="20" minIdle="0" maxIdle="5" initialSize="0" maxWait="10000" username="jcr_user" password="password" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@localhost:1521/XE" validationQuery="select 1 from dual"/>
Modify the username, password, driver class information, IP address (or domain name), and port numbers so they reflect the correct values for your environment.
Verify that the validationQuery parameter for your database is set to the following: validationQuery="select 1 from dual"
Save the context.xml file, then close it.
Next steps
After installing the database that will host the Pentaho Repository, the next step depends on which type of web application server you are using, either JBoss or Tomcat.
- If you are using the JBoss web application server, follow the procedures in the article Prepare JBOSS connections and web app servers.
- If you are using the Tomcat web application server, follow the procedures in the article Configure and start the Pentaho Server after manual installation.