|
TABLE OF CONTENTS 1. Overview 2. Set up Environment 3. Build and Deploy 4. Post-Installation Configuration 5. Database Configuration 6. Troubleshooting |
5. Database Configuration5.1. Deploy DriversThe supported production-grade databases include MySQL 4.1.12+ (but MySQL 5.0 is not yet recommended for production - see the Database Configuration and Tuning section of the Sys Admin Guide) and Oracle 9i+.
The version of the JDBC driver (or connector) is also important: for MySQL a 3.1.12+ connector should be used, while for Oracle the 10g driver must be used, even if the database is Oracle 9i. These drivers should be copied into your $CATALINA_HOME/common/lib directory, and they are available from the official sites:
5.2. Create Database and UserA Sakai database and privileged user must be prepared for Sakai's use. Consult your database documentation for details, but below are sample commands for MySQL. C:\sakai\reference\sql\legacy\mysql\> mysql -u root -p Enter password: ****** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 51 to server version: 4.1.5-gamma-nt Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> create database sakai default character set utf8; Query OK, 1 row affected (0.00 sec) mysql> grant all on sakai.* to sakaiuser@'localhost' identified by 'sakaipassword'; Query OK, 0 rows affected (0.00 sec mysql> grant all on sakai.* to sakaiuser@'127.0.0.1' identified by 'sakaipassword'; Query OK, 0 rows affected (0.00 sec) mysql> quit Note that you will not need to create the database schema with its table structures, etc. A setting in sakai.properties allows it to create the necessary tables as Tomcat is starting up. See the section on database properties below.
5.3. Database PropertiesThere are settings in sakai.properties that also define the database technology and connection information. Appropriate sakai.properties settings for Oracle and MySQL, respectively, are listed below, and you need only modify them with your local particulars: MySQL: hibernate.dialect=org.hibernate.dialect.MySQLDialect vendor@org.sakaiproject.db.api.SqlService=mysql driverClassName@javax.sql.BaseDataSource=com.mysql.jdbc.Driver url@javax.sql.BaseDataSource=jdbc:mysql://SERVER:3306/DB?useUnicode=true&characterEncoding=UTF-8 username@javax.sql.BaseDataSource=USER password@javax.sql.BaseDataSource=PASSWORD validationQuery@javax.sql.BaseDataSource=show variables like 'version' defaultTransactionIsolationString@javax.sql.BaseDataSource=TRANSACTION_READ_COMMITTED Oracle: hibernate.dialect=org.hibernate.dialect.Oracle9Dialect vendor@org.sakaiproject.db.api.SqlService=oracle driverClassName@javax.sql.BaseDataSource=oracle.jdbc.driver.OracleDriver url@javax.sql.BaseDataSource=jdbc:oracle:thin:@SERVER:1521:DB username@javax.sql.BaseDataSource=USER password@javax.sql.BaseDataSource=PASSWORD validationQuery@javax.sql.BaseDataSource=select 1 from DUAL defaultTransactionIsolationString@javax.sql.BaseDataSource=TRANSACTION_READ_COMMITTED For a new installation you can have Sakai create its schema as Tomcat starts up (i.e. you don't need to create tables yourself) with the following setting in sakai.properties: auto.ddl=true Once the tables are created you should set this to false and restart. 5.4. Migrating from an Earlier VersionA database conversion is typically required between Sakai versions. Database conversion scripts - in distinct versions for MySQL and Oracle, respectively - are found in the reference/docs/conversion folder of the release or on subversion: In the same directory you'll also find conversion scripts for earlier Sakai versions. Migration from an earlier version will require the successive application of all intermediate scripts. You cannot, for example, move from 2.2.1 to 2.4.0 by applying a single script. You will need to move first from 2.2.1 to 2.3.1, and then from 2.3.1 to 2.4.0.
5.5. StartupOnce you've configured the database appropriately, you need only stop and restart Tomcat. As Tomcat is coming up you can watch its log to see if there are any database connection errors (see the Troubleshooting section).
|