RMAN备份前环境配置。
1.连接到目标数据库
[img]http://dl.iteye.com/upload/attachment/198719/b7c9ddb6-5aad-32bb-814c-5dbca8305e50.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/198721/f384067c-20c2-30ac-9912-59fa50060b3b.jpg[/img]
2.启用控制文件自动备份
[img]http://dl.iteye.com/upload/attachment/198723/e0bb84c0-81b1-3fa1-81ad-a1ea8ab297d2.jpg[/img]
3.配置自动备份的存放位置
[img]http://dl.iteye.com/upload/attachment/198725/44eb1a19-26d7-3f17-8e50-83bd0e55086b.jpg[/img]
4.配置控制文件的快照存放位置:
[img]http://dl.iteye.com/upload/attachment/198727/8efc9d47-5a55-3986-8a38-fbab764d2e2d.jpg[/img]
5.修改备份格式为copy
[img]http://dl.iteye.com/upload/attachment/198728/bb53c752-2df2-347c-a4f2-bdf19c3e5f50.jpg[/img]
7.配置缺省介质是磁盘备份
8.配置缺省备份是压缩方式:
[img]http://dl.iteye.com/upload/attachment/198731/efc6a592-05d9-36d7-b07a-1b373c555e2c.jpg[/img]
9.配置缺省备份位置及名称
[img]http://dl.iteye.com/upload/attachment/198733/d8b072ad-c507-381e-928c-852ec8c4a124.jpg[/img]
----配置备份保留策略-----
10.基于恢复窗口,7天
[img]http://dl.iteye.com/upload/attachment/198735/84626616-e51b-387d-a96b-b800919fb265.jpg[/img]
11.基于冗余策略,每个文件至少保留2份
[img]http://dl.iteye.com/upload/attachment/198737/fbe40324-1148-3571-b02b-ed6fd9ad54ae.jpg[/img]
12.查看备份策略:
13.查看过期的备份文件
14.清空备份策略:
15.根据备份策略,删除过期备份
[img]http://dl.iteye.com/upload/attachment/198739/cc659fd2-b644-3ad3-afce-4a3c6b2e8788.jpg[/img]
16.恢复上面的配置为默认值:configure ..... clear
[img]http://dl.iteye.com/upload/attachment/198741/23a25ab3-d132-370e-a833-c7e2db9c1b23.jpg[/img]
1.连接到目标数据库
rman target user/password@yourdbname
[img]http://dl.iteye.com/upload/attachment/198719/b7c9ddb6-5aad-32bb-814c-5dbca8305e50.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/198721/f384067c-20c2-30ac-9912-59fa50060b3b.jpg[/img]
2.启用控制文件自动备份
configure controlfile autobackup on;
[img]http://dl.iteye.com/upload/attachment/198723/e0bb84c0-81b1-3fa1-81ad-a1ea8ab297d2.jpg[/img]
3.配置自动备份的存放位置
configure controlfile autobackup format for device type disk to 'D:\database\backup\autobackupcontrole/autobackup_controle_%F';
[img]http://dl.iteye.com/upload/attachment/198725/44eb1a19-26d7-3f17-8e50-83bd0e55086b.jpg[/img]
4.配置控制文件的快照存放位置:
configure snapshot controlfile name to 'D:\database\backup\backupsnapshot\s%U';
[img]http://dl.iteye.com/upload/attachment/198727/8efc9d47-5a55-3986-8a38-fbab764d2e2d.jpg[/img]
5.修改备份格式为copy
configure device type disk backup type to copy;
[img]http://dl.iteye.com/upload/attachment/198728/bb53c752-2df2-347c-a4f2-bdf19c3e5f50.jpg[/img]
7.配置缺省介质是磁盘备份
configure default device type to disk;
8.配置缺省备份是压缩方式:
configure device type disk backup type to compressed backupset;
[img]http://dl.iteye.com/upload/attachment/198731/efc6a592-05d9-36d7-b07a-1b373c555e2c.jpg[/img]
9.配置缺省备份位置及名称
configure channel 1 device type disk format 'D:\database\backup\102wxxrdb\%U';
[img]http://dl.iteye.com/upload/attachment/198733/d8b072ad-c507-381e-928c-852ec8c4a124.jpg[/img]
----配置备份保留策略-----
10.基于恢复窗口,7天
configure retention policy to recovery window of 7 days;
[img]http://dl.iteye.com/upload/attachment/198735/84626616-e51b-387d-a96b-b800919fb265.jpg[/img]
11.基于冗余策略,每个文件至少保留2份
configure retention policy to redundancy 2;
[img]http://dl.iteye.com/upload/attachment/198737/fbe40324-1148-3571-b02b-ed6fd9ad54ae.jpg[/img]
12.查看备份策略:
show retention policy;
13.查看过期的备份文件
report obsolete;
14.清空备份策略:
configure retention policy to none;
15.根据备份策略,删除过期备份
delete obsolete;
[img]http://dl.iteye.com/upload/attachment/198739/cc659fd2-b644-3ad3-afce-4a3c6b2e8788.jpg[/img]
16.恢复上面的配置为默认值:configure ..... clear
configure controlfile autobackup format for device type disk clear;
[img]http://dl.iteye.com/upload/attachment/198741/23a25ab3-d132-370e-a833-c7e2db9c1b23.jpg[/img]