<?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; rman;ora-19504;ora-27038</title>
	<atom:link href="http://www.ochef.net/tag/rmanora-19504ora-27038/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ochef.net</link>
	<description>RDBMS and My Life</description>
	<lastBuildDate>Mon, 19 Jul 2010 02:01:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4873</generator>
		<item>
		<title>RMAN ORA-19504、ORA-27038错误解决方法</title>
		<link>http://www.ochef.net/2009/08/rman-ora-1950427038/</link>
		<comments>http://www.ochef.net/2009/08/rman-ora-1950427038/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 03:34:50 +0000</pubDate>
		<dc:creator>ochef</dc:creator>
				<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[rman;ora-19504;ora-27038]]></category>

		<guid isPermaLink="false">http://www.ochef.net/?p=494</guid>
		<description><![CDATA[一客户目前正在上IBM TSM的项目，现在要求临时用RMAN将生产库的数据备份到本地， rman常规备份很简单，给了客户如下的脚本： run{ allocate channel c1 type disk; allocate channel c2 type disk; backup full tag &#8216;dbfull&#8217; format &#8216;/oracle/app/backup/full%Y_%M_%t_A&#8217; database; sql &#8216;alter system archive log current&#8217;; backup filesperset 3 format &#8216;/oracle/app/backup/arch%Y_%M_%t_A&#8217; archivelog all; release channel c1; release channel c2; } 但昨天收到客户电话说备份有点问题，出错信息如下： released channel: c1 released channel: c2 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK [...]]]></description>
			<content:encoded><![CDATA[<p>一客户目前正在上IBM TSM的项目，现在要求临时用RMAN将生产库的数据备份到本地， rman常规备份很简单，给了客户如下的脚本：</p>
<p>run{</p>
<p>allocate channel c1 type disk;</p>
<p>allocate channel c2 type disk;</p>
<p>backup full tag &#8216;dbfull&#8217; format &#8216;/oracle/app/backup/full%Y_%M_%t_A&#8217; database;</p>
<p>sql &#8216;alter system archive log current&#8217;;</p>
<p>backup filesperset 3 format &#8216;/oracle/app/backup/arch%Y_%M_%t_A&#8217; archivelog all;</p>
<p>release channel c1;</p>
<p>release channel c2;</p>
<p>}</p>
<p>但昨天收到客户电话说备份有点问题，出错信息如下：</p>
<p>released channel: c1</p>
<p>released channel: c2</p>
<p>RMAN-00571: ===========================================================</p>
<p>RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============</p>
<p>RMAN-00571:</p>
<p>===========================================================</p>
<p>RMAN-03002: failure of release command at 08/01/2009 17:12:44</p>
<p>RMAN-06012: channel: c2 not allocated</p>
<p>系统提示没有分配channel c2，报要创建的文件已经存在，我在虚拟机分别在9i、10g的环境中测试也有类似的错误：</p>
<p>9i：</p>
<p>RMAN-00571: ===========================================================</p>
<p>RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============</p>
<p>RMAN-00571: ===========================================================</p>
<p>RMAN-03009: failure of backup command on c1 channel at 08/04/2009 09:27:03</p>
<p>ORA-19504: failed to create file &#8220;/home/oracle/backup/arch2009_08_693998821&#8243;</p>
<p>ORA-27038: skgfrcre: file exists</p>
<p>10g：</p>
<p>RMAN-00571: ===========================================================</p>
<p>RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============</p>
<p>RMAN-00571: ===========================================================</p>
<p>RMAN-03009: failure of backup command on c1 channel at 08/04/2009 08:34:43</p>
<p>ORA-19504: failed to create file &#8220;/home/oracle/backup/full2009_08_A&#8221;</p>
<p>ORA-27038: created file already exists</p>
<p>这个问题第一次在客户的测试机上执行是成功的，第二次报错，在我自己测试的时候，全新安装的ORACLE也有这样的问题，为什么会出现这样的问题，请看下面的分析：</p>
<p>1.错误中指定要创建的文件已经，而实际上是并不存在，也没有用先前的备份的数据恢复过数据库。考虑是不是在OS层面删除过备份文件，而没有在RMAN中更新，试着更新RMAN：</p>
<p>RMAN&gt;crosscheck archivelog all;</p>
<p>RMAN&gt;delete expired archivelog all;</p>
<p>RMAN&gt;crosscheck backup;</p>
<p>RMAN&gt;delete expired backup;</p>
<p>做了更新之后，问题依旧。</p>
<p>2.会不会是目录（/home/oracle/backup）权限的问题，修改目录权限：</p>
<p>#chmod –R 775 /home/oracle/backup</p>
<p>再执行备份，问题仍旧。</p>
<p>3.试着让oracle自动分配通道，但配置RMAN的并行度为2</p>
<p>RMAN&gt;configure device type disk parallelism2；</p>
<p>尝试着再次备份，问题仍然是channel c2没有分配通道。</p>
<p>此时，伟大的google对此问题已经搜不到有用的信息，没办法，只能找metalink了，在<a href="https://metalink2.oracle.com/metalink/plsql/f?p=130:14:4498450183210928848::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,1082911.6,1,1,1,helvetica" target="_blank">Doc ID:  1082911.6</a></p>
<p>上找到答案，原文如下：</p>
<blockquote><p>Solution Description:</p>
<p>=====================</p>
<p>Insert a %U into the format portion of the backup script in order to ensure a unique backup file name.</p>
<p>Problem Explanation:</p>
<p>====================</p>
<p>These errors occur because a backup file name already exists by the name specified in you backup script. For instance, if you are using the line &#8220;allocate channel c1 type disk format</p>
<p>&#8216;/oracle/database/rman/backup/df_%d_%p_%c&#8217;;&#8221;, df_%d_%p_%c formats the backupstring like so;</p>
<p>df_ is simply a name. This could be any set of characters. In this case it means</p>
<p>database full.</p>
<p>%d_ is the database sid.</p>
<p>%p_is the backup piece number within the backup set.</p>
<p>%c_ specifies the copy number of the backup piece within a set of duplexed backup pieces.</p>
<p>There needs to be a %U added to the format string.</p>
<p>%U_ specifies a convenient shorthand that guarantees uniqueness in generated backup filenames. So, if the string were &#8220;db_%d_%U_%p_%c a unique name would be generated and it would not be necessary to either rename or move the backup file name prior to the next backup.</p>
<p>If the format is changed to include the %U, for instance;</p>
<p>allocate channel c1 type disk format &#8216;/oracle/database/rman/backup/df_%d_%U_%p_%c&#8217;;</p>
<p>The backup file will automatically have a unique name generated like;</p>
<p>df_JTG_0eblfm65_1_1_1_1</p>
<p>The next one would look like;</p>
<p>df_JTG_0fblfm76_1_1_1_1</p></blockquote>
<p>增加<span style="color: #ff0000;">%U</span>参数后再次尝试备份：</p>
<p>RMAN&gt; run{</p>
<p>2&gt;  allocate channel c1 type disk;</p>
<p>3&gt;  allocate channel c2 type disk;</p>
<p>4&gt;  backup full tag &#8216;dbfull&#8217; format &#8216;/home/oracle/backup/full%Y_%M_%U_A&#8217; database;</p>
<p>5&gt;  sql &#8216;alter system archive log current&#8217;;</p>
<p>6&gt;  backup filesperset 3  format &#8216;/home/oracle/backup/arch%Y_%M_%U_A&#8217; archivelog all;</p>
<p>7&gt;  release channel c1;</p>
<p>8&gt;  release channel c2;</p>
<p>9&gt;  }</p>
<p>released channel: ORA_DISK_1</p>
<p>released channel: ORA_DISK_2</p>
<p>allocated channel: c1</p>
<p>channel c1: sid=144 devtype=DISK</p>
<p>allocated channel: c2</p>
<p>channel c2: sid=146 devtype=DISK</p>
<p>……</p>
<p>……</p>
<p>channel c1: starting piece 1 at 04-AUG-09</p>
<p>channel c1: finished piece 1 at 04-AUG-09</p>
<p>piece handle=/home/oracle/backup/arch2009_08_3pklr29q_1_1_A tag=TAG20090804T083659 comment=NONE</p>
<p>channel c1: backup set complete, elapsed time: 00:00:02</p>
<p>Finished backup at 04-AUG-09</p>
<p>released channel: c1</p>
<p>released channel: c2</p>
<p>RMAN&gt;</p>
<p>至此，备份成功问题得到解决。</p>
<p>-The End-</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ochef.net/2009/08/rman-ora-1950427038/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
