Oracle reconstruction control file-Rebuild controlfile
The DBA needs to know when recreating the control file, but it may not be able to reproduce the system throughout his career.
First of all, it is emphasized that backup is the safest, quickest, and effective recovery method. If a DBA does not plan an effective backup, he will be awakened by a nightmare one day.
After waking up, It is helpless, complicated and manual recovery. In addition, to what level of recovery, you have to look at the day and life, but you can't look at yourself. Because there is no backup, you have completely handed over the initiative to others. Record the reconstruction of controlfile
Create controlfile trace on other normal Databases
SQL> alter database backup controlfile to trace;
Specifies the path for generating the trace file
SQL> alter database backup controlfile to trace as '/tmp/controlfile. trc'; the trace file path is under user_dump_dest.
SQL> show parameter user_dump_dest
NAME TYPE VALUE
--------------------------------------------------------------------
User_dump_dest string/home/Oracle/admin/R10105/udump/
After navigating to the directory locate the latest trace file by date/time by issuing: ls-ltr.
% Cd/home/oracle/admin/R10105/udump/
% Ls-ltr
For a complete trace, see the attachment.
You can modify the path and other specific parameter values of the trace file and extract the creation script
STARTUP NOMOUNT
Create controlfile reuse database "R10105" NORESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
# MAXLOGHISTORY 454
LOGFILE
GROUP 1'/opt/oracle/oradata/R10105/redo01.log' SIZE 10 M,
GROUP 2 '/opt/oracle/oradata/R10105/redo02.log' SIZE 10 M,
GROUP 3 '/opt/oracle/oradata/R10105/redo03.log' SIZE 10 M
-- STANDBY LOGFILE
DATAFILE
'/Opt/oracle/oradata/R10105/system01.dbf ',
'/Opt/oracle/oradata/R10105/undotbs01.dbf ',
'/Opt/oracle/oradata/R10105/sysaux01.dbf ',
'/Opt/oracle/oradata/R10105/users01.dbf ',
'/Opt/oracle/oradata/R10105/example01.dbf'
Character set AL32UTF8
;
Register archivelog
-- Alter database register logfile '/home/oracle/flash_recovery_area/R10105/archivelog/2012_06_15/o1_mf_1_1 _ % u _. arc ';
-- Alter database register logfile '/home/oracle/flash_recovery_area/R10105/archivelog/2012_06_15/o1_mf_1_1 _ % u _. arc ';
-- Recovery is required if any of the datafiles are restored backups,
-- Or if the last shutdown was not normal or immediate.
RECOVER DATABASE
-- All logs need archiving and a log switch is needed.
Alter system archive log all;
-- Database can now be opened normally.
Alter database open;
-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
Alter tablespace temp add tempfile '/opt/oracle/oradata/R10105/temp01.dbf'
SIZE 20971520 reuse autoextend on next 655360 MAXSIZE 32767 M;
-- End of tempfile additions.
--
In fact, rebuilding the control file is equivalent to manually re-creating the database, adding existing database resources to the controlfile one by one, and finally registering the current archivelog file.
At the same time, the reconstruction of controlfile can be divided into NORESETLOGS and RESETLOGS. Select the corresponding script as needed.
At the end of the day, it was a nightmare to back up the data effectively and be prepared !!
Attachment:
Oracle reconstruction control file-Rebuild controlfile
Https://www.bkjia.com/topicnews.aspx? Tid = 12
This article permanently updates link: https://www.bkjia.com/Linux/2018-03/151561.htm