Today, a friend asked the machine to see a file sncforcl. ora in multiple places. The file is not small, and each file has dozens of MB, which is of the same size.
SNCF {Sid}. ora is a snapshot of the RMAN control file. When RMAN information is stored in the control file, RMAN uses this snapshot file to maintain the backup information.
RMAN> connect target sys/admin @ PISC
Connect to the target database: PISC (dbid = 588620064)
RMAN> show snapshot controlfile name;
Use the target database control file to replace the recovery directory
RMAN configuration parameters:
Configure snapshot controlfile name to 'd: oracle10gr2databasesncfpisc. ora '; # default
In fact, when the control file is corrupted, you can use this snapshot to restore the control file and then restore the database. The following is a test process in the itpub forum.
Certificate ------------------------------------------------------------------------------------------------------------------------------------------------
1. Back up data first, without using catalog
F: \ oracle \ bin> RMAN target/nocatalog
Recovery MANAGER: Version 10.1.0.4.0-Production
Copyright (c) 1995,200 4, Oracle. All rights reserved.
Connect to the target database: market2 (dbid = 2894056775)
Using the target database control file instead of restoring directory
RMAN> show all;
RMAN configuration parameters:
Configure retention policy to redundancy 1; # default
Configure backup optimization off; # default
Configure Default device type to disk; # default
Configure controlfile autobackup on;
Configure controlfile autobackup format for device type disk to 'H: \ rmanback \ spctl \ 2894056775 _ % F. C
TL ';
Configure device type disk parallelism 1 Backup Type to backupset; # default
Configure datafile backup copies for device type disk to 1; # default
Configure archivelog backup copies for device type disk to 1; # default
Configure maxsetsize to unlimited; # default
Configure archivelog deletion policy to none; # default
Configure snapshot controlfile name to 'f: \ oracle \ database \ sncfpsi2.ora '; # default
RMAN>
RMAN> RUN
2> {allocate channel D1 type disk;
3> Backup as compressed backupset incremental level = 0 Database
4> Format 'H: \ rmanback \ Level \ level _ % d % S % P % T % T ';
5> SQL 'alter system archive log current ';
6> release channel D1;
7>}
Allocated channel: d1
Channel D1: SID = 137 devtype = Disk
Start backup at 11:54:58
Channel D1: Start the compressed incremental level 0 data file backup set
Channel D1: data files in the specified backup set
Input data file fno = 00002 name = H: \ oraclelog \ ASM \ market2 \ datafile \ o1_mf_undotbs1_2m6mnhd6_.dbf
Input data file fno = 00006 name = H: \ oraclelog \ ASM \ market2 \ datafile \ o1_mf_bd_cuman_2m6mq4hn_.dbf
Input data file fno = 00001 name = H: \ oraclelog \ ASM \ market2 \ datafile \ o1_mf_system_2m6mown0_.dbf
Input data file fno = 00009 name = H: \ oraclelog \ ASM \ market2 \ datafile \ o1_mf_sysaux_2m6mr1_ B _.dbf
Input data file fno = 00005 name = H: \ oraclelog \ ASM \ market2 \ datafile \ o1_mf_tools_2m6mslpg_.dbf
Input data file fno = 00004 name = H: \ oraclelog \ ASM \ market2 \ datafile \ o1_mf_indx_2m6mt2c7_.dbf
Input data file fno = 00003 name = H: \ oraclelog \ ASM \ market2 \ datafile \ o1_mf_drsys_2m6mtb1y_.dbf
Channel D1: Starting segment 1 at 11:55:03
Channel D1: Completed segment 1 at 12:02:10
Segment handle = H: \ rmanback \ Level \ level_market223516057933037961106 comment = none
Channel D1: Backup set completed. elapsed time: 00: 07: 10
Backup completed at 12:02:11
Start Control File and spfile autobackup at 12:02:12
Segment handle = H: \ rmanback \ spctl \ 2894056775_c-2894056775-20061106-00.ctl comment = none
Control File and spfile autobackup completed at 12:02:29
SQL statement: Alter system archive log current
Released channel: d1
RMAN> exit
Create an object after the backup.
Sys @ Pi2> connect Test2/1
Connected.
Test2 @ Pi2> select * From tab;
Tname tabtype clusterid
-----------------------------------------------
Gl_detail table
Gl_detail2 table
Test2 @ Pi2> Create Table gl_detail3 as select * From gl_detail where rownum <= 1000;
The table has been created.
Take the time point and only restore to this
Test2 @ Pi2> select sysdate from dual;
Sysdate
-------------------
2006-11-06 14:19:09
The gl_detail4 table is not restored.
Test2 @ Pi2> Create Table gl_detail4 as select * From gl_detail where rownum <= 1000;
The table has been created.
Test2 @ Pi2> connect/As sysdba
Connected.
Sys @ Pi2> alter system archive log current;
The system has been changed.
Sys @ Pi2> archive log list;
Database Log mode archiving Mode
Enable automatic archiving
Archiving end point use_db_recovery_file_dest
Oldest online log sequence 13965
Next archive log sequence 13967
Current Log sequence 13967
Sys @ Pi2> shutdown immediate;
The database has been closed.
The database has been detached.
The Oracle routine has been disabled.
The recovery manager is complete.
F: \ oracle \ bin> RMAN target/nocatalog
Recovery MANAGER: Version 10.1.0.4.0-Production
Copyright (c) 1995,200 4, Oracle. All rights reserved.
Connected to the target database (not started)
RMAN> startup nomount;
Oracle routine started
The system's global region consists of 448790528 bytes.
Fixed size 789648 bytes
Variable Size 212857712 bytes
Database buffers: 234881024 bytes
Redo buffers: 262144 bytes
Restore with a snapshot of the Control File
RMAN> restore controlfile from 'f: \ oracle \ database \ sncfpsi2.ora ';
Start restore on 14:25:32
Allocated channel: ora_disk_1
Channel ora_disk_1: SID = 160 devtype = Disk
Channel ora_disk_1: control file copy copied
Output file name = D: \ oracle \ oradata \ market2 \ control01.ctl
Output file name = D: \ oracle \ oradata \ market2 \ control02.ctl
Output file name = D: \ oracle \ oradata \ market2 \ control03.ctl
Restore completed at 14:25:40
RMAN> alter database Mount;
Database loaded
Released channel: ora_disk_1
RMAN> RUN
2> {allocate channel D1 type disk;
3> set until time '2017-11-06 14:19:09 '; -- specify the recovery time
4> Restore database;
5> recover database;
6> release channel D1;
7>}
Allocated channel: d1
Channel D1: SID = 160 devtype = Disk
Executing command: set until clause
Start restore on 14:27:34
Start implicit crosscheck backup at 14:27:34
Four objects that have been cross-checked
Implicit crosscheck backup completed at 14:27:50
Start implicit crosscheck copy on 14:27:50
Implicit crosscheck Copy completed on 14:27:57
Search for all files in the recovery area
Compiling file directory...
Directory compilation completed
List of files included in the directory
======================================
File Name: H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13953_2nxfjo98_.arc
File Name: H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13954_2nxg3ch4_.arc
File Name: H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13955_2nxgpb5v_.arc
File Name: H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13956_2nxh97yr_.arc
File Name: H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13957_2nxhw52x_.arc
File Name: H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13958_2nxjh57b_.arc
File Name: H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13959_2nxk2289_.arc
File Name: H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13960_2nxknvg5_.arc
File Name: H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13961_2nxl7hh4_.arc
File Name: H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13962_2nxltcjm_.arc
File Name: H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13963_2nxmf1k2_.arc
File Name: H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13964_2nxmzrpg_.arc
File Name: H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13965_2nxnlgnz_.arc
File Name: H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13966_2nxo0ocq_.arc
Channel D1: starting to recover the data file backup set
Channel D1: Specifies the data file to be recovered from the backup set
Restoring data file 00001 to H: \ oraclelog \ ASM \ market2 \ datafile \ o1_mf_system_2m6mown0_.dbf
Restoring data file 00002 to H: \ oraclelog \ ASM \ market2 \ datafile \ o1_mf_undotbs1_2m6mnhd6_.dbf
Restoring data file 00003 to H: \ oraclelog \ ASM \ market2 \ datafile \ o1_mf_drsys_2m6mtb1y_.dbf
Restoring data file 00004 to H: \ oraclelog \ ASM \ market2 \ datafile \ o1_mf_indx_2m6mt2c7_.dbf
Restoring data file 00005 to H: \ oraclelog \ ASM \ market2 \ datafile \ o1_mf_tools_2m6mslpg_.dbf
Restoring data file 00006 to H: \ oraclelog \ ASM \ market2 \ datafile \ o1_mf_bd_cuman_2m6mq4hn_.dbf
Restoring data file 00009 to H: \ oraclelog \ ASM \ market2 \ datafile \ o1_mf_sysaux_2m6mr1_ B _.dbf
Channel D1: recovered backup segment 1
Segment handle = H: \ rmanback \ Level \ level_market223516057933042561106 mark = tag20061106t115500
Channel D1: Recovery complete
Restore completed at 14:37:14
Start recover at 14:37:15
Restoring media...
The archive log thread 1 sequence 13952 is used as the file H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13952 _
2nxdyrrw_.arc exists on the disk
The archive log thread 1 sequence 13953 is used as the file H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13953 _
2nxfjo98_.arc exists on the disk
The archive log thread 1 sequence 13954 is used as the file H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13954 _
2nxg3ch4_.arc exists on the disk
The archive log thread 1 sequence 13955 is used as the file H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13955 _
2nxgpb5v_.arc exists on the disk
The archive log thread 1 sequence 13956 is used as the file H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13956 _
2nxh97yr_.arc exists on the disk
The archive log thread 1 sequence 13957 is used as the file H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13957 _
2nxhw52x_.arc exists on the disk
The archive log thread 1 sequence 13958 is used as the file H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13958 _
2nxjh57b_.arc exists on the disk
The archive log thread 1 sequence 13959 is used as the file H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13959 _
2nxk2289_.arc exists on the disk
The archive log thread 1 sequence 13960 is used as the file H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13960 _
2nxknvg5_.arc exists on the disk.
The archive log thread 1 sequence 13961 is used as the file H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13961 _
2nxl7hh4_.arc exists on the disk
The archive log thread 1 sequence 13962 is used as the file H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13962 _
2nxltcjm_.arc exists on the disk
The archive log thread 1 sequence 13963 is used as the file H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13963 _
2nxmf1k2_.arc exists on the disk
The archive log thread 1 sequence 13964 is used as the file H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13964 _
2nxmzrpg_.arc exists on the disk
The archive log thread 1 sequence 13965 is used as the file H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13965 _
2nxnlgnz_.arc exists on the disk
The archive log thread 1 sequence 13966 is used as the file H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13966 _
2nxo0ocq_.arc exists on the disk
Archive log file name = H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13952_2nxdyrrw_.arc thread = 1
Sequence = 13952
Archive log file name = H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13953_2nxfjo98_.arc thread = 1
Sequence = 13953
Archive log file name = H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13954_2nxg3ch4_.arc thread = 1
Sequence = 13954
Archive log file name = H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13955_2nxgpb5v_.arc thread = 1
Sequence = 13955
Archive log file name = H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13956_2nxh97yr_.arc thread = 1
Sequence = 13956
Archive log file name = H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13957_2nxhw52x_.arc thread = 1
Sequence = 13957
Archive log file name = H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13958_2nxjh57b_.arc thread = 1
Sequence = 13958
Archive log file name = H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13959_2nxk2289_.arc thread = 1
Sequence = 13959
Archive log file name = H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13960_2nxknvg5_.arc thread = 1
Sequence = 13960
Archive log file name = H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13961_2nxl7hh4_.arc thread = 1
Sequence = 13961
Archive log file name = H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13962_2nxltcjm_.arc thread = 1
Sequence = 13962
Archive log file name = H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13963_2nxmf1k2_.arc thread = 1
Sequence = 13963
Archive log file name = H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13964_2nxmzrpg_.arc thread = 1
Sequence = 13964
Archive log file name = H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13965_2nxnlgnz_.arc thread = 1
Sequence = 13965
Archive log file name = H: \ oraclelog \ ASM \ market2 \ archivelog \ 2006_11_06 \ o1_mf_1_13966_2nxo0ocq_.arc thread = 1
Sequence = 13966
Restore Media
Recover completed at 14:39:33
Released channel: d1
Sys @ Pi2> archive log list;
Database Log mode archiving Mode
Enable automatic archiving
Archiving end point use_db_recovery_file_dest
Oldest online log sequence 13965
Next archive log sequence 13967
Current Log sequence 13967
Sys @ Pi2> shutdown immediate;
The database has been closed.
The database has been detached.
The Oracle routine has been disabled.
Sys @ psi2.>
Sys @ Pi2> connect Test2/1
Connected.
Test2 @ Pi2> select table_name from tabs; -- if no gl_detail4 table exists, it indicates that incomplete recovery is successful.
Table_name
------------------------------
Gl_detail2
Gl_detail
Gl_detail3
Test2 @ psi2.>