CREATING NEW INSTANCE/DATABASE - UNIX


Parameters currently being used:

Oracle_home = /oracle/orahome
database directory = /oracle/orahome/dbs
logs directory = /oracle/orahome/rdbms/log
archive directory = /oracle/orahome/dbs/arch/arch.log

Steps to follow for creating new instance or database :

  1. Decide where to store the new database. Our example will be called test1 and will be stored under the oracle home directory. Some of the following directories must be created because the system will NOT create them for you. In fact, the commands will fail if the directories are not there. New parameters will be as follows :
  2. Oracle_home = /oracle/orahome
    database directory = /oracle/orahome/dbs/test1
    logs direcotry = /oracle/orahome/rdbms/test1/log
    archives directory = /oracle/orahome/dbs/test1/arch/arch.log

  3. Create the following directories for our example :
  4. /oracle/orahome/dbs/test1
    /oracle/orahome/dbs/test1/arch
    /oracle/orahome/rdbms/test1
    /oracle/orahome/rdbms/test1/log

  5. Go into network administrator on the client side and create a database named test1. Validate the objects and generate them.
  6. Copy the generated files to the /oracle/orahome/network/admin directory. Also copy them to the /etc directory.
  7. Shutdown the listener control by executing the command 'lsnrctl' while logged in as oracle. While in the listener control utility type 'status' to see that the new test1 sid is not running. Type 'stop' to stop the listener process. Type 'start' to restart the listener with the new sids. Now type 'status' to see that the new sid, test1, is running.
  8. Launch sqldba from the unix side. Execute the create database script named, /oracle/orahome/dbs/test1/crdbtst1.sql.
  9. While still in sqldba, reconnect internal to be sure still connected. execute the script, /oracle/orahome/dbs/test1/crdb2test1.sql.
  10. Reconnect as internal to be sure that there is still a valid connection. Then shutdown the database while still in sqldba by issuing the command 'shutdown'.
  11. At this point make sure that the rollback segment of the inittst1.ora file shows four redo logs.
  12. Reconnect as internal to be sure that there is still a valid connection. Restart database that was just shutdown by issuing the command 'startup pfile=/oracle/orahome/dbs/test1/inittst1.ora'.
  13. Copy /oracle/orahome/dbs/test1/inittst1.ora to /oracle/orahome/dbs/inittest1.ora. This step will allow later startups without specifying the pfile option because the pfile will be in the default directory.
  14. On unix, while logged in as oracle, at a shell prompt, run orapwd utility as follows:
  15. orapwd file=orapwtest1 password=sys

  16. Turn on the archive log mode so that we can possibly rollback transactions. See 'Turning on Archive Logs' for this.
  17. Finally, create users to use this database and set their tablespace to be 'users' and create any neccessary roles for the database. Dont forget to grant sysdba and sysoper to the user name through sequel. Use worksheet window in server manager for best success while in as dba.
  18. Update the /etc/oratab file if you want to start the database automatically at system startup. Use above line in file as example.
  19. Connect internal in a sqldba session and run the following 3 scripts :
  20. @/oracle/orahome/rdbms/admin/standard
    @/oracle/orahome/rdbms/admin/dbmsstdx
    @/oracle/orahome/rdbms/admin/catproc

  21. Log into sqlplus for the correct instance, in this case test1. Use a username/password of system/******. Run the following script :

@/oracle/orahome/sqlplus/admin/pupbld