Building Database Creation Scripts

Although you may enter the commands to create a database directly from the keyboard using Oracle Server Manager, we advise you to create a script containing the SQL statements required to create the database. By creating a script and saving it on disk, you will:

  • Have an opportunity to review your creation statements for accuracy before executing them

  • Automate the actual database creation process

  • Be able to create a log file with a record of the statements executed

  • Document the exact method used to create the database

  • Be able to recreate the database in the future, if required

It is possible to generate a script containing all the database creation statements from an existing database. Oracle Scripts, by Brian Lomasky and David C. Kreines (O’Reilly Associates, 1998), describes a utility that performs this function.

The script may be created using any plain text editor, and should be saved to disk in a known, standard location. The OFA standard specifies a directory called create below ORACLE_HOME for this purpose.

The database creation script must do the following:

  • Create the database, specifying the filename and size for the SYSTEM tablespace. The SYSTEM tablespace does not usually need to be very big—50 to 80 megabytes will usually do—and it should be on a different disk from other datafiles, if possible. You will need to define the names, locations, and sizes of the redo log files. You should define at least three redo log files, and they should be sized ...

Get Oracle Database Administration: The Essential Refe now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.