标签:blog http io ar os 使用 for sp strong
rman是最经济实惠的oracle备份工具,在这里做一个rman的整体学习。
文章中大多是rman命令的语法,还是最好做做实验,以便印象深刻,因为大多数数据库的备份就是按时跑脚本,恢复也不是经常能遇到,时间长了就会生疏,多多复习吧。
[terry笔记]RMAN综合学习之备份http://www.cnblogs.com/kkterry/p/3308405.html
[terry笔记]RMAN综合学习之恢复 http://www.cnblogs.com/kkterry/p/3308407.html
[terry笔记]RMAN综合学习之配置 http://www.cnblogs.com/kkterry/p/3308409.html
一、rman如何连接:
1)RMAN>backup database; 2)RMAN>run{…}; 3)rman target / @backup.sql 4)rman target / cmdfile=backup.sql 5)RMAN>@backup.sql
1)backup database; /*备份整个数据库。*/ 2)backup database format ‘/backup/back_%U‘; /*加上format参数,即可自定义路径和命名方式。*/ 3)list backup of database; /*查看备份信息。*/ 4)delete backupset x; /*删除某个备份集,会给出删除确认提示,如果不希望有提示加上noprompt。*/
1)backup current controlfile; 2)backup database include current controlfile; 3)configure controlfile autobackup on; 4)list backup of controlfile;
1)backup archivelog all; 2)backup current controlfile plus archivelog; 3)backup archivelog all delete all input; /*加上delete all input参数,备份完后自动删除归档。*/
1)backup spfile;
1)backup backupset all delete all input; 2)backup backupset n,n,n delete all input;
1)backup incremental level 0 database; 2)backup incremental level 1 database format ‘/backup/backup_1/%d_%s_%p_%u_%T_1.dmp‘; /*如果数据库很大,增量备份可以开启块跟踪。不过不开块跟踪,那么rman会把所有数据库读一遍再进行增量备份。 */ select status from v$block_change_tracking; alter database disable block change tracking; alter database enable block change tracking using file ‘/xxx/xxx‘; /*如果使用了OMF(oracle-managed file),则会自动创建块跟踪文件。*/
configure retention policy to recovery window of n days; /*基于时间*/ configure retention policy to redundancy n; /*基于冗余数量*/ configure retention policy to none; /*恢复默认*/
标签:blog http io ar os 使用 for sp strong
原文地址:http://www.cnblogs.com/hllnj2008/p/4079388.html