Creating a ALUI 6.0 NT Oracle database.
6/27/06

This procedure can be used to create a ALUI Oracle database on Windows.

ALUI 6.1 supports Oracle 9.2.x and 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 ALUI database is
set to PLUM, or that the ORACLE_SID of a 10g database is set to PLUM10.
Given these settings, the following directories are populated.

Oracle 9.2.x

%ORACLE_BASE%\admin\PLUM\plumtreescripts - contains plumtree scripts and a
sample version of initPLUM.ora.

%ORACLE_BASE%\oradata\PLUM - contains the Oracle database files associated
with the PLUM database.

%ORACLE_HOME%\database - contains a copy of initPLUM.ora.  

Oracle 10.1.x

%ORACLE_BASE%\admin\PLUM10\plumtreescripts - contains plumtree 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 copy of initPLUM10.ora.  

Prerequisites

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

A database SID other than PLUM may be used, but requires changes to:
 - initPLUM.ora or initPLUM10 (for Oracle 10g)
 - crdb1_oracle_nt.sql
 - crdb2_oracle_nt.sql
 - create_plumtree_tablespace_oracle_nt.sql
 - RegisterSIDPLUM.reg (or RegisterSIDPLUM10.reg)
 - CreateService.bat
 - create_spfile_oracle_nt.sql

Database Creation Procedure

If a failure occurs in any of these steps, use the Oracle database assistant
to delete the database and restart th sequence from the beginning.

1) If not set already, set the ORACLE BASE, ORACLE_HOME and ORACLE_SID environment variables,  
   for example as follows:

   For Oracle 9i

     set ORACLE_BASE = c:\oracle
     set ORACLE_HOME =c:\oracle\ora92
     set ORACLE_SID = PLUM

   For Oracle 10g

     set ORACLE_BASE = c:\oracle
     set ORACLE_HOME = C:\oracle\product\10.2.0\db_1
     set ORACLE_SID = PLUM10
     
   Note: This document assumes that ORACLE_SID, ORACLE_BASE and ORACLE_HOME are set
   to values appropriate for the creation of an Oracle database.  In a multi-
   homed environment, or when multiple Oracle products are installed, the
   ORACLE_BASE and ORACLE_HOME values used here may not correspond to those
   in the NT registry, or to those employed when running a specific Oracle
   product.   In some circumstances it may be necessary to modify ALUI-supplied
   scripts described in this note to replace ORACLE_BASE and ORACLE_HOME references 
   with hard-code references to the correct paths.   See Oracle documentation regarding 
   "Multiple Oracle Homes and Optimal Flexible Architecture" for more on this subject.

   Furthermore, Oracle versions differ on standard values for ORACLE_BASE.  This procedure
   uses the topmost (non-version specific) root of the directory heirarchy (c:\oracle above),
   but specific standards may differ. 

2) If necessary, edit and then run RegisterSIDPLUM.reg (oracle 9i) or 
   RegisterSIDPLUM10.reg (oracle 10g).  This registers the specified ORACLE_SID as 
   the default Oracle instance.

3) Modify initPLUM.ora (or initPLUM10.ora) as necessary for your installation and 
   copy it into the %ORACLE_HOME%\database folder (9i), or %ORACLE_HOME%\dbs folder (10g).

4) Edit createservice.bat (which runs oradim and sets ORACLE_SID) to verify correctness,
   and then run the script and note results. This script sets the Oracle 'sys' password.  

   For Oracle 9i

     createservice PLUM
                     
   For Oracle 10g
                     
     createservice PLUM10
   
   Verify that 'OracleServicePLUM' service (or, for 10g, OracleServicePLUM10) is running.
   If not, check the createservice.bat script and try again.  In some circumstances it
   may be necessary to hard-code paths in createservice.bat that are in the script
   specified via environment variables.

5) If the ORADIM executed in step (4) changed the 'sys' password to something
   other than 'welcome', and if you are not running as member of the windows Oracle
   DBA group, change the username and password in the appropriate places in 
   crdb1_oracle_nt.sql and crdb2_oracle_nt.sql from

   connect / as sysdba
   
to (substituting correct password)

   connect sys/welcome as sysdba

6) Create the database data directory.  For example:

    For Oracle 9i
  
      mkdir -p %ORACLE_BASE%\oradata\PLUM
  
    For Oracle 10g
  
      mkdir -p %ORACLE_BASE%\oradata\PLUM10

7) If this is a re-creation of a database or a retry of a prior failed attempt,
   delete the old database files:

    For Oracle 9i
      
      del %ORACLE_BASE%\oradata\PLUM\*.*
      
    For Oracle 10g
      
      del %ORACLE_BASE%\oradata\PLUM10\*.*

8) Run crdb1_oracle_nt.sql to create the database.   

    For Oracle 9i

      cd %ORACLE_BASE%\admin\PLUM\plumtreescripts
      sqlplus \nolog                        
      SQL> @crdb1_oracle_nt.sql                                                              

    For Oracle 10g

      cd %ORACLE_BASE%\admin\PLUM10\plumtreescripts
      sqlplus \nolog                        
      SQL> @crdb1_oracle_nt.sql                                                              

    Note (again) the warning in step 5 about setting the 'sys' password 
    in this script.
  
    No errors should be observed from crdb1_oracle_nt.sql. If any errors 
    are encountered, use the database creation assistant to delete the database, 
    then go back to step (7).

9) Run crdb2_oracle_nt.sql to create tablespaces, the ALUI user, and to 
   run required core Oracle database procedures.

    For Oracle 9i

      cd %ORACLE_BASE%\admin\PLUM\plumtreescripts

    For Oracle 10g

      cd %ORACLE_BASE%\admin\PLUM10\plumtreescripts
      sqlplus /nolog                        
      SQL> @crdb2_oracle_nt.sql                                                              

   Note (again) the warning in step 5 about setting the 'sys' password 
   in this script.

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

     sqlplus /nolog
     SQL> @create_spfile_oracle_nt.sql

11) Run the 'init_plumtree_db_oracle.sql' script created by the ALUI
   installer in the ALUI schema.  For example (change username and password
   as appropriate):

   For Oracle 9i

     cd %ORACLE_BASE%\admin\PLUM\plumtreescripts
     sqlplus plumtree/plumtree @init_plumtree_db_oracle
  
   For Oracle 10g

     cd %ORACLE_BASE%\admin\PLUM10\plumtreescripts
     sqlplus plumtree/plumtree @init_plumtree_db_oracle
    
12) Follow directions in the relevant install manual for the installation of other ALUI
   product schemas and objects (for example, Collaboration Server, Content Server, etc.)
