1. Set the storage location of the backup file, and automatically backup the control file during Backup
C: \ Documents ents and Settings \ wwang> rman target/-- backup on the target database
Recovery MANAGER: Release 11.2.0.1.0-Production on Monday July 2 22:15:57 2012
Copyright (c) 1982,200 9, Oracle and/or its affiliates. All rights reserved.
Connect to the target database: MDSP (DBID = 663168021)
RMAN> configure controlfile autobackup on;
New RMAN configuration parameters:
Configure controlfile autobackup on;
The new RMAN configuration parameters are successfully stored.
RMAN> configure controlfile autobackup format for device type disk to 'd: \ testrman \ control \ % F ';
New RMAN configuration parameters:
Configure controlfile autobackup format for device type disk to 'd: \ testrman \ control \ % F ';
The new RMAN configuration parameters are successfully stored.
RMAN> configure channel device type disk format 'd: \ testrman \ % D _ % u _ % T ';
New RMAN configuration parameters:
Configure channel device type disk format 'd: \ testrman \ % D _ % u _ % T ';
The new RMAN configuration parameters are successfully stored.
RMAN>
2. Create a test table and insert records before the raman backup.
SQL> create table rman (a varchar2 (20 ));
The table has been created.
SQL> insert into rman values ('before raman backup ');
One row has been created.
SQL> commit;
Submitted.
SQL> alter system archive log current;
The system has been changed.
SQL>
3. Use rman to back up the entire database, including the control file spfile archive log
RMAN> backup database plus archivelog;
Start backup from to 12
The current log is archived.
Use channel ORA_DISK_1
Channel ORA_DISK_1: archiving log backup set is being started
Channel ORA_DISK_1: archiving logs in the specified backup set
Input archiving log thread = 1 sequence = 44 RECID = 1 STAMP = 787522131
Input archiving log thread = 1 sequence = 45 RECID = 2 STAMP = 787522334
Input archiving log thread = 1 sequence = 46 RECID = 3 STAMP = 787607657
Input archiving log thread = 1 sequence = 47 RECID = 4 STAMP = 787611335
Input archiving log thread = 1 sequence = 48 RECID = 5 STAMP = 787611478
Input archiving log thread = 1 sequence = 49 RECID = 6 STAMP = 787611636
Input archiving log thread = 1 sequence = 50 RECID = 7 STAMP = 787611800
Channel ORA_DISK_1: Starting segment 1 from March 7 to April 12
Channel ORA_DISK_1: Completed segment 1 in March 7-12
Segment handle = D: \ TESTRMAN \ MDSP_0DNF404P_20120702 mark = TAG20120702T210321 comment = NONE
Channel ORA_DISK_1: Backup set completed. elapsed time: 00: 00: 07
Backup completed from to 12
Start backup from to 12
Use channel ORA_DISK_1
Channel ORA_DISK_1: starting all data file backup Sets
Channel ORA_DISK_1: Specifies the data file in the backup set.
Input data file: File No. = 00001 name = D: \ APP \ WWANG \ ORADATA \ MDSP \ SYSTEM01.DBF
Input data file: File No. = 00002 name = D: \ APP \ WWANG \ ORADATA \ MDSP \ SYSAUX01.DBF
Input data file: File No. = 00003 name = D: \ APP \ WWANG \ ORADATA \ MDSP \ UNDOTBS01.DBF
Input data file: File No. = 00005 name = D: \ APP \ WWANG \ ORADATA \ MDSP \ IMUSE01.DBF
Input data file: file number = 00006 name = D: \ APP \ WWANG \ ORADATA \ MDSP \ JACK. DBF
Input data file: File No. = 00004 name = D: \ APP \ WWANG \ ORADATA \ MDSP \ USERS01.DBF
Input data file: file number = 00007 name = D: \ APP \ WWANG \ ORADATA \ MDSP \ TEST. DBF
Channel ORA_DISK_1: Starting segment 1 from March 7 to April 12
Channel ORA_DISK_1: Completed segment 1 in March 7-12
Segment handle = D: \ TESTRMAN \ MDSP_0ENF4051_20120702 flag = TAG20120702T210329 comment = NONE
Channel ORA_DISK_1: Backup set completed. elapsed time: 00: 03: 08
Backup completed from to 12
Start backup from to 12
The current log is archived.
Use channel ORA_DISK_1
Channel ORA_DISK_1: archiving log backup set is being started
Channel ORA_DISK_1: archiving logs in the specified backup set
Input archiving log thread = 1 sequence = 51 RECID = 8 STAMP = 787611999
Channel ORA_DISK_1: Starting segment 1 from March 7 to April 12
Channel ORA_DISK_1: Completed segment 1 in March 7-12
Segment handle = D: \ TESTRMAN \ MDSP_0FNF40AV_20120702 mark = tag20120702t2000039 comment = NONE
Channel ORA_DISK_1: Backup set completed. elapsed time: 00: 00: 01
Backup completed from to 12
Start Control File and SPFILE Autobackup from to 12
Segment handle = D: \ TESTRMAN \ CONTROL \ C-663168021-20120702-01 comment = NONE
Complete the Control File and SPFILE Autobackup in the range of months from to 12.
RMAN>
4. Insert a record to the table empty again after the backup is complete (note that this record is not in the backup file)
SQL> insert into rman values ('after raman backup ');
One row has been created.
SQL> commit;
Submitted.
SQL> select * from rman;
A
----------------------------------------
Before raman backup
After raman backup
SQL>
5. The structure is damaged. Use dbca to delete the entire database (copy the log file before deleting it, and insert a piece of data into the log file). The instance is deleted.