Oracle has literally dozens of initialization parameters that affect how your database operates. You should strive to become familiar with the parameters that are available, to enable yourself to recognize situations where you can leverage the functionality that they provide. I have two suggestions that will help you learn about the various initialization parameters. The first is this: Find one or two initialization files from some production databases, read through them, and look up each parameter setting in the Oracle Reference Manual. Make sure that you understand why each parameter is being used. If necessary, ask a senior DBA to explain things to you. My second suggestion is to sit down with the Oracle Reference Manual, and read through it. Briefly skim each parameter description. Even if you do not understand everything, this plants the material in your brain. You will be surprised at what you will recall later when you need it.
Creating a Database
This section explains how to create an Oracle database manually with the SQL*Plus CREATE DATABASE statement.
These are the steps required to create a database:
Set the OS variables.
Configure the initialization file.
Create the required directories.
Create the database.
Create a data dictionary.
Each of these steps is covered in the following sections.
Step 1. Set the OS Variables
As mentioned previously, before you run SQL*Plus (or any other Oracle utility), you must set several OS variables. You can either manually set these variables or use a combination of files and scripts to set the variables. Here is an example of setting these variables manually:
Step 2: Configure the Initialization File
Oracle requires that you have an initialization file in place before you attempt to start the instance.
The initialization file is used to configure features such as memory and to control file locations. You can use two types of initialization files:
Server parameter binary file (spfile)
init.ora text file
Oracle recommends that you use an spfile for reasons such as these:
You can modify the contents of the spfile with the SQL ALTER SYSTEM statement.
You can use remote-client SQL sessions to start the database without requiring a local (client) initialization file.
These are good reasons to use an spfile. However, some shops still use the traditional init.ora file. The init.ora file also has advantages:
You can directly edit it with an OS text editor.
You can place comments in it that detail a history of modifications.
When I first create a database, I find it easier to use an init.ora file. This file can be easily converted later to an spfile if required (via the CREATE SPFILE FROM PFILE statement). In this example my database name is o12c, so I place the following contents in a file named inito12c.ora and put the file in the ORACLE_HOME/dbs directory:
Table 6-10 lists best practices to consider when configuring an Oracle initialization file.
You are almost ready to create the COIN database. Now that you have worked through this module, you should have an initCOIN.ora file that looks something like this:
View the code below to see how the initCOIN.ora file should look.
This module introduced you to the following terms:
cache hit ratio:A ratio telling you how often Oracle goes to read a block, and finds it already in memory as opposed to having to read the block from disk.
directive: With regards to an Oracle initialization parameter file, a directive is an entry in the file that has meaning to the program reading the file, rather than to the Oracle instance being started. For example, the IFILE directive is processed by Server Manager (or SQL*Plus), and is not passed on to the Oracle instance.
GETHIT Ratio: The GETHIT ration tells you relatively how often an SQL statement is found already in memory, in the shared pool, and already parsed.
GETMISS Ratio:Tells you relatively how often Oracle has to go to the disk for data dictionary information as opposed to finding it already in memory, in the data dictionary cache.
initialization parameter:An entry in a database's initialization file, or parameter file, that controls some aspect of the way the database instance operates. For example, the SHARED_POOL parameter controls the size of the shared pool within the SGA.
mount point:On a UNIX system, a mount point is the place in the directory structure where a disk is inserted. A mount point is basically a directory path, such that the resulting destination is really the top-level directory of an entirely new disk.
Optimal Flexible Architecture (OFA) The Optimal Flexible Archictecture is a set of guidelines from Oracle that provides suggestions for directory structures, file placement, file naming conventions, and standard tablespaces that each database should have.
redo log switch:A redo log switch refers to the process of closing one redo log file and opening the next file in the seqeuence.
throughput:When used in reference to a disk drive, throughput is a measure of how much data the drive can physically pump back to the application in a given period of time. A typical SCSI drive, for example, might have a sustained throughput of 17 megabytes/second. If all your database files were on this one drive, your database throughput would be quite limited.
The next step is to write and execute a CREATE DATABASE statement. The next module will lead you through that process. Once you have done that, and taken care of a few housekeeping tasks, you will have a working database.
Before you continue though, here is one final quiz for you to take on this module.