Search code examples
oracleoracle11gcontrolfile

Any Explanation for creating CONTROLFILE Statement - Oracle 11g?


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 .


Solution

  • 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