Sun Java System Portal Server 7.1 Deployment Planning Guide

ProcedureTo Deploy High-Availability Database

Before You Begin

Install the Oracle 10g Release 2 database.

  1. Prepare the Oracle database.

    1. Create a database instance named portal. An example is, SID=portal.


      Note –

      To avoid ORA-27102 out of memory errors on Solaris 10, perform the following command: projadd -U oracle -K "project.max-shm-memory=(priv,4294967295B,deny)" user.oracle


    2. b. Log in to the Oracle Enterprise Manager as SYSTEM. The path is typically http://hostname:1158/em. (em stands for Enterprise Manager).

      or command line sqlplus /nolog CONNECT sys/password AS SYSDBA;

    3. Create a tablespace communitymc_portal-ID for example, communitymc_portal1.

      For example,


      SQL> CREATE TABLESPACE COMMUNITYMC_PORTAL1 LOGGING DATAFILE '
      /app/oracle/oradata/portal/communitymc_01.dbf' SIZE 400M REUSE AUTOEXTEND ON NEXT  
      1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL;
    4. Create a user account with the following values:

      Username: portal

      Password: portal

      Default Tablespace: communitymc_Portal—ID

      Assign roles: CONNECT and RESOURCE

      For example,


      SQL> create user portal identified by portal;
      
      SQL>alter user portal default tablespace  COMMUNITYMC_PORTAL1;
      
      SQL> grant connect,resource to portal;
  2. Prepare the web container for the new database.

    1. Locate the Oracle JDBC driver using one of the following methods. The file isojdbc14.jar.

      • Use the existing ojdbc14.jar file on the machine on which Oracle is installed. It is normally located in: $ORACLE_HOME/jdbc/lib/ojdbc14.jar.

      • Download the ojdbc14.jar file from the Oracle website. Verify that you download the version that is compatible with the your Oracle RDBMS.

    2. Add the JDBC driver to the JVM classpath.

      Add the JDBC driver (ojdbc14.jar) to the JVM classpath.

      For example,

      class-path-suffix...//opt/SUNWjavadb/lib/derbyclient.jar: /oracle/ojdbc14.jar...

    3. Add the following JVM option:

      -Djdbc.drivers=oracle.jdbc.OracleDriver.

      For example, in Web Server server.xml

      <jvm-options>-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver</jvm-options>

      <jvm-options>-Djdbc.drivers=oracle.jdbc.OracleDriver</jvm-options>


      Note –

      It is possible to remove the derby classfiles and options once all the portlets/applications that are using derby database jdbc resources have been converted to using oracle resources.


  3. Configure Community Membership and Configuration.

    1. Edit the communitymc database configuration file:

      vi Portal-data-dir/portals/Portal-ID/config/portal.dbadmin

      db.driver=oracle.jdbc.OracleDriver

      db.driver.classpath=JDBC-Driver-Path/ojdbc14.jar url=jdbc:oracle:thin:@Oracle-Host:Oracle-Port:portal

      For example, portal.dbadmin


      db.driver=oracle.jdbc.OracleDriver
      db.driver.classpath=/oracle/ojdbc14.jar
      community.db.user=portal
      community.db.password=portal
      community.db.url=jdbc:oracle:thin:@machine1.pstest.com:1521:portal
      portal.id=portal1
    2. Remove or comment out the following property from the communitymc configuration file.

      vi Portal-Data-Dir/portals/Portal-ID/config/communitymc.properties

      #javax.jdo.option.Mapping=derby

    3. Load the community schema onto Oracle by using the following commands:

      cd /var/opt/SUNWportal/portals/portal1/config

      /usr/sfw/bin/ant -f config.xml -D"portal.id=portal1" configure

    4. When finished check that tables have been created in oracle by typing the following:


      SQL> connect portal/portal
      Connected.
      SQL> select * from cat;
       
      TABLE_NAME                     TABLE_TYPE
      ------------------------------ -----------
      BIN$I3usV+V+I7HgRAgAIMbswQ==$0 TABLE
      JPOX_TABLES                    TABLE
      COMMUNITY                      TABLE
      COMMUNITY_USER                 TABLE
      COMMUNITY_DP                   TABLE
    5. Edit the communitymc JDBC resource to point to Oracle.

      1. Log in to the web container administration console.

      2. Locate the JDBC resource named jdbc/communitymc.

      3. Set the Datasource classname to oracle.jdbc.pool.OracleDataSource.

      4. Set following properties:

        • user: portal

        • password: portal

        • url: jdbc:oracle:thin:@Oracle-Host:Oracle-Port:portal


        <jdbc-resource>
            <jndi-name>jdbc/communitymc</jndi-name>
            <datasource-class>oracle.jdbc.pool.OracleDataSource</datasource-class>
            <idle-timeout>30</idle-timeout>
            <wait-timeout>10</wait-timeout>
            <property>
              <name>Password</name>
              <value>portal</value>
            </property>
            <property>
              <name>portNumber</name>
              <value>1521</value>
            </property>
            <property>
              <name>databaseName</name>
              <value>communitymc_portal1</value>
            </property>
            <property>
              <name>User</name>
              <value>portal</value>
            </property>
            <property>
              <name>serverName</name>
              <value>machine1.pstest.com</value>
              <description/>
            </property>
            <property>
              <name>url</name>
              <value>jdbc:oracle:thin:@machine1.pstest.com:1521:portal</value>
              <description/>
            </property>
          </jdbc-resource>

      Note –

      On some web containers, you might need to edit the JDBC Connection Pool instead of the JDBC resource.


  4. Configure and Install the Fileshare, Surveys, and Wiki Portlet Applications.

    1. Locate the portlet application:

      Portal-Data-Dir/portals/Portal-ID/portletapps/Portlet_Application

    2. Configure tokens_ora.properties.

      Each application located under /portals/portal1/portletapps/ has its own tokens_ora.properties file in addition to a tokens.properties file. The necessary oracle database access parameters need to be corrected in the tokens_ora.properties file to reflect the actual database connectivity.

    3. Create a JDBC Resource for each application using the values from the tokens_ora.properties file.

      • Resource JNDI Name: jdbc/OracleFilesharingDB. The value should match the DB-JNDI-NAME value in the tokens_ora.properties file.

      • Resource Type: javax.sql.DataSource.

      • Datasource Classname: oracle.jdbc.pool.OracleDataSource. The value should match DB-DATASOURCE value in the tokens_ora.properties file.

      • User: portalfs. The value should match the DB-USER value in the tokens_ora.properties file.

      • Password: portalfs. The value should match the DB_PASSWORD value in the tokens_ora.properties file.

      • URL: jdbc:oracle:thin:@oracle.acme.com:1521:portal. The value should match the DB-URL value in the tokens_ora.properties file.


      Note –

      On some web containers, you might need to define the JDBC Connection Pool connection pool prior to setting up the JDBC resource.


    4. Undeploy the existing portlets that use the Derby Database as the datastore.

      /opt/SUNWportal/bin/psadmin undeploy-portlet -u uid=amadmin,ou=people,dc=acme,dc=com -f Password-File -p Portal ID -g portlet

    5. Deploy the newly configured portlet.

      cd Portal-Data-Dir/portals/Portal-ID/portletapps/Portlet_Application

      /usr/sfw/bin/ant -D"portal.id=portal1" -Dapp.version=ora