25. (Important)Oracle Database Architecture (Oratab file, Control Files, creating a new control file) - Agnivo102/Database_Architect GitHub Wiki

Contents of the oratab file under etc directory under /.

It will show the number of database currently in the system.


Control file:-

The heart of the database. It holds the metadata of all the objects and data files.

When creating a database it by default has 2 data files. But we still copy it and keep it somewhere else. Because if the server or hard disk crashes then by that we can get back the control file and with control file and spfile we can create the database again.

Show the amount of control file we have in our database:

Show parameter control file;

One is in oradata - control01.ctl Another is in fast recovery area - control02.ctl

Let's create another control file:

First we have to see by which parameter file the database has started pfile or splife as they have different processes.

Show parameter spfile;

Lets create the location for control file:

Control file is also a parameter file.

Now how can we know if we made change here will the affect will be immediately or needs a restart.

Select name, value, issys_modifiable from v$parameter where lower(name) like 'control_files';

This is showing false. Means it needs a database restrart to get the change in affect.

Alter system set control_files ='give the firstvalue of the control file', 'second value', 'now the new one the location and file name' scope = spfile;

Now shutdown the database and copy any one of the present control file into that location. Give the same name you have given.

Now start the database and you will see the effect.

The database has stopped at nomount state as there is a version mismatch between the 3 comtrol files. The new one we still haven't added any content to it. Thats the reason for it. If this situation arrises just copy the control file with the higher version to the control file of the lower verion.

Whole Process for spfile:


Now from next time onwards if the 3 control file is not found then the database will not start. Because the location of all the control files are already set in spfile.

Now create the pfile again as the spfile has updated. We have to make the both file same.

Create pfile from spfile;

Now stutdown the database and start it with pfile.

Now to start the database which starts with spfile by default (only start with pfile if the spfile is not found) we need to write like this.

Startup pfile='pfile location';

Now in pfile we can't directly add a new control file in pfile using alter system. In case of pfile we have to directly add it manually.

Go to the location of pfile.



Save the change

Next copy the file manually.

See the new control file got added.

Now the change is done in pfile. So if we restart the database by only startup command it will start with spfile by default. So it will not show the changes made in pfile. To startup the database one option is to delete the spfile, the other option is toL

See the changes are not reflecting.

The same error is showing. We again need to do the same thing and make all the control files match in their versions.

Now lets make the spfile same as pfile. After that by default starting up the database will make the changes in effect.