Re: How do you create 2 dbs on the same machine

From: Bob Swisshelm <swisshelm_at_lilly.com>
Date: 1 Mar 95 07:06:40 EST
Message-ID: <1995Mar1.070640.4105_at_inet.d48.lilly.com>


In article <dcrowson.1022.000D2C94_at_amoco.com> Dave Crowson, dcrowson_at_amoco.com writes:
>In article <1995Feb23.090820.650_at_cho006> little_c_at_cho006.cho.ge.com
 (Chris Little) writes:
>>Why is it safer to create the database by script rather than through
>>the standard installation scripts that come with Oracle? I've created
 a
>>number of instances on the same machine using the
>>$ORACLE_HOME/orainst/orainst script, each time specifying a different
>>ORACLE_SID. This has worked fine for me. If I'm overlooking something,
>>please let me know. Thanks.
>
>
>Because that script is for installing the Oracle executables, not for
>instance creation.
>
>Why re-install the execuatbles every time you want to add an instance,
>it's a dumb and pointless exercise.
>
>Oracle don't provide one, so you have to write one.
>
>
>All you need is a script that does the create
 database/tablespace/rollback
>segs etc statements.

I have used orainst many many times to create just a new instance/database. I have not run into any problems. True, the method that you have to use to not real obvious. You have to select 'Create New Database Objects', then 're-install' the RDBMS. This does not actually re-install the executables, it just creates the instance and database.

I use the OFA (Optimal Flexible Architecture) installation, by setting $ORACLE_BASE before I run orainst. I find that installation to be much preferable to the alternative configuration. The OFA installation moves the administration files for each instance (init.ora, config.ora, etc.) into separate directories. The only database specific file in the ORACLE executable directories are symbolic links from the $ORACLE_HOME/dbs directory to the init.ora files of your databases.

The orainst procedure creates the database admin directories for you automatically. If you don't use orainst, you have create those directories by yourself. You also have to create the symbolic link between $ORACLE_HOME/dbs/initxxx.ora and the real location of the init.ora.

All in all, if you are using OFA, it is much better to use orainst to create the database.

One problem with using orainst is that it doesn't provide an easy way of modifying defaults, such as default tablespace names, locations, and key init.ora parameters, like db_block_size. Either by reading the install guide in detail, or by playing around, I figured out that orainst uses the skeleton files in $ORACLE_HOME/rdbms/install when creating databases. You can modify those before running orainst, and get a fairly customized install.

For example, if you want to use orainst, but want to increase your databaes block size to 8K, modify $ORACLE_HOME/rdbms/install/cnfg.orc before running orainst.

Another useful thing to know is that orainst saves your answers to its questions in $ORACLE_HOME/orainst/usrdfl.log. If you run orainst a second time, it will use your answers from the first run as defaults for the second. If you modify the usrdfl.log file before running orainst the second time, it makes life much easier.

For example, suppose I create a database dev and placed the database files is /disk01/oradata/dev, /disk02/oradata/dev, and /disk03/oradata/dev. Now I want to create a database called prod that spreads the files the same way across the disk, but I want the files to be in /disk01/oradata/prod, etc. I can edit usrdfl.log and make a global change of dev to prod. When I run orainst, it will use the /prod directories.

Bob Swisshelm | swisshelm_at_Lilly.com | 317 276 5472 Eli Lilly and Company | Lilly Corporate Center | Indianapolis, IN 46285 Received on Wed Mar 01 1995 - 13:06:40 CET

Original text of this message