Oracle control file Reconstruction

Source: Internet
Author: User

Scenario: If the storage media is damaged and the control file is lost, you need to replace the hard disk and recreate the control file.
(1) modify the initialization parameter control_files to change the location of the control file.
SQL> ALTER SYSTEM SET CONTROL_FILES = '/disk1/oradata/control01.ctl', '/disk2/oradata/control. ctl' scope = spfile;

 
(2) shut down the database
SQL> shutdown immediate

 
(3) Start the instance
SQL> startup nomount
SQL> select value from v $ parameter where name = 'control _ files ';

 
(4) create a control file
Create controlfile reuse database "ORCL" NORESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
# MAXLOGHISTORY 292
LOGFILE
GROUP 1'/u01/app/Oracle/oradata/orcl/redo01.log' SIZE 50 M,
GROUP 2'/u01/app/oracle/oradata/orcl/redo02.log 'SIZE 50 M,
GROUP 3 '/u01/app/oracle/oradata/orcl/redo03.log' SIZE 50 M
-- STANDBY LOGFILE
DATAFILE
'/U01/app/oracle/oradata/orcl/system01.dbf ',
'/U01/app/oracle/oradata/orcl/undotbs01.dbf ',
'/U01/app/oracle/oradata/orcl/sysaux01.dbf ',
'/U01/app/oracle/oradata/orcl/users01.dbf ',
'/U01/app/oracle/oradata/orcl/example01.dbf'
Character set WE8ISO8859P1;

 
Note:
The NORESETLOGS option is used to specify that the original redo log is still used.
RESETLOGS does not use the original redo log

 
(5) Open the database
SQL> ALTER DATABASE OPEN;

 
(6) add temporary files
SQL> alter database temp add tempfile '/disk1/oradata/temp01.dbf' size 50 m reuse autoextend off;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.