GigaSpaces platform provides ability to persist objects into any RDBMS. This section specifies steps required to configure IBM DB2 7.2 to be used as the GigaSpaces persistent datastore.
Driver Information
Make sure that GigaSpaces uses the correct DB2 driver. The driver details are: 06/17/2002 07:34a 1,366,866 db2java.zip
Run the following bat file to configure DB2 to the correct driver:
"D:\Program Files\SQLLIB\java12\usejdbc2.bat"
The following steps involve creating new a Buffer Pool and two Table Spaces, which are required for a correct operation of DB2 with the GigaSpaces Platform.
This section describes actions to be taken when using IBM DB2 Control Center.
This guide assumes you have already created a database to be used by the GigaSpaces Platform. The actions to be taken using a database called GIGADB2 are demonstrated below.
It is highly recommended to perform all the following steps logged on to the database as the database administrator, and to later configure GigaSpaces DB2 storage adapter jdbc.properties with this user name.
Running IBM DB2 Control Center
To run IBM DB2 Control Center:
Click the Start Menu->IBM DB2->ControlCenter
The IBM DB2 Control Center main window is displayed:
Create New Buffer Pool
Create a new Buffer Pool with page size 32.
Right click the Buffer Pool folder under the database used for persisting GigaSpaces space objects.
Select Create:
The Buffer Pool Dialog box is displayed:
Type the Buffer Pool Name: GSBP.
In the Page Size list, select 32.
Click OK
Restart the Database
After creating the Buffer Pool, restart the database.
Right-Click the Database and select Restart.
Create Regular Table Space
Click the Table spaces folder under the database used for persisting GigaSpaces space objects.
Select Create->Table Space.
The Create Table Space dialog is displayed:
Type in GIGATS for the Table Space Name.
Make sure Regular is selected.
Click Advanced.
Select Page size 32.
Select Prefetch Size 32.
Select GSBP from the buffer pool list.
Click OK in the Advanced dialog box.
Click OK in the Create Table Space dialog.
Create System Temporary Table Space
Click the Table spaces folder under the database used for persisting GigaSpaces space objects.
Select Create->Table Space.
The Create Table Space dialog box is displayed:
Type in GIGASTS for the Table Space Name.
Under Type of table space, select System temporary.
Click Advanced.
Select Page size 32.
Select Prefetch Size 32.
Select GSBP from the buffer pool list.
Click OK in the Advanced dialog box.
Click OK in the Create Table Space dialog box
The Table Spaces list contains the following table spaces:
Increasing Log file Size
If you have a new database with default configuration values, you have to increase the database Log file Size.
Open ControlCenter->Instances->Databases.
Right-click the database name and choose Configure.
Click the Log File Size option on the Logs tab:
Increase the Log file Size value.
Click OK.
Creating Persistence Space with DB2 as the Backend Database
Configuring Storage Adapter for DB2
The Storage Adapter configuration file for DB2 is located at: <GigaSpaces Installation Directory>\GenericJDBCProperties\DB2Properties\jdbc.properties.
This file contains the following:
# driverClass - COM.ibm.db2.jdbc.net.DB2Driver for network connection
# COM.ibm.db2.jdbc.app.DB2Driver for local connection
driverClass=COM.ibm.db2.jdbc.net.DB2Driver
#driverClass=COM.ibm.db2.jdbc.app.DB2Driver
connectionUrl=jdbc:db2://host/dbname
#connectionUrl=jdbc:db2: dbname
userName=CA
password=password
#Result Set Type : F - Forward , I - Insensitive
rstype=F
Create Space
Open GigaSpaces Browser by running the following: <GigaSpaces Root>\bin\SpaceBrowser.bat for windows
Or: <GigaSpaces root>\bin\SpaceBrowser.sh for Unix/Linux
Select Container->Create Space.
The Create New Space dialog box is displayed:
Check the Persistent check box.
In the Storage Adapter Class list, select the following: com.j_spaces.sadapter.GenericJDBC.JDBCStorageAdapter.
In the Storage Adapter URL list, select the following: ${com.gs.home}/GenericJDBCProperties/DB2Properties
Click Create.
After having created Persistent Spaces with the GigaSpaces Space Browser or the command line utilities, you can see the created space tables.
Each space is assigned a unique ID. The Space data is stored in several tables. Some tables hold the GigaSpaces metadata information and other tables created on-the-fly for each class type stored in the space.
All tables associated with a specific space are assigned the same prefix that includes the String JSPACES + <Space Unique ID>.
Below is an example for created tables:
You can now start using the GigaSpaces Platform!
Wiki Content Tree
Your Feedback Needed!
We need your help to improve this wiki site. If you have any suggestions or corrections, write to us at techw@gigaspaces.com. Please provide a link to the wiki page you are referring to.
Add Comment