Unsupported content

 

This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

Configuring the repository to use an external database

By default, the repository contains an embedded database. You can enable high availability for the repository by configuring the repository to use an external database and leveraging the clustering features of the external database to provide failover.

Use the procedures in this topic to configure the following databases as external databases for the repository:

Before you begin

Note

For advanced database configuration information, refer to the documentation for your database type.

To configure the repository to use a MySQL database

  1. Create an external database:
    1. In the external database, set the max_allowed_packet variable to a value between 512 MB and 1 GB.
      For information about how to set this variable, see the product documentation for your database.
    2. Set up the database user:
      • Create the user and user password.
      • Set up read and write permissions for the user.
    3. In the external database, create a new database (for example, repository), using the credentials created in step 1b.
  2. Extract the contents of the repository .war file into a new baorepo directory:
    1. Under the repoInstallationDirectory/tomcat/webapps/ directory, create the baorepo subdirectory.
    2. In the baorepo subdirectory, unzip the repoInstallationDirectory/tomcat/webapps/baorepo.war file.
  3. Place the database's connector/driver jar file in the repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/lib directory.
    Example:
    You could place the mysql-connector-java-5.1.10-bin.jar file in the repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/lib directory.
  4. Open the repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/classes/META-INF/repository.xml file in a text editor and replace the existing PersistenceManagersection with the connection information for the external database.

    Note

    The repository.xml file typically contains two PersistenceManager sections. Modify the first section, located under workspace. Do not change the section under Versioning.

    MySQL database connection properties for PersistenceManager

    Parameter

    Description

    MySQL values

    class

    org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager

    driver

    <MySQLDriver>

    URL

    URL and port number for the external database
    You can omit the port number if you use the default port for the database.

    jdbc:mysql://host:port/database

    user

    Database user name that you created in step 1

    userName

    password

    Password that you assigned to the database user

    password

    schema

    mysql

    schemaObjectPrefix

    ${wsp.name}

    externalBLOBs

    false



    Persistence Manager for MySQL
    <PersistenceManager class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
    <param name="driver" value="MySQLDriver"/>
    <param name="url" value="jdbc:mysql://bao.bmc.com/repository" />
    <param name="user" value="baouser"/>
    <param name="password" value="baopass"/>
    <param name="schema" value="mysql"/>
    <param name="schemaObjectPrefix" value="${wsp.name}"/>
    <param name="externalBLOBs" value="false"/>
    </PersistenceManager>
  5. Start the repository server.

    Note

    If you want to update any configuration values after the repository server is started, you must update the repository.xml file located at the repoInstallationDirectory/config directory and restart the repository server.

To configure the repository to use an Oracle database

  1. Create an external database:
    1. Set up the database user:
      • Create the user and user password.
      • Set up read and write permissions for the user. Permissions must include:
        • CREATE SESSION
        • CREATE TABLE
        • CREATE SEQUENCE
    2. In the external database, create a new database (for example, repository), using the credentials created in Step 1a.
  2. Extract the contents of the repository .war file into a new baorepo directory:
    1. Under the repoInstallationDirectory/tomcat/webapps/ directory, create the baorepo subdirectory.
    2. In the baorepo subdirectory, unzip the repoInstallationDirectory/tomcat/webapps/baorepo.war file.
  3. Place the database's connector/driver jar file in the repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/lib directory.
    Example:
    You would place the ojdbc-1.4.jar file in repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/lib directory.
  4. Open the repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/classes/META-INF/repository.xml file in a text editor and replace the existing PersistenceManagersection with the connection information for the external database.

    Note

    The repository.xml file typically contains two PersistenceManager sections. Modify the first section, located under workspace. Do not change the section under Versioning.

    Oracle database connection properties for PersistenceManager

    Parameter

    Description

    Values

    class

    org.apache.jackrabbit.core.persistence.db
    .OraclePersistenceManager

    driverJDBC driver class name

    <oracle.jdbc.OracleDriver>

    URL

    URL and port number for the external database
    You can omit the port number if you use the default port for the database.

    jdbc:oracle:thin:@host:port:sid

    user

    Database user name that you created in step 1

    userName

    password

    Password that you assigned to the database user

    password

    schema

    oracle

    schemaObjectPrefix

    ${wsp.name}

    externalBLOBs

    false

    Persistence Manager for Oracle
    <PersistenceManager class="org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager">
    <param name="url" value="jdbc:oracle:thin:@bao.bmc.com:1521:repository"/>
    <param name="driver" value="oracle.jdbc.OracleDriver"/>
    <param name="user" value="baouser"/>
    <param name="password" value="baopass"/>
    <param name="schema" value="oracle"/>
    <param name="schemaObjectPrefix" value="${wsp.name}"/>
    <param name="externalBLOBs" value="false"/>
    </PersistenceManager>
    
  5. Start the repository server.

    Note

    If you want to update any configuration values after the repository server is started, you must update the repository.xml file located at the repoInstallationDirectory/config directory and restart the repository server.

To configure the repository to use a DB2 Express-C 10.1 edition database

  1. Create an external database:
    1. Set up the database user:
      • Create the user and user password.
      • Set up read and write permissions for the user. Permissions must include:
        • CREATE SESSION
        • CREATE TABLE
        • CREATE SEQUENCE
    2. In the external database, create a new database (for example, repository), using the credentials created in Step 1a.
  2. Extract the contents of the repository .war file into a new baorepo directory:
    1. Under the repoInstallationDirectory/tomcat/webapps/ directory, create the baorepo subdirectory.
    2. In the baorepo subdirectory, unzip the repoInstallationDirectory/tomcat/webapps/baorepo.war file.
  3. Place the database's connector/driver jar file in the directory repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/lib directory.
    Example:
    You could place the DB2Driver.jar file in the repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/lib directory.
  4. Open the repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/classes/META-INF/repository.xml file in a text editor and replace the existing PersistenceManagersection with the connection information for the external database.

    Note

    The repository.xml file typically contains two PersistenceManager sections. Modify the first section, located under workspace. Do not change the section under Versioning.

    DB2 database connection properties for PersistenceManager

    Parameter

    Description

    DB2 values

    class

    org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager

    driver

    <DB2Driver>

    URL

    URL and port number for the external database
    You can omit the port number if you use the default port for the database.

    jdbc:db2://host:port/database

    user

    Database user name that you created in step 1

    userName

    password

    Password that you assigned to the database user

    password

    schema

    db2

    schemaObjectPrefix

    ${wsp.name}

    externalBLOBs

    false

    Persistence Manager for DB2
    <PersistenceManager class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
    <param name="driver" value="DB2Driver"/>
    <param name="url" value="jdbc:oracle:thin:@bao.bmc.com:1521:repository" />
    <param name="user" value="baouser"/>
    <param name="password" value="baopass"/>
    <param name="schema" value="db2"/>
    <param name="schemaObjectPrefix" value="${wsp.name}"/>
    <param name="externalBLOBs" value="false"/>
    </PersistenceManager>
    
  5. Start the repository server.

    Note

    If you want to update any configuration values after the repository server is started, you must update the repository.xml file located at the repoInstallationDirectory/config directory and restart the repository server.

To configure the repository to use a Microsoft SQL Server 2012 database

  1. Create an external database:
    1. Set up the database user:
      • Create the user and user password.
      • Set up read and write permissions for the user. Permissions must include:
        • CREATE SESSION
        • CREATE TABLE
        • CREATE SEQUENCE
    2. In the external database, create a new database (for example, repository), using the credentials created in Step 1a.
  2. Extract the contents of the repository .war file into a new baorepo directory:
    1. Under the repoInstallationDirectory/tomcat/webapps/ directory, create the baorepo subdirectory.
    2. In the baorepo subdirectory, unzip the repoInstallationDirectory/tomcat/webapps/baorepo.war file.
  3. Place the database's connector/driver jar file in the directory repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/lib directory.
    Example:
    You could place the sqljdbc.jar file in the repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/lib directory.
  4. Open the repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/classes/META-INF/repository.xml file in a text editor and replace the existing PersistenceManagersection with the connection information for the external database.

    Note

    The repository.xml file typically contains two PersistenceManager sections. Modify the first section, located under workspace. Do not change the section under Versioning.

    Microsoft SQL Server 2012 database connection properties for PersistenceManager

    Parameter

    Description

    Values

    class

    org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager

    driver

    com.microsoft.sqlserver.jdbc.SQLServerDriver

    URL

    URL and port number for the external database
    You can omit the port number if you use the default port for the database.

    jdbc:sqlserver://host:port;database

    user

    Database user name that you created in step 1

    userName

    password

    Password that you assigned to the database user

    password

    schema

    mssql

    schemaObjectPrefix

    ${wsp.name}

    externalBLOBs

    false

    Persistence Manager for Microsoft SQL Server 2012
    <PersistenceManager class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
    <param name="driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
    <param name="url" value="jdbc:sqlserver://vw-aus-rem-qa17.bmc.com:1433;databaseName=repository"/>
    <param name="user" value="baouser"/>
    <param name="password" value="baopass"/>
    <param name="schema" value="mssql"/>
    <param name="schemaObjectPrefix" value="${wsp.name}"/>
    <param name="externalBLOBs" value="false"/>
    </PersistenceManager>
  5. Start the repository server.

Notes

  • After it starts, the repository server caches its external database information in its local directory/workspace (repoInstallationDirectory/repository). To change the repository's external database information (to point it to a different user or database), you must delete the repository's workspace (delete the repoInstallationDirectory/repository folder) and restart the repository. Cluster the external database to provide high-availability for the repository.
  • If you want to update any configuration values after the repository server is started, you must update the repository.xml file located at the repoInstallationDirectory/config directory and restart the repository server.

Related topic

User permissions

Was this page helpful? Yes No Submitting... Thank you

Comments

  1. Nacho Capdepon

    Hello, how about Oracle RAC. Which are the appropriate settings? ç

    it would be very good to have them documented here as well.

    Mar 25, 2014 07:40
  2. Shweta Hardikar

    Hello Ignacio,

    We are checking and will update the document as early as possible.

    Mar 25, 2014 07:45
  3. Terry Bootsma

    I've opened a support ticket and Oracle RAC is not supported. 

    Apr 09, 2014 10:17
  4. Prasenjit Mitra

    Hello,

    BAO repository.xml configuration require SQL ID and password for authentication.
    In order to use Windows domain account and password to authenticate with SQL Server, please add the parameter "integratedSecurity=true" to the "url" value in the PersistenceManager settings in repository.xml.  You can also changed the "user" and "password" values to "dummy" so that it isn't stored as unencrypted values in repository.xml file.

    The final url will look like:
    jdbc:sqlserver://servername.domain.com:port;integratedSecurity=true;

    When true, the current Windows account credentials are used for authentication. When false, User ID and Password specified in the connection are used.

    Finally modify the BAO-REPO service to run under the appropriate domain account.

    I think it will be very useful to update the documentation to include the above information.

    Jul 02, 2014 08:17
    1. Dorothy Poole

      The team will verify this information. I've created defect BAO-262 to track this and will update the page when I have verification from the team.

      Dec 18, 2014 08:36
  5. Shweta Hardikar

    Thanks for the information Prasenjit.

    We will include it in the documentation as early as possible. 

    Sep 08, 2014 03:08
  6. Rodrigo Arratia

    It seems that jdbc driver supports Oracle RAC, but I haven't tested. Could anyone from QA team validate the info?

    I found a URL that could be used to connect to an Oracle RAC:

    jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=OFF)(FAILOVER=ON) (ADDRESS=(PROTOCOL=TCP)(HOST=tst-db1.myco.com)(PORT=1604)) (ADDRESS=(PROTOCOL=TCP)(HOST=tst-db2.myco.com)(PORT=1604))) (CONNECT_DATA=SERVICE_NAME=mydb1.myco.com)(SERVER=DEDICATED)))

    Found the info in this webpage: http://stackoverflow.com/questions/1646630/jdbc-what-is-the-correct-jdbc-url-to-connect-to-a-rac-database

    Jan 13, 2015 04:47
    1. Dorothy Poole

      Hi Rodrigo,

      Thank you for your comments. We currently have a defect (BAO-262) assigned to a team member to investigate another comment on this page and I am adding your request to that defect, so that this information is researched. I'll update the page when I get information from the team.

      Jan 13, 2015 06:21
  7. Joshua Skirde

    Hi BMC,

    Kind regards,

    Joshua

    Mar 30, 2015 09:54
    1. Dorothy Poole

       Thank you for your comments. I have updated the link, repoInstallationDirectory references and table column title. I am investigating the rest with the team and will update the page when I have confirmation.

      Mar 31, 2015 06:47
    1. Dorothy Poole

      Thank you again for your comments. In addition to the updates mentioned in my last comment, after consulting with the development team, I've updated the following:

      • The driver in the MS SQL section updated to "com.microsoft.sqlserver.jdbc.SQLServerDriver" 
      • Each instance of step 2b instructs users to unzip the war file instead of using jar.
      • The example MS SQL remains the same as the development team felt it was correct. We added a note to instruct users to consult their database documentation for advanced configuration instructions.

       

      Mar 31, 2015 12:46
      1. Joshua Skirde

        Thanks Dorothy.

        Apr 01, 2015 03:29
  8. Mdakram Shaikh

    for the oracle DB configuration, the driver param is not there in the list can you please add this

    Jul 26, 2018 05:54
    1. Mdakram Shaikh

      the value we have used is "oracle.jdbc.OracleDriver"

      Jul 26, 2018 07:33
  9. Shweta Hardikar

    Thanks for the comment, Mdakram. Let me work with the team and update the docs.

    I've incorporated the changes, Mdakram.


    Jul 26, 2018 08:01