[实验-视频过程]RMAN备份和恢复

来源:互联网 时间:1970-01-01

RMAN备份和恢复

1、进入rman

[[email protected] orcl]$ rman target /

2、查看原来的备份

RMAN> list backup; using target database control file instead of recovery catalog List of Backup Sets =================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 1 Full 1.12G DISK 00:00:14 19-OCT-15 BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20151019T175040 Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/backupset/2015_10_19/o1_mf_nnndf_TAG20151019T175040_c29h7k27_.bkp List of Datafiles in backup set 1 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 Full 3548842 19-OCT-15 /u01/app/oracle/oradata/orcl/system01.dbf 2 Full 3548842 19-OCT-15 /u01/app/oracle/oradata/orcl/sysaux01.dbf 3 Full 3548842 19-OCT-15 /u01/app/oracle/oradata/orcl/undotbs01.dbf 4 Full 3548842 19-OCT-15 /u01/app/oracle/oradata/orcl/users01.dbf 5 Full 3548842 19-OCT-15 /u01/app/oracle/oradata/orcl/example01.dbf 6 Full 3548842 19-OCT-15 BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 2 Full 9.67M DISK 00:00:01 19-OCT-15 BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20151019T175040 Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/backupset/2015_10_19/o1_mf_ncsnf_TAG20151019T175040_c29h818k_.bkp SPFILE Included: Modification time: 19-OCT-15 SPFILE db_unique_name: ORCL Control File Included: Ckp SCN: 3548854 Ckp time: 19-OCT-15

3、为了实验干净,删除原来备份,重新建立备份

RMAN> delete backup; 删除文件目录 [[email protected] orcl]$ cd /u01/app/oracle/flash_recovery_area/ORCL/backupset/ [[email protected] backupset]$ rm -rf *

4、重新备份数据库

backup database; 5、切换日志 sql 'alter system archive log current';

6模拟事故 、删除所有数据文件

cd /u01/app/oracle/oradata/orcl rm *.dbf

7、恢复

[[email protected] orcl]$ rman target / RMAN> startup mount; RMAN> restore database; RMAN> recover database; RMAN> alter database open;

作者:xuejiayue1105 发表于2015/10/19 18:40:29 原文链接

阅读:9 评论:0 查看评论



相关阅读:
Top