Test the use of the alterdatabasebackupcontrolfiletotrace command to back up the oracle10g control file and restore the control file if the control file is lost-Backup
Test the use of the alter database backup controlfile to trace command to back up the oracle10g control file and restore the control file if the control file is lost-backup
Test the use of the alter database backup controlfile to trace command to back up the Oracle10g Control File
And restore the control file when the control file is lost-backup control file
View the default path of alter database backup controlfile to trace
SQL> show parameter user_dump_dest;
NAME TYPE VALUE
-----------------------------------------------------------------------------
User_dump_dest string/data/oracle/admin/asp/udump
This is the default backup location of the following backup control file statement.
Partially mark the corresponding statement for creating the control file:
Note that two situations are recorded:
Set #1. NORESETLOGS case
--
-- The following commands will create a new control file and use it
-- To open the database.
-- Data used by Recovery Manager will be lost.
-- Additional logs may be required for media recovery of offline
-- Use this only if the current versions of all online logs are
-- Available.
-- After mounting the created controlfile, the following SQL
-- Statement will place the database in the appropriate
-- Protection mode:
-- ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE
;
-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- Disk. Any one log file from each branch can be used
-- Re-create incarnation records.
-- Alter database register logfile '/data/archive/redhat10g_424562360180_1.dbf ';
-- Alter database register logfile '/data/archive/redhat10g_1_817828234_1.dbf ';
-- Recovery is required if any of the datafiles are restored backups,
-- Or if the last shutdown was not normal or immediate.
RECOVER DATABASE
-- Set Database Guard and/or Supplemental Logging
Alter database add supplemental log data;
-- 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 '/data/oracle/oradata/asp/temp01.dbf'
SIZE 20971520 reuse autoextend on next 655360 MAXSIZE 32767 M;
-- End of tempfile additions.
--
-- Set #2. RESETLOGS case
--
-- The following commands will create a new control file and use it
-- To open the database.
-- Data used by Recovery Manager will be lost.
-- The contents of online logs will be lost and all backups will
-- Be invalidated. Use this only if online logs are damaged.
-- After mounting the created controlfile, the following SQL
-- Statement will place the database in the appropriate
-- Protection mode:
-- ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE
STARTUP NOMOUNT
Create controlfile reuse database "ASP" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
# MAXLOGHISTORY 292
LOGFILE
GROUP 1'/data/oracle/oradata/asp/redo01.log' SIZE 50 M,
GROUP 2'/data/oracle/oradata/asp/redo02.log 'SIZE 50 M,
GROUP 3 '/data/oracle/oradata/asp/redo03.log' SIZE 50 M
-- STANDBY LOGFILE
DATAFILE
'/Data/oracle/oradata/asp/system01.dbf ',
'/Data/oracle/oradata/asp/undotbs01.dbf ',
'/Data/oracle/oradata/asp/sysaux01.dbf ',
'/Data/oracle/oradata/asp/users01.dbf ',
'/Data/oracle/oradata/asp/dgbc01.dbf ',
'/Data/oracle/oradata/asp/dgbc02.dbf ',
'/Data/oracle/oradata/asp/dgbc03.dbf ',
'/Data/oracle/oradata/asp/dgbc04.dbf ',
'/Data/oracle/oradata/asp/dgbc05.dbf ',
'/Data/oracle/oradata/asp/dgbc06.dbf'
Character set WE8ISO8859P1
;
-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- Disk. Any one log file from each branch can be used
-- Re-create incarnation records.
-- Alter database register logfile '/data/archive/redhat10g_424562360180_1.dbf ';
-- Alter database register logfile '/data/archive/redhat10g_1_817828234_1.dbf ';
-- Recovery is required if any of the datafiles are restored backups,
-- Or if the last shutdown was not normal or immediate.
RECOVER DATABASE USING BACKUP CONTROLFILE
-- Set Database Guard and/or Supplemental Logging
Alter database add supplemental log data;
-- Database can now be opened zeroing the online logs.
Alter database open resetlogs;
-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
Alter tablespace temp add tempfile '/data/oracle/oradata/asp/temp01.dbf'
SIZE 20971520 reuse autoextend on next 655360 MAXSIZE 32767 M;
-- End of tempfile additions.
--
Next, manually restore the control file from the backup text file.
,