Configuring DB2 remotelyAdded by IBM on May 19, 2011 | Version 1 (Original)
|This topic describes the steps required to configure DB2® when it resides on a different machine than Lotus® Mashups.
This topic describes the steps required to configure DB2® when it resides on a different machine than Lotus® Mashups.
Before you begin
These instructions assume the following information:
- A remote DB2 server and DB2 Client are already installed and running. For information on installing DB2 Client, see the DB2 product documentation.
- You use DB2 Client to connect to a remote DB2 server, and that WebSphere Application Server, Lotus Mashups, and DB2 Client are installed on the same machine.
About this task
This task assumes that a remote database resides on a different machine than Lotus Mashups. To configure DB2 for Lotus Mashups remotely, you will create the database that will store information for Lotus Mashups, create the Lotus Mashups schemas and tables using scripts located in the Mashup Center installation's root directory, and create a data source to change the data-storage method from file-based persistence to the new database.
- Stop the Lotus Mashups server.
- To create a data source to change the data-storage method from file-based persistence to the new database, do the following steps:
Before completing this step, you can confirm that the Lotus Mashups plug-ins are using file-based persistence to store data by pointing your browser to http://localhost:9080/mum/osgi/persistence
. This will show you the default handler ID for each plug-in. At this point, the default ID should be the file system.
- In your file system, locate and open MashupCenter_install_root\Config\database_db2.properties.
- Modify the values in the PROPERTIES file to match your new database configuration, for example:
#DB2 parameters for task config-db2
#DB2 database user ID and password
db2user= your user name
db2userPassword= your password
#DB2 connection details
db2ServerName= your server name
db2PortNumber= your port number
#DB2 database details
db2DatabaseName= your database name
- Save and close the PROPERTIES file.
- In a command window, change to the MashupCenter_install_root\Config directory, and run the following command to tell Lotus Mashups to create a DB2 data source that points to the DB2 database specified in the PROPERTIES file: run config.bat action-create-db-mashup-db2.
- To create the database that will store information for Lotus Mashups, do the following steps:
- Open the DB2 command-line interface.
- From the command line, locate the MashupCenter_install_root\mm_profile\dbscripts\LotusMashups\DB2v9\database_name directory, and run createDatabase.sql.
- To create the Lotus Mashups schemas and tables, do the following steps:
This step assumes that you are working with a new database and are defining the Lotus Mashups resources for the first time. If you are recreating or updating an existing database, you will typically run dropTable.sql
to drop an existing set of tables and replace them with the current set. These two SQL files are located in the MashupCenter_install_root\mm_profile\dbscripts\LotusMashups\DB2v9\database_name
- Log in to the DB2 server machine as a user with sufficient database privileges.
- Initialize a DB2 command environment, and enter db2cmd.
- Use the DB2 Client to run the following three SQL files: createSchema.sql, createTablespace.sql, and createTable.sql. These SQL files are located in the MashupCenter_install_root\mm_profile\dbscripts\LotusMashups\DB2v9\database_name directory.
- Optional: To grant database privileges, run createGrant.sql. This SQL file is also located in the MashupCenter_install_root\mm_profile\dbscripts\LotusMashups\DB2v9\database_name directory.
- To confirm that everything is working as expected, do the following steps:
- Start the Lotus Mashups server.
- Open the WebSphere Application Server administrative console, and click Resources -> JDBC -> Data sources.
- Select the check box beside the new data source and test the connection.
- Now log back into Lotus Mashups. The first thing you should notice is that there is no welcome page. This is because Lotus Mashups is now pointing to the empty database that you created earlier and no longer the file system. You can also import the default welcome space. For more information, see Importing the default welcome space in a clustered server environment.
Parent topic: Configuring DB2 for Lotus Mashups