1.在备份服务器创建专用于保存rman备份信息的表空间rman_tbs;
create tablespace rman_tbs datafile 'd:/oracle/rman01.dbf' size 2G;
2.创建rman用户
create user rman identified by rman default tablespace rman_tbs temporary tablespace temp;
3.授予适当的用户权限
grant connect,resource,recovery_catalog_owner to rman;
4.修改target数据库的tnsnames.ora,使其能访问到rman数据库
5.创建catalog;
rman target / catalog rman/rman@rman
create catalog;
6.在recovery catalog中注册target数据库信息;
register database;
7.备份脚本bk_script.rcv
#!/bin/sh
crosscheck backup;
crosscheck archivelog all;
delete expired backup;
delete expired archivelog all;
delete expired copy;
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate channel c5 type disk;
allocate channel c6 type disk;
allocate channel c7 type disk;
allocate channel c8 type disk;
backup database format '/oradata_d1/udbprod/backup/full_level0_%U';
backup archivelog all delete all input skip inaccessible format '/oradata_d1/udbprod/arc_bak/ARC_%U';
backup current controlfile format '/backup/back/control_bak_%T';
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
release channel c6;
release channel c7;
release channel c8;
}
8.备份的相关设置
rman>CONFIGURE BACKUP OPTIMIZATION ON; --controlfile,spfile的自动备份
9.执行备份脚本backup_db.sh
rman target / catalog rman/rman@rman CMDFILE bk_script.rcv LOG output`date +'%Y%m%d'`.log
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22578826/viewspace-663042/ ,如需转载,请注明出处,否则将追究法律责任。