Tuesday, February 5, 2013

Control file recovery

Control file needs recovery when
  • Any one control file specified in a parameter file is lost due to media failure or corrupted
  • New control file is needed when changing the database

When one control file becomes corrupted, oracle database automatically stops running. One can determine which control file is causing a problem by looking into alert log file. Then remove the corrupted control file and copy good control file to the corrupted location
  1. rm -f /u10/oradata/controlfile01.ctl
    
  2. cp /u20/oradata/controlfile02.ctl /u10/oradata/controlfile01.ctl
    
  3. Then mount the database
    STARTUP MOUNT;
    
  4. and open it
    ALTER DATBASE OPEN;
    
When a control file is lost, copy a good control file to the new location, modify control_file parameter by removing lost location and add the new location to it:

  1. Shutdown the database:
    SHUTDOWN ABORT;
    
  2. cp /u20/oradata/controlfile02.ctl /u10/oradata/controlfile04.ctl
    
  3. modify PFILE:
    CONTROL_FILE='/u20/oradata/controlfile02.ctl',
    '/u21/oradata/controlfile03.ctl',
    '/u30/oradata/controlfile04.ctl'
    
  4. Then mount and open the database:
    STARTUP MOUNT;
    ALTER DATBASE OPEN;
    

No comments:

Post a Comment