<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>惜分飞 &#187; 异地备份</title>
	<atom:link href="https://www.xifenfei.com/tag/%e5%bc%82%e5%9c%b0%e5%a4%87%e4%bb%bd/feed" rel="self" type="application/rss+xml" />
	<link>https://www.xifenfei.com</link>
	<description>提供7*24专业数据库(Oracle,SQL Server,MySQL,PostgreSQL等)恢复和技术支持@Tel:17813235971</description>
	<lastBuildDate>Thu, 29 Oct 2026 15:31:46 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>windows rman自动备份并传输到远程服务器处理方法</title>
		<link>https://www.xifenfei.com/2015/01/windows-rman%e8%87%aa%e5%8a%a8%e5%a4%87%e4%bb%bd%e5%b9%b6%e4%bc%a0%e8%be%93%e5%88%b0%e8%bf%9c%e7%a8%8b%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%a4%84%e7%90%86%e6%96%b9%e6%b3%95.html</link>
		<comments>https://www.xifenfei.com/2015/01/windows-rman%e8%87%aa%e5%8a%a8%e5%a4%87%e4%bb%bd%e5%b9%b6%e4%bc%a0%e8%be%93%e5%88%b0%e8%bf%9c%e7%a8%8b%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%a4%84%e7%90%86%e6%96%b9%e6%b3%95.html#comments</comments>
		<pubDate>Sat, 03 Jan 2015 08:50:29 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[rman备份/恢复]]></category>
		<category><![CDATA[win rman备份]]></category>
		<category><![CDATA[异地备份]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=5707</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2015/01/windows-rman%e8%87%aa%e5%8a%a8%e5%a4%87%e4%bb%bd%e5%b9%b6%e4%bc%a0%e8%be%93%e5%88%b0%e8%bf%9c%e7%a8%8b%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%a4%84%e7%90%86%e6%96%b9%e6%b3%95.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div id="xifenfeicopyright">
<p>联系：<a href="https://www.xifenfei.com/about_xifenfei" target="_blank">手机/微信(+86 17813235971)   QQ(107644445)</a><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&#038;uin=107644445&#038;site=qq&#038;menu=yes"><img src="https://www.xifenfei.com/wp-content/themes/img/site_qq.jpg" alt="QQ咨询惜分飞" title="QQ咨询惜分飞"/></a></p>
<p>标题：<a href="https://www.xifenfei.com/2015/01/windows-rman%e8%87%aa%e5%8a%a8%e5%a4%87%e4%bb%bd%e5%b9%b6%e4%bc%a0%e8%be%93%e5%88%b0%e8%bf%9c%e7%a8%8b%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%a4%84%e7%90%86%e6%96%b9%e6%b3%95.html" target="_blank">windows rman自动备份并传输到远程服务器处理方法</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>在linux中，要使用rman备份后传输到远程服务器上,可以选择ftp,scp,nfs等方式实现,在win主机上可以配置ftp或者共享实现.linux的解决方法已经很多,这里重点提供win上面实现rman备份且传输到远程服务器的解决方法,简单实现异地备份方法:<br />
1.win配置共享目录，而且设置远程服务器有写权限,如果省事可以配置everyone有读写权限<br />
2.创建相关备份目录,这里主要是rmanfile,rmanscript,rmanlog<br />
3.编写rman备份脚本</p>
<pre class="brush: bash; title: ; notranslate">
CONFIGURE RETENTION POLICY TO REDUNDANCY = 7;
CONFIGURE DEVICE TYPE DISK PARALLELISM 4;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
backup  as compressed backupset database format 'E:\backup_db\rmanfile\full_%T_%U.rman';
sql 'alter system archive log current';
backup  as compressed backupset archivelog  all format 'E:\backup_db\rmanfile\arch_%T_%U.rman'  delete input;
DELETE noprompt OBSOLETE;
crosscheck backup;
delete noprompt expired backup;
backup  format 'E:\backup_db\rmanfile\ctl_%T_%U.rman' current controlfile;
backup spfile format 'E:\backup_db\rmanfile\spfile_%T_%U.rman' ;
exit;
</pre>
<p>4.调用rman备份脚本</p>
<pre class="brush: bash; title: ; notranslate">
rman target / cmdfile=E:\backup_db\scriptfile\backup_db.rman 
log=E:\backup_db\logfile\rmanlog_%date:~0,4%%date:~5,2%%date:~8,2%.log
</pre>
<p>5.拷贝到远程脚本<br />
需要注意是按照备份集中的日期作为标记来删除的，也就是说，一次备份最好不要跨天</p>
<pre class="brush: bash; title: ; notranslate">
copy /y e:\backup_db\rmanfile\*_%date:~0,4%%date:~5,2%%date:~8,2%_*.RMAN \\192.168.13.40\oracle_backup
</pre>
<p>6.删除远程服务器N天前备份脚本<br />
需要注意是按照备份集中的日期作为标记来删除的，也就是说，一次备份最好不要跨天</p>
<pre class="brush: bash; title: ; notranslate">
@echo off
set DaysAgo=5
call :DateToDays %date:~0,4% %date:~5,2% %date:~8,2% PassDays
set /a PassDays-=%DaysAgo%
call :DaysToDate %PassDays% DstYear DstMonth DstDay
del \\192.168.13.40\oracle_backup\*_%DstYear%%DstMonth%%DstDay%_*.RMAN
goto :eof

:DateToDays %yy% %mm% %dd% days
setlocal ENABLEEXTENSIONS
set yy=%1&amp;set mm=%2&amp;set dd=%3
if 1%yy% LSS 200 if 1%yy% LSS 170 (set yy=20%yy%) else (set yy=19%yy%)
set /a dd=100%dd%%%100,mm=100%mm%%%100
set /a z=14-mm,z/=12,y=yy+4800-z,m=mm+12*z-3,j=153*m+2
set /a j=j/5+dd+y*365+y/4-y/100+y/400-2472633
endlocal&amp;set %4=%j%&amp;goto :EOF

:DaysToDate %days% yy mm dd
setlocal ENABLEEXTENSIONS
set /a a=%1+2472632,b=4*a+3,b/=146097,c=-b*146097,c/=4,c+=a
set /a d=4*c+3,d/=1461,e=-1461*d,e/=4,e+=c,m=5*e+2,m/=153,dd=153*m+2,dd/=5
set /a dd=-dd+e+1,mm=-m/10,mm*=12,mm+=m+3,yy=b*100+d-4800+m/10
(if %mm% LSS 10 set mm=0%mm%)&amp;(if %dd% LSS 10 set dd=0%dd%)
endlocal&amp;set %2=%yy%&amp;set %3=%mm%&amp;set %4=%dd%&amp;goto :EOF
</pre>
<p>7.配置计划任务,让定时执行相关脚本</p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/10/win%e5%b9%b3%e5%8f%b0rman%e5%a4%87%e4%bb%bd%e5%92%8c%e5%88%a0%e9%99%a4dg%e5%a4%87%e5%ba%93%e5%bd%92%e6%a1%a3%e6%97%a5%e5%bf%97%e8%84%9a%e6%9c%ac.html" rel="bookmark" class="crp_title">win平台rman备份和删除dg备库归档日志脚本</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2010/08/oracle-%e4%b9%8brman%e5%a4%87%e4%bb%bd%e6%95%b0%e6%8d%ae%e5%ba%93.html" rel="bookmark" class="crp_title">oracle 之rman备份数据库</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2010/08/oracle%e4%b9%8brman2.html" rel="bookmark" class="crp_title">oracle之rman(2)</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2024/06/rman-06207-rman-06208.html" rel="bookmark" class="crp_title">RMAN-06207  RMAN-06208报错解决</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/09/rman%e4%b8%ad%e5%85%b3%e4%ba%8earchivelog%e6%93%8d%e4%bd%9c.html" rel="bookmark" class="crp_title">rman中关于archivelog操作</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/11/%e8%ae%aerman%e7%9a%84crosscheck%e5%92%8cobsolete.html" rel="bookmark" class="crp_title">议rman的crosscheck和obsolete</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/04/rman%e7%ae%a1%e7%90%86%e5%91%bd%e4%bb%a4.html" rel="bookmark" class="crp_title">Rman管理命令</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/04/rman%e5%a4%87%e4%bb%bd%e6%81%a2%e5%a4%8d%e5%91%bd%e4%bb%a4.html" rel="bookmark" class="crp_title">Rman备份恢复命令</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/06/oracle-12c-rman-%e5%8a%9f%e8%83%bd%e5%a2%9e%e5%bc%ba.html" rel="bookmark" class="crp_title">ORACLE 12C RMAN 功能增强</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/12/delete-expired-backup%e6%8a%a5ora-19606%e9%94%99%e8%af%af%e5%a4%84%e7%90%86.html" rel="bookmark" class="crp_title">delete expired backup报ORA-19606错误处理</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/04/shell-%e5%a4%87%e4%bb%bd%e6%96%87%e4%bb%b6.html" rel="bookmark" class="crp_title">shell 备份文件</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/03/rman-%e5%a4%87%e4%bb%bd%e5%87%ba%e7%8e%b0ora-00245rman-08132.html" rel="bookmark" class="crp_title">rman 备份出现ORA-00245/RMAN-08132</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2015/01/windows-rman%e8%87%aa%e5%8a%a8%e5%a4%87%e4%bb%bd%e5%b9%b6%e4%bc%a0%e8%be%93%e5%88%b0%e8%bf%9c%e7%a8%8b%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%a4%84%e7%90%86%e6%96%b9%e6%b3%95.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
