oracle在archivelog模式进行rman备份和恢复

归档模式下的数据库恢复数据的时候还需要将归档日志内容应用到数据上面

1.确认数据库为归档模式

select log_mode from v$database;

2.通过rman备份USERS表空间

RMAN>run{
allocate channel ch_1 type disk;
allocate channel ch_2 type disk;
backup tablespace users
format '/backup/usersTablespace.bak';
}

3.模拟USERS01.dbf被删除或介质故障

将user01.dbf重命名即可

因为我们模拟的时候没有关闭数据库,所以无法正常关闭数据库,只能用shutdown abort;

扫描二维码关注公众号,回复: 12710525 查看本文章

4.开始恢复

首先启动数据库为mount模式

startup mount;

然后进入rman执行恢复命令;

RMAN>run{
allocate channel ch_1 type disk;
restore tablespace users;
recover tablespace users;
}

最后启动数据库看看是否能正常启动

alter database open;

猜你喜欢

转载自blog.csdn.net/zetion_3/article/details/114398185