Java DB is used as a default database for Portal Server. This section explains how to replace Java DB with the Oracle database. Using this, you can ensure high availability and scalability. This procedure is divided into the following tasks:
Setting Up General Requirements
Preparing Oracle
Prepare the Database.
Establish appropriate privileges for the user accounts.
Configure Community Membership and Configuration.
Load the schema onto the database.
Edit the jdbc/communitymc JDBC resource to point to the new database.
On some of the web containers, you might need to edit the corresponding JDBC connection pool instead of the JDBC resource.
Configure and install portlet applications.
Locate the portlet applications.
portal-data-dir/portals/portal-id/portletapps |
Configure portlet applications to use the new database by editing tokens_xxx.properties.
Using the administration console or command-line tool provided by the web container, create a JDBC resource for the application using the values from the tokens_xxx.properties.
jdbc/DB_JNDI_NAME
javax.sql.DataSource
DB_DATASOURCEA
DB_USERU
DB_PASSWORDS
DB_URL
Some of the web containers might require you to set up a connection pool prior to setting up the JDBC resource.
Undeploy existing portlets that use the Java DB Database as a datastore.
Deploy the newly configured portlet applications.
Prepare Oracle.
Install Oracle 10g Release 2.
Create a database instance named portal (the SID is portal).
Log in to Oracle Enterprise Manager (http://hostname:5500/em) as SYSTEM.
Create a tablespace communitymc_portal-id for example, communitymc_portal1.
For Wiki, FileSharing, and Surveys portlets, the tablespace and user accounts are created during the deployment of the Oracle configured portlet.
Create a user account with the following information:
portal
portal
communitymc_portal-id
CONNECT and RESOURCE
Prepare the web container for the New Database
Locate the Oracle JDBC driver ojdbc14.jar.
$ORACLE_HOME/jdbc/lib/ojdbc14.jar
Alternatively, you can download the JDBC driver from the Oracle web site. Ensure that you download the version that is compatible with the Oracle RDBMS you use.
Using the administration console or the CLI, add the JDBC driver ojdbc14.jar to the JVM classpath by adding the following JVM option: -Djdbc.drivers=oracle.jdbc.OracleDriver
For Web Server 7.0:
Log in to Web Server 7 administrator console.
Click the Configuration tab and select the respective configuration.
Click the java tab and add the location of the ojdbc14.jar to the classpath suffix.
Click the JVM Settings tab.
Replace any existing -Djdbc.drivers entry as below:
-Djdbc.drivers=oracle.jdbc.OracleDriver
If the -Djdbc.drivers entry does not exit, add the following:
-Djdbc.drivers=oracle.jdbc.OracleDriver
Click Save.
Click Deploy Pending and deploy the changes.
For Application Server 8.2
Log in to Application Server administrator console.
Click Configurations > server-config (Admin Config) > JVM Settings > Path Settings > Path Settings.
Add the location of the ojdbc14.jar to the classpath suffix.
Click the JVM Settings tab.
Replace any existing -Djdbc.drivers entry as below:
-Djdbc.drivers=oracle.jdbc.OracleDriver
If the -Djdbc.drivers entry does not exit, add the following:
-Djdbc.drivers=oracle.jdbc.OracleDriver
Click Save.
Configure Community Membership and Configuration.
Edit the communitymc file 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 |
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 |
Load community schema onto the Oracle database.
% cd portal-data-dir/portals/portal-id/config % ant -Dportal.id=portal-id -f config.xml configure |
Edit the JDBC and communitymc JDBC resource to point to Oracle.
For Web Server 7.0
Log in to the Web Server administration console.
Click the Configuration tab and select the respective configuration.
Click the java tab > Resources and add a new JDBC resource.
Click jdbc/communitymc and edit the Datasource Class Name.
Set the Datasource classname to oracle.jdbc.pool.OracleDataSource
Set the following properties: user: portal and password: portal.
Delete the following derby properties: Database Name, Port Number, and Server Name.
Add the following property: url: jdbc:oracle:thin:@oracle-host:oracle-port:portal
Click Save.
Click Deploy Pending and deploy the changes.
For Application Server
Log in to the Application Server administration console.
Click Resources > JDBC > Connection Pools > communitymcPool
Set the Datasource classname to oracle.jdbc.pool.OracleDataSource
Set the following properties: user: portal and password: portal.
Delete the following derby properties: Database Name, Port Number, and Server Name.
Add the following property: url: jdbc:oracle:thin:@oracle-host:oracle-port:portal
Click Save.
Configure and install Portlet applications.
Run the filesharing script.
portal-data-dir/portals/portal-id/portletapps/filesharing |
Configure tokens_ora.properties to load information when initially loading the schema.
$ORACLE_HOME/jdbc/lib/ojdbc14.jar
OracleFileSharingDB
jdbc:oracle:thin:@<ORACLE_ HOST>:<ORACLE_PORT>:portal
<ORACLE_SYSTEM_USER>
<ORACLE_SYSTEM_PASSWORD>
jdbc:oracle:thin:@<ORACLE_ HOST>:<ORACLE_PORT>:portal
portalfs
portalfs
$ORACLE_HOME/jdbc/lib/ojdbc14.jar
Filesharingdb_<PORTAL_ID>
filesharingdb_<PORTAL_ID>
100M
Using the administration console or the command-line tool provided by the web container, create the JDBC resource using the values from the tokens_ora.properties.
For Web Server 7.0:
Create a JDBC Resource with the following properties:
jdbc/OracleFilesharingDB
This value must match DB_JNDI_NAME in tokens_ora.properties.
oracle.jdbc.pool.OracleDataSource
This value must match DB_DATASOURCE in tokens_ora.properties.
portalfs
This value must match DB_USER in tokens_ora.properties.
portalfs
This value must match DB_PASSWORD in tokens_ora.properties.
jdbc:oracle:thin:@<ORACLE_ HOST>:<ORACLE_PORT>:portal
This value must match DB_URL in tokens_ora.properties.
For Application Server:
Create a new connection pool with the following properties:
OracleFilesharingDBPool
This value must match DB_JNDI_NAME in tokens_ora.properties.
javax.sql.DataSource
oracle.jdbc.pool.OracleDataSource
This value must match DB_DATASOURCE in tokens_ora.properties.
In the Properties list, delete all the default properties and add the following:
portalfs
This value must match DB_USER in tokens_ora.properties.
portalfs
This value must match DB_PASSWORD in tokens_ora.properties.
jdbc:oracle:thin:@<ORACLE_ HOST>:<ORACLE_PORT>:portal
This value must match DB_URL in tokens_ora.properties.
Create a JDBC resource with the following value:
jdbc/OracleFilesharingDB
This value must match DB_JNDI_NAME in tokens_ora.properties.
OracleFilesharingDBPool
This value must match the pool that is created in the previous step.
Add the available target to the Selected list. Click OK.
Undeploy existing portlets that use Java DB Database as a datastore.
/opt/SUNWportal/bin/psadmin undeploy-portlet -u \ uid=amadmin,ou=people,dc=acme,dc=com -f password-file \ -p portal-id -i portal-instance-id |
Deploy the newly configured file sharing portlet.
cd portal-data-dir/portals/portal-id/portletapps/filesharing ant -Dapp.version=ora |
This ant command performs several tasks including regenerating the war image, loading up the schema onto the database, and deploying the newly built portlet. If the ant command fails and you want to unload schema, use the following command:
ant -Dapp.version=ora unconfig_backend
During deployment provide the Access Manager administrator password.
If the ant -Dapp.version=ora command fails with the following error, “Error: Password file does not exist or is not readable,” run ant deploy from command line to deploy the portlet.
Repeat this procedure for the other portlet applications, such as Surveys and Wiki.