0

Was searching online for any description or explanation for Creating Control file in Oracle 11g .

All what i found is this code and could not understand it to be honest :

 CREATE CONTROLFILE
   SET DATABASE prod
   LOGFILE GROUP 1 ('/u01/oracle/prod/redo01_01.log', 
                    '/u01/oracle/prod/redo01_02.log'),
           GROUP 2 ('/u01/oracle/prod/redo02_01.log', 
                    '/u01/oracle/prod/redo02_02.log'),
           GROUP 3 ('/u01/oracle/prod/redo03_01.log', 
                    '/u01/oracle/prod/redo03_02.log') 
   RESETLOGS
   DATAFILE '/u01/oracle/prod/system01.dbf' SIZE 3M,
            '/u01/oracle/prod/rbs01.dbs' SIZE 5M,
            '/u01/oracle/prod/users01.dbs' SIZE 5M,
            '/u01/oracle/prod/temp01.dbs' SIZE 5M
   MAXLOGFILES 50
   MAXLOGMEMBERS 3
   MAXLOGHISTORY 400
   MAXDATAFILES 200
   MAXINSTANCES 6
   ARCHIVELOG;

Source for the above code : Creating Control Files

If that's ok i need small explination for the code , and if i want to Create three control files what should i do or change in the above code ?

Thank you guys already .

Laith
  • 428
  • 4
  • 10

1 Answers1

1

If that's ok i need small explanation for the code , and if i want to Create three control files what should i do or change in the above code ?

Yes, first of all you need to change your database name to database created before using create database or create controlfile command. Second path to these log and data files. Details explanation is given in Oracle's Online documentation which I have referenced below.

We create one control file for one database. In order to create control file first of all start the Oracle instance in nomount mode.

[user@localhost]$ sqlplus / as sysdba
SQL> startup nomount
SQL> create controlfile... 

Reference: CREATE CONTROLFILE

atokpas
  • 3,231
  • 1
  • 11
  • 22
  • Thank you for that , did not realize that that page is exist lol , thx , but just need small hint while me reading the page , can you give me small example on creating the control file ? and my head is missed up a bit cause of the "Three" ward , is like im have to do the statement 3 times or what exactly , forgive me , still new to oracle . – Laith Jan 31 '17 at 08:32
  • Example is already in your question, you just need to execute it after editing the parameter according to your requirements. – atokpas Jan 31 '17 at 08:51
  • 1
    @Laith: That three files indicated in your link is for redundancy, as control file is crucial to mount the database it has to be secured by creating its duplicates in different locations. We use `control_files` initialization parameter in a parameter file to point these redundant files. I don't know why would you like to create this file manually, if you use DBCA to create database then you don't need to worry about this. – atokpas Jan 31 '17 at 08:58