Restore control file method
Once the control file is damaged, the system will not work properly. Damaged control file will be recorded in the alarm log, restore or rebuild the control file must be in the system NOMOUNT under
1 ) a single file damaged: and pluralistic sections, by simple replication solution.
2 ) all control files are missing:
① If there are binary control file backup, restore from backup control file,
② If there is no backup, use trace script file to re-create the control file (a price: the loss of archived records and information RMAN information)
3.5.2 rebuild control file example
The first step , Mount or open generate lower trace script
SQL>alter database backup controlfile to trace as '/u01/oradata/prod/con.trace';
The second step, start to nomount state ready to perform trace script
SQL> startup force nomount
The third step is to perform rebuild the control file statements
SQL>CREATE CONTROLFILE REUSE DATABASE "prod" NORESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/u01/oradata/prod/redo01.log' SIZE 50M,
GROUP 2 '/u01/oradata/prod/redo02.log' SIZE 50M,
GROUP 3 '/u01/oradata/prod/redo03.log' SIZE 50M
-- STANDBY LOGFILE
DATAFILE
'/u01/oradata/prod/system01.dbf',
'/u01/oradata/prod/sysaux01.dbf',
'/u01/oradata/prod/users01.dbf',
'/u01/oradata/prod/example01.dbf',
'/u01/oradata/prod/test01.dbf',
'/u01/oradata/prod/undotbs01.dbf'
CHARACTER SET ZHS16GBK
;
We can see the implementation of the three control files and re-established. At this time the database is in mount under
Description: This reconstruction process control file has two main parts content:
The first part is visible information in the script:
1) defined db_name,
2) specify several parameters defining the maximum control file,
3) physical information online log,
4) physical information of the data file,
5) character set used.
The second part is implied invisible information, such as SCN information, reconstruct the most current copy of all the data file header SCN copy the information to the control file. Next, in order to open the database.
SQL> select file#,checkpoint_change# from v$datafile;
SQL> select file#,checkpoint_change# from v$datafile_header;
The fourth step, open the database
SQL> alter database open;
The fifth step, add temporary data file information (the last line of the script)
SQL> ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/oradata/prod/temp01.dbf'
SIZE 30408704 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M;