Oracle8i SQL Reference
Release 2 (8.1.6)

A76989-01

Library

Product

Contents

Index

Prev Up Next

SQL Statements (continued), 3 of 20


CREATE CONTROLFILE

Syntax


WARNING:

Oracle recommends that you perform a full backup of all files in the database before using this statement. For more information, see Oracle8i Backup and Recovery Guide. 



filespec: See "filespec".

Purpose

To re-create a control file in one of the following cases:

When you issue a CREATE CONTROLFILE statement, Oracle creates a new control file based on the information you specify in the statement. If you omit any clauses, Oracle uses the default values rather than the values for the previous control file. After successfully creating the control file, Oracle mounts the database in the mode specified by the initialization parameter PARALLEL_SERVER. You then must perform media recovery before opening the database. It is recommended that you then shut down the instance and take a full backup of all files in the database.

See Also:

Oracle8i Backup and Recovery Guide for more information about using this statement. 

Prerequisites

You must have the OSDBA role enabled. The database must not be mounted by any instance.

If the REMOTE_LOGIN_PASSWORDFILE initialization parameter is set to EXCLUSIVE, Oracle returns an error when you attempt to re-create the control file. To avoid this message, either set the parameter to SHARED, or re-create your password file before re-creating the control file.

See Also:

Oracle8i Reference for more information about the REMOTE_LOGIN_PASSWORDFILE parameter. 

Keywords and Parameters

REUSE  

specifies that existing control files identified by the initialization parameter CONTROL_FILES can be reused, thus ignoring and overwriting any information they may currently contain. If you omit this clause and any of these control files already exists, Oracle returns an error.  

DATABASE database 

specifies the name of the database. The value of this parameter must be the existing database name established by the previous CREATE DATABASE statement or CREATE CONTROLFILE statement.  

SET DATABASE database  

changes the name of the database. The name of a database can be as long as eight bytes.  

LOGFILE  

specifies the redo log files for your database. You must list all members of all redo log file groups.

See Also: "filespec" for the syntax of filespec.  

 

GROUP integer 

specifies logfile group. If you specify GROUP values, Oracle verifies these values with the GROUP values when the database was last open. 

RESETLOGS  

ignores the contents of the files listed in the LOGFILE clause. These files do not have to exist. Each filespec in the LOGFILE clause must specify the SIZE parameter. Oracle assigns all online redo log file groups to thread 1 and enables this thread for public use by any instance. After using this clause, you must open the database using the RESETLOGS clause of the ALTER DATABASE statement.  

NORESETLOGS  

specifies that all files in the LOGFILE clause should be used as they were when the database was last open. These files must exist and must be the current online redo log files rather than restored backups. Oracle reassigns the redo log file groups to the threads to which they were previously assigned and reenables the threads as they were previously enabled.  

DATAFILE  

specifies the datafiles of the database. You must list all datafiles. These files must all exist, although they may be restored backups that require media recovery. See the syntax description of filespec in "filespec".  

MAXLOGFILES integer  

specifies the maximum number of online redo log file groups that can ever be created for the database. Oracle uses this value to determine how much space in the control file to allocate for the names of redo log files. The default and maximum values depend on your operating system. The value that you specify should not be less than the greatest GROUP value for any redo log file group.  

MAXLOGMEMBERS integer  

specifies the maximum number of members, or identical copies, for a redo log file group. Oracle uses this value to determine how much space in the control file to allocate for the names of redo log files. The minimum value is 1. The maximum and default values depend on your operating system. 

MAXLOGHISTORY integer  

specifies the maximum number of archived redo log file groups for automatic media recovery of the Oracle Parallel Server. Oracle uses this value to determine how much space in the control file to allocate for the names of archived redo log files. The minimum value is 0. The default value is a multiple of the MAXINSTANCES value and depends on your operating system. The maximum value is limited only by the maximum size of the control file. This parameter is useful only if you are using Oracle with the Parallel Server option in both parallel mode and archivelog mode. 

MAXDATAFILES integer  

specifies the initial sizing of the datafiles section of the control file at CREATE DATABASE or CREATE CONTROLFILE time. An attempt to add a file whose number is greater than MAXDATAFILES, but less than or equal to DB_FILES, causes the Oracle control file to expand automatically so that the datafiles section can accommodate more files.  

 

The number of datafiles accessible to your instance is also limited by the initialization parameter DB_FILES.  

MAXINSTANCES integer  

specifies the maximum number of instances that can simultaneously have the database mounted and open. This value takes precedence over the value of the initialization parameter INSTANCES. The minimum value is 1. The maximum and default values depend on your operating system.  

ARCHIVELOG  

establishes the mode of archiving the contents of redo log files before reusing them. This clause prepares for the possibility of media recovery as well as instance or crash recovery.  

NOARCHIVELOG  

If you omit both the ARCHIVELOG clause and NOARCHIVELOG clause, Oracle chooses NOARCHIVELOG mode by default. After creating the control file, you can change between ARCHIVELOG mode and NOARCHIVELOG mode with the ALTER DATABASE statement.  

CHARACTER SET character_set  

optionally reconstructs character set information in the control file. In case media recovery of the database is required, this information will be available before the database is open, so that tablespace names can be correctly interpreted during recovery. This clause is useful only if you are using a character set other than the default US7ASCII.

If you are re-creating your control file and you are using Recovery Manager for tablespace recovery, and if you specify a different character set from the one stored in the data dictionary, then tablespace recovery will not succeed. (However, at database open, the control file character set will be updated with the correct character set from the data dictionary.)

See Also: Oracle8i Recovery Manager User's Guide and Reference for more information on tablespace recovery. 

 

Note: You cannot modify the character set of the database with this clause. 

Example

This statement re-creates a control file. In this statement, database ORDERS_2 was created with the F7DEC character set.

CREATE CONTROLFILE REUSE 
   DATABASE orders_2 
   LOGFILE GROUP 1 ('diskb:log1.log', 'diskc:log1.log') SIZE 50K, 
           GROUP 2 ('diskb:log2.log', 'diskc:log2.log') SIZE 50K 
   NORESETLOGS 
   DATAFILE 'diska:dbone.dat' SIZE 2M 
                              MAXLOGFILES 5 
                              MAXLOGHISTORY 100 
                              MAXDATAFILES 10 
                              MAXINSTANCES 2 
                              ARCHIVELOG
   CHARACTER SET F7DEC; 

Prev Up Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index