欢迎来到天天文库
浏览记录
ID:37863759
大小:90.50 KB
页数:4页
时间:2019-06-01
《oracle备份方案(rman)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、www.newcapec.com.cnOracle数据库备份1.改数据库为归档模式。判断数据库是否处于归档模式:archiveloglist执行以下语句,改数据为归档模式。如果是oracle9i数据库altersystemsetlog_archive_dest_1='location=d:arc'scope=spfile;altersystemsetlog_archive_format='%s.arc'scope=spfile;altersystemsetlog_archive_start=truescope=spfile;shutdownimmed
2、iate;startupmount;alterdatabasearchivelog;如果是oracle10Gshutdownimmediate;startupmount;alterdatabasearchivelog;再次判断是否更改成功archiveloglist。进行全库备份。关闭数据库复制全部数据文件、控制文件、重做日志、归档日志、参数文件。2.在异地创建RMAN目录库为目录创建一个单独的表空间SQL>CreatetablespacermanTPdatafile'rmanTP'size50M;创建RMAN用户SQL>CreateuserRMANi
3、dentifiedbyRMANdefaulttablespacermanTPtemporarytablespacetemp;给RMAN授予权限SQL>Grantconnect,resource,recovery_catalog_ownertorman;打开RMAN$>RMAN连接数据库RMAN>connectcatalogrman/rman创建恢复目录RMAN>CreatecatalogtablespacermanTP注册目标数据库。目标数据库就是需要备份的数据库,注册目标数据库的命令为:www.newcapec.com.cn$>RMANRMAN>co
4、nnecttargetsys/sys@oralj;RMAN>connectcatalogrman/rman;RMAN>Registerdatabase;1.备份策略A. 3个月做一次全备份数据库全备份的脚本run{allocatechannelc1typedisk;allocatechannelc2typedisk;allocatechannelc3typedisk;backupfulltag'dbfull'format'd:oraclebackupfull%T_%s_%p'databaseincludecurrentcontrolfile;
5、sql'altersystemarchivelogcurrent';backupfilesperset3format'd:oraclebackuparchfull%T_%s_%p'archivelogalldeleteinput;releasechannelc1;releasechannelc2;releasechannelc3;}B. 每月一次0级备份零级备份的脚本run{allocatechannelc1typedisk;allocatechannelc2typedisk;allocatechannelc3typedisk;bac
6、kupincrementallevel0tag'db0'format'd:oraclebackupdb0%T_%s_%p'databaseskipreadonly;sql'altersystemarchivelogcurrent';backupfilesperset3format'd:oraclebackuparch%T_%s_%p'archivelogalldeleteinput;releasechannelc1;releasechannelc2;releasechannelc3;}C. 每周做一次1级备份run{alloca
7、techannelc1typedisk;allocatechannelc2typedisk;allocatechannelc3typedisk;backupincrementallevel1tag'db1'format'd:oraclebackupdb1%T_%s_%p'databaseskipreadonly;sql'altersystemarchivelogcurrent';www.newcapec.com.cnbackupfilesperset3format'd:oraclebackuparch1%T_%s_%p’archivelog
8、alldeleteinput;releasechannelc1;releasechannelc
此文档下载收益归作者所有