Creating a ALUI 6.1 Unix Oracle database.  
6/27/06

This procedure can be used to create a ALUI Oracle database in a Unix
(including Linux) environment.   The procedure generally follows OFA guidelines,
but modifications will likely be required to accomodate standards in
specific environments.

It is recommended that this procedure be used to create the ALUI database
instead of the Oracle installer facility, as it creates the database with the 
ALI-supported character set and national character set (UTF8/AL16UTF16).

ALUI 6.1 supports Oracle 9.2.x and Oracle 10g.  This procedure creates a 
database for a single disk install, but may easily be modified to distribute
files among multiple disks.

This procedure assumes that the ORACLE_SID of a 9.2 database is set to PLUM, 
or that 10g ORACLE_SID is set to PLUM10.  Given these settings, this procedure 
will populate the following directories.

Oracle 9.2.x

$ORACLE_BASE/admin/PLUM/plumtreescripts - contains portal scripts and a
sample version of initPLUM.ora.

$ORACLE_BASE/oradata/PLUM - will contain the Oracle database files associated
with the PLUM database.

$ORACLE_HOME/dbs - contains a symbolic link to initPLUM.ora.  

Oracle 10g

$ORACLE_BASE/admin/PLUM10/plumtreescripts - contains portal scripts and a
sample version of initPLUM10.ora.

$ORACLE_BASE/oradata/PLUM10 - contains the Oracle database files associated
with the PLUM10 database.

$ORACLE_HOME/dbs - contains a symbolic link to initPLUM10.ora.  

Prerequisites
=============

It is assumed that portal database scripts from the install CD have 
been copied from <INSTALL_DIR>/ptportal/6.0/sql/oracle_unix9.2 to the 
$ORACLE_BASE/admin/PLUM/plumtreescripts directory (Oracle 9i), or from
<INSTALL_DIR>/ptportal/6.0/sql/oracle_unix10 to the 
$ORACLE_BASE/admin/PLUM10/plumtreescripts directory (Oracle 10g), as described 
in the installation manual.   

If installing Oracle for the first time on a Unix machine, it may be
necessary to set up certain /etc/system values to avoid "out of memory"
and other errors.  See platform-specific Oracle documentation and ALUI 
Knowledge Base article 11068 for more information.

A database SID other than PLUM or PLUM10 may be used, but requires changes to the
following files:

 - initPLUM.ora or initPLUM10.ora
 - crdb1_oracle_unix.sql
 - crdb2_oracle_unix.sql
 - create_plumtree_tablespace_oracle_unix.sql
 - create_spfile_oracle_unix.sql.sql


1) Login as the Oracle UNIX user (created when Oracle was installed).  
It's important to do the install as this user, or else you will be plagued by 
permissions problems later.  

 
2) Set environment variables

a) ORACLE_BASE, for example as follows

   export ORACLE_BASE=/opt/oracle 

Note that the specific value for ORACLE_BASE may differ according to 
guidelines and procedures at each site.

b) Set the ORACLE_HOME environment variable according to the version and the
   install directory.  For example:

   for 9i 
    
       export ORACLE_HOME=$ORACLE_BASE/product/9.2
    
   or for 10g
    
       export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1


c) Add $ORACLE_HOME/bin to your PATH, e.g., 

   export PATH=$PATH:$ORACLE_HOME/bin

d) Set your ORACLE_SID 

   for 9i

   export ORACLE_SID=PLUM

   or, for 10g,

   export ORACLE_SID=PLUM10

3) Run the orapwd utility to create the Oracle sys password.  For example:

  Oracle 9i

  cd $ORACLE_HOME/bin
  ./orapwd file=$ORACLE_HOME/dbs/orapwPLUM password=<password>

  Oracle 10g

  cd $ORACLE_HOME/bin
  ./orapwd file=$ORACLE_HOME/dbs/orapwPLUM10 password=<password>

Certain BEA scripts may assume the password has been set to 'welcome' 

4) Modify initPLUM.ora or initPLUM10.ora as necessary for your installation.   See comments
in the file and in the BEA installation manual for more on this.  Default settings 
correspond to a 'small' installation.

5) Create a link to the appropriate init.ora in $ORACLE_HOME/dbs, thereeby allowing Oracle to 
find the file in its default location.

  Oracle 9i

  cd $ORACLE_HOME/dbs
  ln -s $ORACLE_BASE/admin/PLUM/plumtreescripts/initPLUM.ora

  Oracle 10g

  cd $ORACLE_HOME/dbs
  ln -s $ORACLE_BASE/admin/PLUM10/plumtreescripts/initPLUM10.ora

6) Create the database data directory.  For example:

  Oracle 9i

  mkdir $ORACLE_BASE/oradata/PLUM

  Oracle 10g

  mkdir $ORACLE_BASE/oradata/PLUM10

7) If this is re-creation of a database or a retry of a prior failed attempt,
delete the database files (ensure that the database is not running).  For example:

  rm $ORACLE_BASE/oradata/$ORACLE_SID/*.*

8) Examine crdb1_oracle_unix.sql for accuracy.  If the 'sys' password is not
set to 'welcome', the script will have to be changed.  After confirming the script
setup, run the script to create the database, for example as follows:


  cd $ORACLE_BASE/admin/$ORACLE_SID/plumtreescripts
  sqlplus /nolog 
  SQL> @crdb1_oracle_unix.sql

The script should generate no errors.   If errors are encountered, shut down
the database (sqlplus 'shutdown abort'), fix the problem and return to step 7.

9) Run crdb2_oracle_unix.sql as follows:

  cd $ORACLE_BASE/admin/$ORACLE_SID/plumtreescripts
  sqlplus /nolog 
  SQL> @crdb2_oracle_unix.sql
  
As above, it the 'sys' password is not set to 'welcome' the script will have to be 
changed.  The last part of this script (run_script_proc_oracle.sql) may generate
errors, but errors from the first parts of the script are not expected.

Upon completion of this script (which may take several minutes), the database has 
been created and is usable.

10) If desired, create an Oracle SPFILE in $ORACLE_HOME/dbs.  See Oracle 
documentation for the benefits of using an SPFILE.  For example:

  cd $ORACLE_BASE/admin/$ORACLE_SID/plumtreescripts
  sqlplus /nolog 
  SQL> @create_spfile_oracle_unix.sql

11) When logged in as the portal schema owner, run 'init_plumtree_db_oracle.sql'
to create portal tables, indexes and database procedures (substitute correct
username and password):

  cd $ORACLE_BASE/admin/$ORACLE_SID/plumtreescripts
  sqlplus username/password @init_plumtree_db_oracle.sql

12) Follow directions in the relevant install manual for the installation of other
ALUI product schemas and objects (collaboration server, content server, etc).

