<?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/%e6%95%b0%e6%8d%ae%e6%96%87%e4%bb%b6%e8%b7%af%e5%be%84%e5%b8%a6%e5%9b%9e%e8%bd%a6/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>Wed, 04 Nov 2026 15:33:30 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>解决oracle数据文件路径有回车故障</title>
		<link>https://www.xifenfei.com/2024/12/oracle-filename-enter-key.html</link>
		<comments>https://www.xifenfei.com/2024/12/oracle-filename-enter-key.html#comments</comments>
		<pubDate>Sat, 14 Dec 2024 00:38:47 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[数据文件路径带回车]]></category>
		<category><![CDATA[数据文件路径特殊字符]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=11073</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2024/12/oracle-filename-enter-key.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/2024/12/oracle-filename-enter-key.html" target="_blank">解决oracle数据文件路径有回车故障</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>最近遇到一个硬件恢复朋友的请求,oracle数据库文件恢复出来了,但是在linux上面启动的时候,有两个文件无法检测到,dbv检测正常.<br />
<a href="https://www.xifenfei.com/wp-content/uploads/2024/12/checkpiont_err.jpg"><img src="https://www.xifenfei.com/wp-content/uploads/2024/12/checkpiont_err.jpg" alt="checkpiont_err" width="800" height="482" class="alignleft size-full wp-image-11074" /></a><br />
<a href="https://www.xifenfei.com/wp-content/uploads/2024/12/dbv.png"><img src="https://www.xifenfei.com/wp-content/uploads/2024/12/dbv.png" alt="dbv" width="954" height="543" class="alignleft size-full wp-image-11075" /></a><br />
<hr />
通过分析是由于文件无法找到原因导致<br />
<a href="https://www.xifenfei.com/wp-content/uploads/2024/12/file-not-found.png"><img src="https://www.xifenfei.com/wp-content/uploads/2024/12/file-not-found.png" alt="file-not-found" width="1707" height="133" class="alignleft size-full wp-image-11076" /></a><br />
<hr />
进一步检查发现原库这两个文件结尾带有回车,但是恢复出来的文件不带回车<br />
<a href="https://www.xifenfei.com/wp-content/uploads/2024/12/huiche.png"><img src="https://www.xifenfei.com/wp-content/uploads/2024/12/huiche.png" alt="huiche" width="689" height="239" class="alignleft size-full wp-image-11077" /></a><br />
<hr />
对于这个故障,我在测试环境进行了重现并且给予解决<br />
1. 创建带回车键数据文件</p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; create tablespace xifenfei datafile '/u01/app/oracle/oradata/xifenfei/xff01.dbf
  2  ' size 128m;

Tablespace created.

SQL&gt; alter tablespace xifenfei add datafile '/u01/app/oracle/oradata/xifenfei/xff02.dbf' size 128M;

Tablespace altered.

SQL&gt; select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/xifenfei/system01.dbf
/u01/app/oracle/oradata/xifenfei/sysaux01.dbf
/u01/app/oracle/oradata/xifenfei/undotbs01.dbf
/u01/app/oracle/oradata/xifenfei/users01.dbf
/u01/app/oracle/oradata/xifenfei/xff01.dbf
/u01/app/oracle/oradata/xifenfei/xff02.dbf

6 rows selected.
</pre>
<p>2.操作系统层面查看文件（在我的ssh工具中,可以看到带回车键文件和不带回车文件不一样,使用的是crt工具,其他工具是否显示不确定）</p>
<pre class="brush: bash; title: ; notranslate">
[oracle@xifenfei ~]$ cd /u01/app/oracle/oradata/xifenfei/
[oracle@xifenfei xifenfei]$ ls -l xff*
-rw-r----- 1 oracle oinstall 134225920 Dec 14 08:05 xff01.dbf?
-rw-r----- 1 oracle oinstall 134225920 Dec 14 08:05 xff02.dbf
</pre>
<p>3. 操作系统层面重命名数据文件</p>
<pre class="brush: bash; title: ; notranslate">
[oracle@xifenfei xifenfei]$ mv xff01.dbf* xff01.dbf
[oracle@xifenfei xifenfei]$ ls -l xff*
-rw-r----- 1 oracle oinstall 134225920 Dec 14 08:05 xff01.dbf
-rw-r----- 1 oracle oinstall 134225920 Dec 14 08:05 xff02.dbf
</pre>
<p>3. 数据库层面重启看文件情况,发现文件不能被正常发现(当然不能,文件被os层面mv了)</p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; shutdown abort;
ORACLE instance shut down.
SQL&gt; startup mount;
ORACLE instance started.

Total System Global Area  551165952 bytes
Fixed Size                  2255112 bytes
Variable Size             369100536 bytes
Database Buffers          171966464 bytes
Redo Buffers                7843840 bytes
Database mounted.
SQL&gt; select file#, CHECKPOINT_CHANGE# from v$datafile_header;

     FILE# CHECKPOINT_CHANGE#
---------- ------------------
         1          306775013
         2          306775013
         3          306775013
         4          306775013
         5                  0
         6          306779423

6 rows selected.

RMAN&gt; report schema;

Report of database schema for database with db_unique_name XIFENFEI

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    770      SYSTEM               ***     /u01/app/oracle/oradata/xifenfei/system01.dbf
2    1950     SYSAUX               ***     /u01/app/oracle/oradata/xifenfei/sysaux01.dbf
3    70       UNDOTBS1             ***     /u01/app/oracle/oradata/xifenfei/undotbs01.dbf
4    12       USERS                ***     /u01/app/oracle/oradata/xifenfei/users01.dbf
5    0        XIFENFEI             ***     /u01/app/oracle/oradata/xifenfei/xff01.dbf

6    128      XIFENFEI             ***     /u01/app/oracle/oradata/xifenfei/xff02.dbf
</pre>
<p>4. 解决控制文件和数据文件实际名称不一致问题</p>
<pre class="brush: sql; title: ; notranslate">
RMAN&gt; catalog datafilecopy '/u01/app/oracle/oradata/xifenfei/xff01.dbf';

using target database control file instead of recovery catalog
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/xifenfei/xff01.dbf RECID=1 STAMP=1187684217

RMAN&gt; switch datafile 5 to copy;

datafile 5 switched to datafile copy &quot;/u01/app/oracle/oradata/xifenfei/xff01.dbf&quot;

RMAN&gt; report schema;

Report of database schema for database with db_unique_name XIFENFEI

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    770      SYSTEM               ***     /u01/app/oracle/oradata/xifenfei/system01.dbf
2    1950     SYSAUX               ***     /u01/app/oracle/oradata/xifenfei/sysaux01.dbf
3    70       UNDOTBS1             ***     /u01/app/oracle/oradata/xifenfei/undotbs01.dbf
4    12       USERS                ***     /u01/app/oracle/oradata/xifenfei/users01.dbf
5    128      XIFENFEI             ***     /u01/app/oracle/oradata/xifenfei/xff01.dbf
6    128      XIFENFEI             ***     /u01/app/oracle/oradata/xifenfei/xff02.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    123      TEMP                 32767       /u01/app/oracle/oradata/xifenfei/temp01.dbf


RMAN&gt; alter database open;

database opened
</pre>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/12/oracle-12c%e9%a2%84%e8%a7%88.html" rel="bookmark" class="crp_title">ORACLE 12C安装预览</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/08/%e9%9d%9easm%e6%95%b0%e6%8d%ae%e6%96%87%e4%bb%b6%e7%a7%bb%e6%a4%8d%e5%88%b0asm.html" rel="bookmark" class="crp_title">asm数据文件迁移(os&#8211;>asm)</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/12/oracle-12c-move-datafile%e6%b5%8b%e8%af%95.html" rel="bookmark" class="crp_title">ORACLE 12C move datafile测试</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2021/07/drop-tablesapce-recovery.html" rel="bookmark" class="crp_title">drop tablesapce 数据恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/03/oracle-12c-%e6%8e%a7%e5%88%b6%e6%96%87%e4%bb%b6%e5%bc%82%e5%b8%b8%e6%81%a2%e5%a4%8d.html" rel="bookmark" class="crp_title">ORACLE 12C 控制文件异常恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2024/07/oracle-23ai-install.html" rel="bookmark" class="crp_title">oracle 23ai（23.5.0.24.07）完整功能版安装体验</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/08/%e6%99%ae%e9%80%9a%e5%ba%93%e8%bf%81%e7%a7%bb%e8%87%b3asm%e5%ad%98%e5%82%a8.html" rel="bookmark" class="crp_title">普通库迁移至ASM存储</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/03/oracle-rm-rf-recovery.html" rel="bookmark" class="crp_title">linux rm -rf 删除数据文件恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2022/04/drop-tablespace-recovery.html" rel="bookmark" class="crp_title">分享运气超级好的一次drop tablespace 数据恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/10/%e6%95%b0%e6%8d%ae%e6%96%87%e4%bb%b6%e9%87%8d%e5%91%bd%e5%90%8d.html" rel="bookmark" class="crp_title">数据文件重命名</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2024/05/distributed-storage-ora-00354-ora-00353.html" rel="bookmark" class="crp_title">分布式存储故障导致数据库无法启动故障处理</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/12/%e5%88%a0%e9%99%a4oracle%e6%95%b0%e6%8d%ae%e6%96%87%e4%bb%b6%e4%b8%b4%e6%97%b6%e6%96%87%e4%bb%b6.html" rel="bookmark" class="crp_title">删除Oracle数据文件/临时文件</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2024/12/oracle-filename-enter-key.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
