Previous | Table of Contents | Next

Page 105


Directory Name Usage
RDBMS/ADMIN SQL scripts to create system database objects, roles, and views
RDBMS/TRACE Default database dump directory
NETWORK Oracle Networking files
NETWORK/ADMIN SQL*Net configuration files
NETWORK/TRACE Default SQL*Net dump directory
PLSQL PL/SQL configuration files and SQL scripts
DOC On-line documentation
SYSMAN Oracle Enterprise Manager files
PLUS SQL*Plus files

In general, the admin directories contain SQL scripts related to the creation of administrative objects related to whatever product directory they are in. The most interesting directory to the DBA is $ORACLE_HOME/rdbms/admin. Here you'll find the SQL scripts that are run to create the system database objects, packages, procedures, and so on. $ORACLE_HOME/network/admin holds all of the files necessary to configure SQL*Net communications. $ORACLE_HOME/dbs holds sql.bsq, the SQL file run during database creation to create the data dictionary tables.

Other Important Configuration Files

There are a few other files of which you should be aware that are installed with the Oracle server installation. The oratab, oraenv, and coraenv files are found only on UNIX servers. oratab is a text file that holds a line for each database on the system. Each line consists of the database SID, the Oracle home for that particular database, and a flag indicating whether or not the database should be automatically started or shut down. Several supplied Oracle programs and scripts, such as dbstart or dbshut, use this file to identify the databases located on the server, as well as their versions. dbstart and dbshut also use the automatic startup flag to choose the databases on which to perform their actions.

oraenv and coraenv are script files that define and set the environment variables necessary to run Oracle programs and tools in the UNIX environment. oraenv is for Bourne shell (sh) environments, while coraenv is for environments using cshell (csh). oraenv and coraenv also access the oratab file to determine the proper ORACLE_HOME to set, based on the value for the database SID entered upon login. These files are the place to start researching when you begin customizing your UNIX Oracle environment.

On Windows NT servers, you should be aware of the password file, created by the oradim utility, for each database. This file contains the password for the internal user account— the account used when starting or shutting down the database. The password file, named oraSID.pwd, is flagged, hidden, and stored in the $ORACLE_HOME/database directory. It is used with certain security configurations to authenticate remote DBAs to the database.

Page 106

Creating Your First Database

Now that you have gained knowledge about the Oracle environment as well as the specifics regarding the Oracle database and instance, it's time to look at the process involved in creating an Oracle database from scratch.

Creating an Oracle database consists of a number of discrete steps:

Each of these steps is examined in the following sections.

Creating the Initialization Parameter File

The first step in creating a new database is to copy the default init.ora file (found in $ORACLE_HOME/dbs on UNIX platforms and $ORACLE_HOME/database on Windows NT servers) to a file that uniquely identifies the parameter file as belonging to a specific database. This file contains parameter settings specific to the new database. Oracle's default naming convention for the init.ora files is initSID.ora, where SID is the system identifier you have chosen for the new database. The Oracle tools will look for a file of this name (using the value of ORACLE_SID to fill in the SID portion of the filename), if a parameter file is not explicitly specified upon startup. Edit the copied file and replace the default parameter values with values that make sense. At the very least, make sure the controlfile parameter, db_block_size, and db_name parameters are correct.

Now is also a good time to create the directories that will hold your Oracle datafiles, as well as the background and user trace files and whatever other administrative directory structures you use. Consult the section "Designing an Optimal Flexible Architecture" for details on this configuration.

Creating the Instance

Instance creation is one of the most misunderstood tasks related to Oracle database administration. As previously discussed, the instance is specifically that portion of the Oracle database consisting of the background processes and memory structures contained within the server's memory address space. Creating and working with instances is significantly different between UNIX and Windows NT platforms. The following sections discuss the different steps involved with each environment.

Page 107

Creating an Instance on UNIXOn UNIX platforms, the Oracle instance is not a permanent structure but rather is created each time the database is started, using the parameters in the init.ora file specified at database startup. The instance is named using the value of the ORACLE_SID environment variable. The exact time instance creation occurs is in the state known as nomount. When you start up nomount, you are doing nothing more than allocating the SGA and starting the server's background processes. Depending on your UNIX platform, the instance name (as defined by the ORACLE_SID value) may or may not also be a part of the background process task names.

Creating an Instance on Windows NTCreating and working with an instance on a Windows NT server is substantially more involved than on a UNIX server. Because of the Windows NT architecture, all daemon processes are implemented using Windows NT services. A service must be defined and stored within the Windows NT Registry before it can be activated. So, for each Windows NT database you have, you must create an associated service to host the instance for the database. Unlike the UNIX server, a Windows NT Oracle instance is represented by a physical operating system construct that is persistent whether the instance is started or not.

In most installations, each database has two Windows NT services assigned to it. Only one of these services, the OracleServiceSID, is required for database operation. The OracleServiceSID service is created with the initialization parameter file embedded in its definition. This is how Windows NT knows which init.ora file to look to when creating the instance, as well as what database (using the controlfile parameter in init.ora) the instance is for. The other service, OracleStartSID, is provided as a convenient way to automatically start your instance and database when the Windows NT server starts. When the OracleStartSID service is started, it automatically starts OracleServiceSID and opens the database to which OracleServiceSID points. Creating the OracleStartSID service is discussed later in this chapter.

The services necessary to run the Oracle instance are created using the oradim utility. oradim has two methods of operation—through a GUI interface and using the command line. Those used to Windows NT will probably prefer the GUI interface, while UNIX administrators will be glad the command-line interface is available. Invoking oradim with no arguments will automatically start the GUI interface. The GUI interface can be used to create the initial service and instance, while the command-line option enables greater control and more powerful administration options.

One thing to note about oradim is that it does not output error messages to stdout or the screen. Rather, all errors will be written to the oradim.log file located in the $ORACLE_HOME/rdbms directory. This is a minor inconvenience that hopefully will be changed in future Oracle versions. The reason for this design is beyond all comprehension.

When you invoke the oradim GUI, you will be presented with two screens containing database parameters for you to fill in. Follow the instructions and oradim will create the Oracle services, create the database, and run catalog.sql and catproc.sql (discussed below). Be sure to change the default values given for the database name, instance name, datafile, and parameter files.

Previous | Table of Contents | Next