![]() |
|||||||||||||||||
|
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 the schema CRX 8 Figure 3: Create user, tablespace 9 Figure 4: Install Database Schema Objects 11
List of Listings Listing 1: Shell variables 9 Listing 2: Strip Null lines from DDL scripts 10
1 About this BookThis book describes how to setup an openCRX database instance for Oracle. 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 Oracle. The book assumes that you are familiar with Oracle 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:
Please ensure that you install the correct JDBC driver (i.e. matching JDK, Oracle version, etc.) and one JDBC driver only! Ignoring this wisdom leads to problems as the connection to the database will fail. As a next step you must install Oracle. The Oracle documentation explains in detail how to install the database. This document assumes that you use the Oracle dbca tool and the Sql*Plus for database administration. The JDBC driver is required for the application server installation. 3 Upgrading from previous versionsIf you already have Oracle 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 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-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 databaseAn existing database may be utilized, or alternatively you may create a new database. A new database instance may be created with the Oracle Database Configuration Assistant (dbca). The following snapshots are taken from a windows installation, but the procedure is identical for all supported platforms. It is assumed the base oracle installation directory (Oracle Home) is "c:/oracle". Start dbca as the Oracle owner account and Create a new "General Purpose" database as shown below:
Figure 1: Create a new database
Enter CRX as database name as shown below:
Figure 2: Create the schema CRX
Continue through the screens, tuning the database parameters as required (the defaults will work in most simple deployments). Finally, select Create Database and select Finish in Step 7.
Next you must create a database user, tablespaces and grant this user access to the newly created database. Ensure your shell environment is setup with the following variables: Listing 1: Shell variables ORACLE_SID=CRX Launch a terminal and execute command sequence as demonstrated below:
Figure 3: Create user, tablespace
Of course Oracle Enterprise Manager, Toad and various other 3rd party tools will achieve the equivalent goal, but rarely with the same speed and control if you are not scared of a command line. You are now done creating the database and database schema. 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:
Listing 2: Strip Null lines from DDL scripts $ cat dbcreate-tables.sql |
Start Oracle Sql*Plus, and login as opencrx_user, password opencrx_user. Copy/paste the database script dbcreate-tables.sql (or dbcreate-tables-nonulllines.sql if you stripped Null lines) and execute it as shown below: Figure 4: Install Database Schema Objects
Similarly, execute the remaining scripts:
The scripts should run without errors. 6 Next StepsIf you have completed successfully the database installation you are ready to use the openCRX database. 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 2005 Magootech and 2006 © CRIXP Corp. All rights reserved. |
||||||||||||||||