THE INSTALLER WILL RETURN A MESSAGE STATING THAT “THE INSTALLATION...

10. The installer will return a message stating that “The installation of Oracle Database 11g was successful.” Congratulations! Click

EXIT

.

Create a Database by Using the Database

Configuration Assistant

This one OCP examination objective is in fact a large task, comprising several steps. It is not large in terms of the practicalities (creating a database can be quick and simple—a single two-word command will do it, and it may take less than ten minutes), but there are many prerequisite concepts you should understand:• The instance, the database, and the data dictionary• Using the DBCA to create a database• The instance parameter file• The CREATE DATABASE command• Post-creation scripts• The DBCA’s other functions

The Instance, the Database, and the Data Dictionary

An Oracle server consists of an instance and a database; the two are separate, but connected. The instance comprises memory structures and processes, stored in your machine’s RAM and executing on its CPU(s); its existence is transient; it can be started and stopped. The database comprises files on disk; once created, it persists until it is deleted. Creating an instance is nothing more than building the memory structures and starting the processes. Creating a database is done by the instance as a once-off operation, and the instance can then open and close it many times subsequently. The database is inaccessible without the instance.Within the database there is a set of tables and other segments called the data dictionary. The data dictionary describes all the logical and physical structures in the database, including all the segments that store user data.The process of database creation establishes the bare minimum of physical structures needed to store the data dictionary, and then creates the data dictionary within them.An instance is defined by an instance parameter file. The parameter file contains directives that define how the instance should be initialized in memory: the size of the memory structures, and the behavior of the background processes. After building the instance, it is said to be in no mount mode. In no mount mode, the instance exists but has not connected to a database. Indeed, the database may not even exist at this point.All parameters, either specified by the parameter file or implied, have default values, except for one: the parameter DB_NAME. The DB_NAME parameter names the database to which the instance will connect. This name is also embedded in the controlfile. The CONTROL_FILES parameter points the instance to the location of the controlfile. This parameter defines the connection between the instance and the database. When the instance reads the controlfile (which it will find by reading the CONTROL_FILES parameter) if there is a mismatch in database names, the database will not mount. In mount mode, the instance has successfully connected to the controlfile. If the controlfile is damaged or nonexistent, it will be impossible to mount the database. The controlfile is small, but vital.Within the controlfile, there are pointers to the other files (the online redo logfiles and the datafiles) that make up the rest of the database. Having mounted the database, the instance can open the database by locating and opening these other files. An open database is a database where the instance has opened all the available online redo logfiles and datafiles. Also within the controlfile, there is a mapping of datafiles to tablespaces. This lets the instance identify the datafile(s) that make(s) up the SYSTEM tablespace within which it will find the data dictionary. The data dictionary lets the instance resolve references to objects referred to in SQL code to the segments in which they reside, and work out where, physically, the objects are.The creation of a database server must therefore involve these steps:• Create the instance.• Create the database.• Create the data dictionary.In practice, the steps are divided slightly differently:PART I• Create the database and the data dictionary objects.• Create the data dictionary views.The data dictionary as initially created with the database is fully functional but unusable. It has the capability for defining and managing user data but cannot be used by normal human beings because its structure is too abstruse. Before users (or DBAs) can actually use the database, a set of views must be created on top of the data dictionary that will render it understandable by humans.The data dictionary itself is created by running a set of SQL scripts that exist in the ORACLE_HOME/rdbms/admin directory. These are called by the CREATE DATABASE command. The first is sql.bsq, which then calls several other scripts. These scripts issue a series of commands that create all the tables and other objects that make up the data dictionary.The views and other objects that make the database usable are generated by additional scripts in the ORACLE_HOME/rdbms/admin directory, prefixed with “cat”. Examples of these are catalog.sql and catproc.sql, which should always be run immediately after database creation. There are many other optional “cat” scripts that will enable certain features—some of these can be run at creation time; others might be run subsequently to install these features at a later date.

Using the DBCA to Create a Database

These are the steps to follow to create a database: