![]() |
|||||||||||||||||||||||
|
Version
Table of Contents 1.2 What do you need to understand this book 3 3 Upgrading from previous versions 5 3.1 The SQL Script upgrade-from-... 5 3.2 The SQL Script migrate-from-... 5 3.3 The SQL Script drop-from-... 5 3.4 The SQL Script dbcreate-views.sql 5 3.5 The SQL Script dbcreate-indexes.sql 6
List of Figures Figure 1: Create a new database 7 Figure 2: Create schema CRX_CRX 8 Figure 3: Specify Storage options 8 Figure 4: Specify Region options 9 Figure 5: Verify settings 10 Figure 6: Create New User – step 1 10 Figure 7: Create New User – step 2 11 Figure 8: Open Command Editor 12 Figure 9: Execute script dbcreate-tables.sql 13 Figure 10: Verify creation of tables, views, and indexes 14
List of Listings Listing 1: Creating Buffer Pools and Table Spaces with 32K Page Size 11
1 About this BookThis book describes how to setup an openCRX database instance for IBM DB2. 1.1 Who this book is forThe intended audience are openCRX database administrators. 1.2 What do you need to understand this bookThis book describes the installation of openCRX for IBM DB2. The book assumes that you are familiar with DB2 installation and configuration. 1.3 Tips, Warnings, etc.We make use the following pictograms:
2 PrerequisitesAs a first step you must download the following software packages:
As a next step you must install IBM DB2 (please refer to the appropriate documentation from IBM for installation details). This document assumes that you use the DB2 Control Center for database administration. 3 Upgrading from previous versionsIf you already have DB2 for openCRX installed, upgrade the database as explained below. You can then skip the rest of this document. 3.1 The SQL Script upgrade-from-...In a first step you must upgrade your database. openCRX distributions provide an SQL script of the form upgrade-from-<version from>-to-<version to>.sql If you have installed openCRX 1.9.1, for example, and you want to upgrade to version 1.10.0 you have to run the script upgrade-from-1.9.1-to-1.10.0.sql on your database instance. 3.2 The SQL Script migrate-from-...In a second step you must migrate your database. openCRX distributions often times provide an SQL script of the form migrate-from-<version from>-to-<version to>.sql If you have installed openCRX 1.9.1, for example, and you want to upgrade to version 1.10.0 you have to run the script upgrade-from-1.9.1-to-1.10.0.sql on your database instance. 3.3 The SQL Script drop-from-...Next you can drop unused tables from your database. openCRX distributions often times provide an SQL script of the form drop-from-<version from>-to-<version to>.sql If you have installed openCRX 1.9.1, for example, and you want to drop tables not used by openCRX 1.10.0 you can run the script drop-from-1.9.1-to-1.10.0.sql on your database instance. Alternatively, you can also rename such tables, e.g. from transition_type to _unused_transition_type. Also, it goes without saying that you should never drop a table before you made a backup! 3.4 The SQL Script dbcreate-views.sqlMost new openCRX versions make use of new/changed views, i.e. if an openCRX distribution includes an SQL script of the form dbcreate-views.sql then you must run that script. If you have installed openCRX 1.9.1, for example, and you want to upgrade to openCRX 1.10.0 you should run the script dbcreate-views.sql on your database instance. Make sure that old views are indeed dropped and new views properly created. 3.5 The SQL Script dbcreate-indexes.sqlMost new openCRX versions make use of new/changed indexes, i.e. if an openCRX distribution includes an SQL script of the form dbcreate-indexes.sql then you should run that script. If you have installed openCRX 1.9.1, for example, and you want to upgrade to openCRX 1.10.0 you should run the script dbcreate-indexes.sql on your database instance. 3.6 Populate PreferencesThe last step involves deleting old preferences and populating the table with new ones. Run the SQL script populate-preferences.sql to do this. 4 Create the databaseAs a first step you must create the database. This can be done with the DB2 Control Center. Start the Control Center and navigate to the appropriate instance and select Databases. Right-click and select Create Database from the pop-up menu as shown below:
Figure 1: Create a new database
Enter CRX_CRX as database name and select 32K as page size (experienced DB2 DBAs might want to create multiple table spaces for optimization reasons). Click Next:
Figure 2: Create schema CRX_CRX Specify storage options (if any) and click Next:
Figure 3: Specify Storage options Specify Region options (we strongly recommend the UTF-8 code set):
Figure 4: Specify Region options
Verify the settings and then click Finish:
Figure 5: Verify settings
Next we need to create a new user. Navigate to the newly created database and look for the entry User and Group Objects. Right-click the subentry DB Users and then select Add from the pop-up menu as shown below:
Figure 6: Create New User – step 1
Enter SYSTEM and select the appropriate authorities (the user must be able to connect to the database!):
Figure 7: Create New User – step 2 Please note that passwords are managed by the operation system.
You have completed creating the database CRX_CRX. 5 Install the openCRX Database Schema ObjectsAfter creating the schema you are now ready to install the openCRX database schema objects. The following scripts must be executed:
Navigate to the newly created database. Right-click on it and then select Query from the pop-up menu to open a command editor as shown below:
Figure 8: Open Command Editor
Copy/paste the database script dbcreate-tables.sql and execute by clicking on the button Execute: Figure 9: Execute script dbcreate-tables.sql
Similarly, execute the remaining scripts in the following order:
The scripts should run without errors and after execution you should be able to inspect all the newly created tables, views, and indexes:
Figure 10: Verify creation of tables, views, and indexes 6 Next StepsIf you have completed successfully the database installation you are ready to use the openCRX database CRX_CRX. The application server installation guides explain how to connect the application server to the openCRX database instance. License
The contents of this file are
subject to a BSD license (the "License"); you may not use
this file except in compliance with the License. You may obtain a
copy of the License at http://
Copyright 2006 ©
CRIXP Corp. All rights reserved. |
||||||||||||||||||||||