![]() |
|||||||||||||||||||||||||||||||
|
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 6 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 7 Figure 3: Database CRX_CRX has been created 8 Figure 4: Create New User – step 1 8 Figure 5: Create New User – step 2 9 Figure 6: Create New User – step 3 9 Figure 7: Create New User – step 4 10 Figure 8: Open Query Window 11 Figure 9: Execute script dbcreate-tables.sql 12 Figure 10: Verify creation of tables, views, and indexes 13
List of Listings
1 About this BookThis book describes how to setup an openCRX database instance for MS SQL Server 2005. 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 MS SQL Server 2005. The book assumes that you are familiar with the installation and configuration of MS SQL Server 2005. 1.3 Tips, Warnings, etc.We make use the following pictograms:
2 PrerequisitesAs a first step you must ensure that you have a working installation of MS SQL Server(please refer to the appropriate documentation from Microsoft for installation details).
As an alternative to the full version of MS SQL Server 2005 you can also download and install the Express Edition (free, but with some limitations):
You also need the openCRX distribution for MS SQL Server (this distribution works for both MS SQL Server 2000 and MS SQL Server 2005):
As a next step you must install MS SQL 2005 (please refer to the appropriate documentation from Microsoft for installation details). This document assumes that you use the Microsoft SQL Server Management Studio Express for database administration. 3 Upgrading from previous versionsIf you already have MS SQL for openCRX installed, upgrade the database as explained in this chapter. 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 2.0.0, for example, and you want to upgrade to version 2.1.0 you have to run the script upgrade-from-2.0.0-to-2.1.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 2.0.0, for example, and you want to upgrade to version 2.1.0 you have to run the script upgrade-from-2.0.0-to-2.1.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 2.0.0, for example, and you want to drop tables not used by openCRX 2.1.0 you can run the script drop-from-2.0.0-to-2.1.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 2.0.0, for example, and you want to upgrade to openCRX 2.1.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 2.0.0, for example, and you want to upgrade to openCRX 2.1.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 Microsoft SQL Server Management Studio. Start the Management Studio and navigate to the appropriate instance and select Databases. Right-click and select New Database from the pop-up menu as shown below:
Figure 1: Create a new database
Enter CRX_CRX as database name:
Figure 2: Create schema CRX_CRX Click OK to create the database:
Figure 3: Database CRX_CRX has been created
Next we need to create a new user. Navigate to Security and right-click to bring up the pop-up menu. Select New Login as shown below:
Figure 4: Create New User – step 1
Complete the New Login Dialog as shown below and then click OK:
Figure 5: Create New User – step 2
Next you navigate back to the Database CRX_CRX and navigate to the subentry Security | Users. Right-click Users to bring up the pop-up menu and select the entry New User as shown below:
Figure 6: Create New User – step 3 Complete the New User Dialog as shown below and then click OK:
Figure 7: Create New User – step 4
Please note that the password of this user are managed by the SQL Server.
You have completed creating the database CRX_CRX. 5 Install the openCRX Database Schema ObjectsAfter creating the database 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 the entry New Query from the pop-up menu to open a query window:
Figure 8: Open Query Window
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:
All 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 2008 ©
CRIXP Corp. All rights reserved. |
||||||||||||||||||||||||||||||