[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/scripts/sql/ -> README.OCI8 (source)

   1  FIRST OF ALL:
   2  This is not my first documentation! but my first in english.
   3  Feel free to contact me at torsten@flammiger.org if you have 
   4  any suggestions or problems related to this docs
   5  
   6  All i will write about Oracle with Horde is based on Oracle >= 8i
   7  though it should work with 9i too. 
   8  
   9  I think (i'm sure) 'Up to date' available distributions
  10  are capable to run Oracle. I have tested it on
  11  Slackware 7.1/8.0 (8.1.6) and have running it on Gentoo 1.2 (8.1.7.4)
  12  without any Problems. Some distributions are certified like SuSE or 
  13  RedHat. On Debian it should also run.
  14  
  15  Furthermore i'll assume, that no "normal" user is going to install
  16  or is in need to install an Oracle DB (of course there are some freaks ;)
  17  so knowledge about setting up and maintain an Oracle
  18  DB is indispensable! Maybe this is the reason why no Admin
  19  has ever posted any docs about getting Horde work with Oracle
  20  
  21  NOTE: all docs are available from www.oracle.com for free (AFAIK)
  22  
  23  Now let's begin:
  24  
  25  Case 1) 
  26  I'll assume that you do not have an instance running and therefore
  27  are about to install a fresh instance "horde" .
  28  
  29  --    check and if needed change shared memory parameters
  30  --    create at least the dba group
  31  --    create your oracle user, name it as you like
  32      make sure your ora-user is in the group dba
  33  --    su - <your fresh oracle user>
  34  --     set up all the appropriate environment variables for oracle
  35      take a close look at the install howto provided by oracle
  36  --    mount the CD (if it is your source media)
  37  --    run the script runInstaller - better to have X11 installed ;)
  38      Attention: If you are about to install Oracle 9i
  39      do NOT run the installer from directly from your CD!
  40      like cd /cdrom and then start it by typing ./runInstaller
  41      you won't be able to unmount the CD later on but you have to
  42      because 9i is a 3CD-Set
  43  --    follow the instructions given by the installation programm
  44      at the point where you are asked for an installation method
  45      choose "user-defined". This ist especially VERY IMPORTENT if you
  46      are about to install 8i since you have to patch the installation
  47      BEFORE you create your database! If you not choose "user-defined"
  48      the program "dbassist" will automatically start at the end of
  49      the installation process and will hang and/or fail.
  50  --    at the end of your installation you have to configure your listener.ora,
  51      tnsnames.ora and your sqlnet.ora This is all done by the
  52      installation programm. 
  53  --    Now: if you use 8.1.7 get the patch glibc-2.1.3-stubs.tar.gz from Oracle. 
  54      It's at the same page like the db-source. Install as described in README.stub
  55      (it's in the package so first untar it somewhere else or use 'mc' )
  56  --    Now create your database. Run "dbassist"
  57      It's now on you to decide how big the initial tablespaces are, how many
  58      control files you like, of course how it's name will be and what
  59      option you plan to use like InterMedia. It's Your Decision !
  60      (BTW: the defaults will work and are very time consuming ;)
  61      At the end let the dbasist program save the configuration. You can choose
  62      location and name. Now you can close dbassist.
  63  --    change to the location where you stored the scripts and take a short look
  64      at least into oraclerun.sh and oraclerun1.sh. If all is OK create the database:
  65      run ./oraclerun.sh. 
  66      Sit back take a cup of coffee and hope all will be good ;)
  67  
  68      If you choosed the InterMedia option the creation process will take
  69      about 2 and a half hour (on my 500MHz-P3 :-). Without Java it will take
  70      about 1 hour. (this both ist short - 9i takes as min. twice that time !)
  71      
  72      NOTE: choosing InterMedia will give you enhanced possibilities for storing
  73      and manipulating media files. Look at http://intermedia.as-dataservice.de/
  74      for an example...
  75      
  76      ANOTHER NOTE: if you installed 8.1.7 and afterwards applied an up to date
  77      patchset (like 8.1.7.4) you MUST repatch your installation with the 
  78      glibc-stubs patch or your DB won't run
  79      
  80      PROBLEMS ?: Look at www.orafaq.com for your answer
  81  
  82  All went fine? Good, lets go ahead and create a new tablespace called horde
  83  
  84  --    The database should run after it was succesfully created. Login as user system
  85      or sys (like you prefer). The passwords where written to you on STDOUT.
  86      Please change them! I know databases running for years storing important data
  87      and still have the default password !!
  88      (manager for system and change_on_install for sys)
  89  
  90  --    sqlplus sys/change_on_install@<your SID>
  91      if you properly set the ORACLE_SID environment variable you can ommit the
  92      trailing @<your sid> when you are logged on to the machine which is running the DB.
  93  
  94  --    create the tablespace for horde
  95      sql> CREATE TABLESPACE HORDE
  96                LOGGING
  97                DATAFILE '<YOUR PATH HERE>/HORDE.dbf' SIZE <AS YOU LIKE>M;
  98  
  99      This is indeed very simple but it works and nothing has to be in uppercase
 100      letters. After a few seconds or minutes - depends on how many megabytes
 101      you gave to that tablespace - a new datafile has been created.
 102  
 103  --    We can now create a user with default tablespace HORDE, lets name him horde:
 104  
 105      CREATE USER HORDE PROFILE DEFAULT IDENTIFIED BY <your password here> 
 106          TABLESPACE HORDE TEMPORARY TABLESPACE TEMP QUOTA UNLIMITED ON TEMP
 107      QUOTA UNLIMITED ON HORDE ACCOUNT UNLOCK;
 108      GRANT CONNECT TO HORDE;
 109  
 110  --    commit your work: > commit;
 111      and log out
 112  --    login as user horde: sqlplus horde/<password>@<your sid> and create the tables
 113      !<path to horde>/scripts/db/oracle_create.sql and commit your aktion: > commit;
 114      the tables will be created in the default tablespace for your horde user
 115      
 116  OK now you can configure Horde to use your instance but after a reboot Oracle
 117  will not start automaticly. That is what we are going to configure now.
 118  
 119  --    logout of oracle, login as user sys or <your oracle user> 
 120      and shutdown your instance: (hope your oracle user is in the group dba -
 121      if not he can't shut down your instance)
 122      > connect internal
 123      > shutdown immediate
 124      and logout...
 125      
 126  --    test the script "dbstart" in $ORACLE_HOME/bin If the DB does not start
 127      you have to edit it or create a link from $ORACLE_HOME/dbs/init<sid-name>.ora
 128      to $ORACLE_HOME/admin/<sid name>/pfile/init<sid-name>.ora
 129      ( dbstart will look for your sid-files in subdir "dbs" but these are stored
 130      under $ORACLE_HOME/admin/<sid name>/pfile/ - this maybe is a bug or a
 131      feature in the oracle installer )
 132      test "dbstart" again - now it should work, i hope
 133  
 134  --    edit the file /etc/oratab
 135      Change the line
 136      <sid-name>:<your Oracle Home - Full qualified path>:N   to
 137      <sid-name>:<your Oracle Home - Full qualified path>:Y
 138  
 139  --    now change or create a startup script which is executed at boot time. It should contain
 140      something like this:
 141      
 142      su - <your oracle user> -c "<hour path here>/bin/lsnrctl start"
 143      su - <your oracle user> -c "<your path here>/bin/dbstart"
 144  
 145      and of course your instance should be stopped a regular way. Place this
 146      in the appropriate script which is executed at shutdown time
 147  
 148      su - <your oracle user> -c "<hour path here>/bin/lsnrctl stop"
 149      su - <your oracle user> -c "<your path here>/bin/dbshut"
 150  
 151  --    test it
 152  
 153  End of Case 1)
 154  
 155  
 156  Case 2)
 157  
 158  Problem: You have an allready running oracle database and would like
 159  to add a new instance. Solution is quiet easy.
 160  For now, the new database' name will be --> horde
 161  
 162  Before i start i'll make some assumptions:
 163  (PLEASE CHANGE THE PATHNAMES AS NECESSARY )
 164  
 165  1.    $ORACLE_HOME=/home/oracle
 166  2.    $ORACLE_BASE = $ORACLE_HOME
 167  3.    Your existing Database is installed under $ORACLE_HOME/oradata/<your instance name>
 168  4.    Your existing Trace/Dump/pfile/bdump... - directories are installed under
 169       $ORACLE_HOME/admin/<your instance name>/
 170  
 171      Therefore your new horde database files will go into another directory:
 172      $ORACLE_HOME/oradata/horde/
 173  
 174      The Trace/Dump/pfile/bdump... - dirs go to:
 175      $ORACLE_HOME/admin/horde/
 176  
 177      The inithorde.ora file in $ORACLE_HOME/dbs should be a link to:
 178      $ORACLE_HOME/admin/horde/pfile/init.ora
 179  
 180  Lets begin:
 181  
 182  --    create the directories for your new db (as your ORACLE user):
 183      #> mkdir -p $ORACLE_HOME/oradata/horde/archive
 184      #> mkdir -p $ORACLE_HOME/admin/horde/adhoc \
 185              $ORACLE_HOME/admin/horde/bdump \
 186              $ORACLE_HOME/admin/horde/cdump \
 187              $ORACLE_HOME/admin/horde/create \
 188              $ORACLE_HOME/admin/horde/exp \
 189              $ORACLE_HOME/admin/horde/pfile \
 190              $ORACLE_HOME/admin/horde/udump
 191  
 192  --    copy your existing init.ora file from $ORACLE_HOME/admin/<existing instance>/pfile/
 193      to $ORACLE_HOME/admin/horde/pfile/ and make the appropriate changes in it
 194      CHANGE AT LEAST THE PATHNAMES !!!
 195  
 196  --    make the link from $ORACLE_HOME/dbs/inithorde.ora to
 197      $ORACLE_HOME/admin/horde/pfile/init.ora
 198  
 199      #> ln -s $ORACLE_HOME/admin/horde/pfile/init.ora $ORACLE_HOME/dbs/inithorde.ora
 200  
 201  --    set ORACLE_SID to horde
 202      #> ORACLE_SID=horde
 203  
 204  --    login and startup the instance
 205      #> sqlplus /nolog
 206      sql> startup pfile=/home/oracle/admin/horde/pfile/init.ora nomount
 207  
 208  --    create the database from create_horde_db.sql - you should of course have saved it somwhere ;)
 209      sql> !/path/to/create_horde_db.sql
 210  
 211      as template i took the script from
 212      http://www.adp-gmbh.ch/ora/admin/creatingdbmanually.html#samplecreatedatabase
 213      and made some minor changes.
 214  
 215  --    create the data dictionary, etc.
 216      sql> !/home/oracle/rdbms/admin/catalog.sql
 217      sql> !/home/oracle/rdbms/admin/catproc.sql
 218      sql> !/home/oracle/rdbms/admin/caths.sql
 219      sql> commit;
 220      sql> exit
 221  
 222  --    now add a new line to /etc/oratab
 223  
 224      old ( only 1 instance ):
 225      <your installed instance name>:/home/oracle:Y
 226  
 227      new ( with the new one ):
 228      <your installed instance name>:/home/oracle:Y
 229      horde:/home/oracle:Y
 230  
 231  --    add the new instance to your tnsnames.ora
 232      use the java gui net8assist or copy and paste the statements by yourself and
 233      make the changes as needed
 234  
 235  --    after all, the scripts dbstart und dbshut will then automaticly start and shutdown all
 236      instances at once
 237  
 238  Creating the Tablespace and required user is the same as  described above
 239  
 240  
 241  I hope that there are not so many spelling mistakes ( my native language is german ) 
 242  and that this will be helpfull for someone
 243  
 244  End of Case 2)
 245  
 246  $Horde: horde/scripts/sql/README.OCI8,v 1.2 2004/09/25 19:56:12 chuck Exp $


Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7