Oracle7 Server Administrator's Guide

Contents Index Home Previous Next

Creating an Oracle7 Database

This section includes the following topics:

Steps for Creating an Oracle7 Database

These steps, which describe how to create an Oracle7 database, should be followed in the order presented.

To Create a New Database and Make It Available for System Use

See Also: These steps provide general information about database creation on all operating systems. See your operating system-specific Oracle documentation for information about creating databases on your platform.

Step 1 Back up any existing databases.

Oracle Corporation strongly recommends that you make complete backups of all existing databases before creating a new database, in case database creation accidentally affects some existing files. Backup should include parameter files, datafiles, redo log files, and control files.

Step 2 Create parameter files.

The instance (System Global Area and background processes) for any Oracle7 database is started using a parameter file.

Each database on your system should have at least one customized parameter file that corresponds only to that database. Do not use the same file for several databases.

To create a parameter file for the database you are about to make, use your operating system to make a copy of the parameter file that Oracle7 provided on the distribution media. Give this copy a new filename. You can then edit and customize this new file for the new database.

See Also: For more information about copying the parameter file, see your operating system-specific Oracle documentation.

Note: In distributed processing environments, Server Manager is often executed from a client machine of the network. If a client machine is being used to execute Server Manager and create a new database, you need to copy the new parameter file (currently located on the computer executing Oracle7) to your client workstation. This procedure is operating system-dependent. For more information about copying files among the computers of your network, see your operating system-specific Oracle documentation.

Step 3 Edit new parameter files.

To create a new database, inspect and edit the following parameters of the new parameter file:

Parameter Described
DB_NAME [*]
DB_DOMAIN [*]
CONTROL_FILES [*]
DB_BLOCK_SIZE [*]
DB_BLOCK_BUFFERS [*]
PROCESSES [*]
ROLLBACK_SEGMENTS [*]
Table 2 - 1. Suggested Initialization Parameters to Edit

You should also edit the appropriate license parameter(s):

Parameter Described
LICENSE_MAX_SESSIONS [*]
LICENSE_SESSION_WARNING [*]
LICENSE_MAX_USERS [*]
Table 2 - 2. License Initialization Parameters

Step 4 Check the instance identifier for your system.

If you have other databases, check the Oracle7 instance identifier. The Oracle7 instance identifier should match the name of the database (the value of DB_NAME) to avoid confusion with other Oracle7 instances that are running concurrently on your system.

See your operating system-specific Oracle documentation for more information.

Step 5 Start Server Manager and connect to Oracle7 as an administrator.

Once Server Manager is running, connect to the database as an administrator.

See Also: Starting Server Manager is operating system specific; see your operating system-specific Oracle documentation for details.

Step 6 Start an instance.

To start an instance (System Global Area and background processes) to be used with the new database, use the Startup Database dialog box of Server Manager. In the Startup Database dialog box, make sure that you have selected the Startup Nomount radio button.

After selecting the Startup Nomount, the instance starts. At this point, there is no database. Only an SGA and background processes are started in preparation for the creation of a new database.

Step 7 Create the database.

To create the new database, use the SQL command CREATE DATABASE, optionally setting parameters within the statement to name the database, establish maximum numbers of files, name the files and set their sizes, and so on.

When you execute a CREATE DATABASE statement, Oracle performs the following operations:

Warning: Make sure that the datafiles and redo log files that you specify do not conflict with files of another database.

Step 8 Back up the database.

You should make a full backup of the database to ensure that you have a complete set of files from which to recover if a media failure occurs. See Chapter 23.

See Also: "Backing Up a Database," Chapter 23.

"Using Parameter Files" [*] for more information about parameter files.

Oracle7 Server SQL Reference for information about the CREATE DATABASE command, character sets, and database creation.

Creating a Database: Example

The following statement is an example of a CREATE DATABASE statement:

CREATE DATABASE test
	LOGFILE
		GROUP 1 ('test_log1a', 'test_log1b') SIZE 500K,
		GROUP 2 ('test_log2a', 'test_log2b') SIZE 500K,
	DATAFILE 'test_system' SIZE 10M;

The values of the MAXLOGFILES, MAXLOGMEMBERS, MAXDATAFILES, MAXLOGHISTORY, and MAXINSTANCES options in this example assume the default values, which are operating system-dependent. The database is mounted in the default modes NOARCHIVELOG and EXCLUSIVE and then opened.

The items and information in the example statement above result in creating a database with the following characteristics:

Note: You can set several limits during database creation. Some of these limits are also subject to superseding limits of the operating system and can affect each other. For example, if you set MAXDATAFILES, Oracle7 allocates enough space in the control file to store MAXDATAFILES filenames, even if the database has only one datafile initially; because the maximum control file size is limited and operating system-dependent, you might not be able to set all CREATE DATABASE parameters at their theoretical maximums.

See Also: For more information about setting limits during database creation, see the Oracle7 Server SQL Reference.

See your operating system-specific Oracle documentation for information about operating system limits.

Troubleshooting Database Creation

If for any reason database creation fails, shut down the instance and delete any files created by the CREATE DATABASE statement before you attempt to create it once again.

After correcting the error that caused the failure of the database creation, return to Step 6 of "Creating a Oracle7 Database."

Dropping a Database

To drop a database, remove its datafiles, redo log files, and all other associated files (control files, parameter files, archived log files).

To view the names of the database's datafiles and redo log files, query the data dictionary views V$DBFILE and V$LOGFILE.

See Also: For more information about these views, see the Oracle7 Server Reference.


Contents Index Home Previous Next