Table space.txt create temporary tablespace test_temp01
Tempfile 'G: \ rman_test \ data \ test_temp01.dbf' size 32 m autoextend on next 32 m maxsize 2048 M extent management local; // create tablespace test_data01logging datafile 'G: \ rman_test \ data \ test_data01.dbf 'size 32 m autoextend on next 32 m maxsize
2048 M extent management local; // create a user and specify the tablespace create user test_01 identified by testdefault tablespace test_data01 temporary tablespace test_temp01; // grant the user permission to grant connect, resource to test_01; create test_1 (username varchar (20), telnum varchar (11); insert
Test_1 values ('hangsan ', '20150101'); insert into test_1 values ('hangww', '20160301'); insert into test_1 values ('lisi', '20160301 '); commit;
Db_fullbak_orcl.bat
Set oracle_sid = orclrman target/log G: \ rman_test \ backup_data \ Bak _ % Date :~ 0, 10%. Log partition file = G: \ rman_test \ db_fullbak_orcl.rman
Db_fullbak_orcl.rman
Run {configure retention policy to recovery window of 14 days; configure controlfile autobackup on; configure controlfile autobackup format for device type disk to 'G: \ rman_test \ backup_data \ % F '; allocate channel C1 device type disk format 'G: \ rman_test \ backup_data \ Bak _ % U'; backup database skip inaccessible filesperset 10 plus archivelog filesperset 20 delete all input; release channel C1 ;} allocate channel for maintenance device type disk; crosscheck backupset; Delete noprompt obsolete;
Backup is available in archive mode to restore lost data files.
1. confirm that you are in archive mode.
Change non-archive mode to archive mode:
1) SQL> shutdown normal/immediate;
2) SQL> Start Mount;
3) SQL> alter database archivelog;
4) SQL> alter database open;
2. Run db_fullbak_orcl.bat.
3. Execute the table space.txt script.
4. Loss of simulated files
5. The database cannot be started normally after the file is lost.
G: \ rman_test \ data \ test_data01.dbf stores the table test_1 of test_01.
At this time, you must use RMAN to restore the G: \ rman_test \ data \ test_data01.dbf file.
6. Restore with RMAN
7. Open the database.
It can be opened normally.
8. Verify that the data has been restored.
9. Verify that the G: \ rman_test \ data \ test_data01.dbf file has been restored.
End!