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;