<?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; 达梦redo丢失</title>
	<atom:link href="https://www.xifenfei.com/tag/%e8%be%be%e6%a2%a6redo%e4%b8%a2%e5%a4%b1/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>Sat, 07 Nov 2026 15:45:44 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>达梦数据库redo异常强制拉库</title>
		<link>https://www.xifenfei.com/2026/06/force-open-dm.html</link>
		<comments>https://www.xifenfei.com/2026/06/force-open-dm.html#comments</comments>
		<pubDate>Sun, 28 Jun 2026 05:37:46 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[达梦恢复]]></category>
		<category><![CDATA[达梦redo丢失]]></category>
		<category><![CDATA[达梦redo异常恢复]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=12247</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2026/06/force-open-dm.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/2026/06/force-open-dm.html" target="_blank">达梦数据库redo异常强制拉库</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>通过模拟事务不提交,并删除掉redo来模仿达梦数据库故障的恢复过程<br />
<strong>模拟达梦事务并不提交直接abort掉库</strong></p>
<pre class="brush: sql; title: ; notranslate">
[dmdba@xifenfei ~]$ disql SYSDBA/Oracle123@localhost:5236

Server[localhost:5236]:mode is normal, state is open
login used time : 5.575(ms)
disql V8
SQL&gt; 
SQL&gt; create table t1 as select * from dba_objects;
executed successfully
used time: 85.929(ms). Execute id is 601.
SQL&gt; select count(1) from t1;

LINEID     COUNT(1)            
---------- --------------------
1          1067

used time: 2.106(ms). Execute id is 602.
SQL&gt; delete from t1;
affect rows 1067

used time: 3.726(ms). Execute id is 603.
SQL&gt; shutdown abort;
executed successfully
used time: 1.324(ms). Execute id is 0.
</pre>
<p>删除掉redo文件</p>
<pre class="brush: bash; title: ; notranslate">
[dmdba@xifenfei ~]$ cd /dmdb/data/DAMENG/
[dmdba@xifenfei DAMENG]$ rm -rf DAMENG0
DAMENG01.log  DAMENG02.log  
[dmdba@xifenfei DAMENG]$ rm -rf DAMENG0*.log
</pre>
<p>尝试启动达梦数据库</p>
<pre class="brush: bash; title: ; notranslate">
[dmdba@xifenfei bin]$ ./dmserver  /dmdb/data/DAMENG/dm.ini 
file dm.key not found, use default license!
version info: develop
csek2_vm_t = 9456
nsql_vm_t = 336
prjt2_vm_t = 176
ltid_vm_t = 272
nins2_vm_t = 1144
nset2_vm_t = 272
ndlck_vm_t = 192
ndel2_vm_t = 760
slct2_vm_t = 352
nli2_vm_t = 200
aagr2_vm_t = 312
pscn_vm_t = 416
dist_vm_t = 1000
DM Database Server 64 V8 03134284458-20251113-301923-20178 startup...
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
Database mode = 0, oguid = 0
/dmdb/data/DAMENG/DAMENG01.log not exist, can not startup
</pre>
<p>重命名现在的库文件,然后参考当时的创建库的init.log 进行重新初始化一个新库</p>
<pre class="brush: bash; title: ; notranslate">
[dmdba@xifenfei data]$ cat DAMENG_BAK/dminit_DAMENG_20260315093214.log 
start init database: V8, 2026-03-15 09:32:14
init params:
        db path: /dmdb/data/DAMENG
        db name: DAMENG
        auto overwrite: 0
        page size: 8192
        extent size: 16
        char_fix_storage: 0
        sql_log_forbid: 0
        secur_flag: 2
        enable mac: 0
        page checksum policy: 1
        time zone: +08:00
        string case sensitive: 1
        charset: 0
        page check mode: 3
        page check algorithm id: 0
        priv flag: 0
        env label: 0
        rlog enc flag: 0
        use new hash: 1
        blank pad mode: 0
        sec priv mode: 0
        huge with delta: 1
        rlog gen for huge: 1
        pseg_mgr_flag: 0
        auto_adj_para: 0
</pre>
<pre class="brush: bash; title: ; notranslate">
[dmdba@xifenfei data]$ dminit PATH=/dmdb/data/DAMENG  PAGE_SIZE=8 EXTENT_SIZE=16 
&gt; LOG_SIZE=256 PORT_NUM=5236 CASE_SENSITIVE=Y CHARSET=0 DB_NAME=DAMENG INSTANCE_NAME=DMSERVER
&gt; SYSDBA_PWD=Oracle123 SYSAUDITOR_PWD=Oracle123 RLOG_POSTFIX_NAME=log
initdb V8
db version: 0x7000d
file dm.key not found, use default license!
License will expire on 2026-11-13
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL

 log file path: /dmdb/data/DAMENG/DAMENG/DAMENG01.log


 log file path: /dmdb/data/DAMENG/DAMENG/DAMENG02.log

write to dir [/dmdb/data/DAMENG/DAMENG].
create dm database success. 2026-06-27 23:40:17
</pre>
<p>正常启动这个新库并干净关闭</p>
<pre class="brush: sql; title: ; notranslate">
[dmdba@xifenfei bin]$ disql SYSDBA/Oracle123@localhost:5236

Server[localhost:5236]:mode is normal, state is open
login used time : 5.523(ms)
disql V8
SQL&gt; shutdown normal
2   ;
executed successfully
used time: 1.417(ms). Execute id is 0.
SQL&gt; 

</pre>
<p>直接拷贝redo文件替换尝试启动</p>
<pre class="brush: bash; title: ; notranslate">
[dmdba@xifenfei bin]$ ./dmserver  /dmdb/data/DAMENG/dm.ini 
file dm.key not found, use default license!
version info: develop
csek2_vm_t = 9456
nsql_vm_t = 336
prjt2_vm_t = 176
ltid_vm_t = 272
nins2_vm_t = 1144
nset2_vm_t = 272
ndlck_vm_t = 192
ndel2_vm_t = 760
slct2_vm_t = 352
nli2_vm_t = 200
aagr2_vm_t = 312
pscn_vm_t = 416
dist_vm_t = 1000
DM Database Server 64 V8 03134284458-20251113-301923-20178 startup...
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
Database mode = 0, oguid = 0
License will expire on 2026-11-13
rfil grp log file error in (db_magic, permanent_magic), 
        log file /dmdb/data/DAMENG/DAMENG01.log is (475644558, 854749702), 
        dbfile is(92637567, 1763199417).
Floating point exception
[dmdba@xifenfei bin]$ 
</pre>
<p>提示db_magic和permanent_magic不匹配,使用dmmdf修改新库redo文件</p>
<pre class="brush: bash; title: ; notranslate">
[dmdba@xifenfei DAMENG]$ dmmdf type=1 FILE=SYSTEM.DBF
dmmdf V8
**********************************************************
1 db_magic=92637567
2 next_trxid=38064
3 pemnt_magic=1763199417
4 enable_page_check=3
**********************************************************
Please input which parameter you want to change(1-4), q to quit: Q
</pre>
<p>然后在使用dmmdf type=2 修改redo文件的db_magic和pemnt_magic修改之后,设置PSEG_RECV = 0，RLOG_CHECK_SPACE = 2尝试启动库</p>
<pre class="brush: bash; title: ; notranslate">
[dmdba@xifenfei bin]$ ./dmserver  /dmdb/data/DAMENG/dm.ini
file dm.key not found, use default license!
version info: develop
csek2_vm_t = 9456
nsql_vm_t = 336
prjt2_vm_t = 176
ltid_vm_t = 272
nins2_vm_t = 1144
nset2_vm_t = 272
ndlck_vm_t = 192
ndel2_vm_t = 760
slct2_vm_t = 352
nli2_vm_t = 200
aagr2_vm_t = 312
pscn_vm_t = 416
dist_vm_t = 1000
DM Database Server 64 V8 03134284458-20251113-301923-20178 startup...
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
Database mode = 0, oguid = 0
License will expire on 2026-11-13
file lsn: 49136
ndct db load finished, code:100
ndct fill fast pool finished
pseg_set_gtv_trxid_low next_trxid in mem:[40065]
pseg recv finished
nsvr_startup end.
uthr_pipe_create, create pipe[read:10, write:11]
uthr_pipe_create, create pipe[read:12, write:13]
uthr_pipe_create, create pipe[read:14, write:15]
uthr_pipe_create, create pipe[read:16, write:17]
uthr_pipe_create, create pipe[read:18, write:19]
uthr_pipe_create, create pipe[read:20, write:21]
uthr_pipe_create, create pipe[read:22, write:23]
uthr_pipe_create, create pipe[read:24, write:25]
uthr_pipe_create, create pipe[read:26, write:27]
uthr_pipe_create, create pipe[read:28, write:29]
uthr_pipe_create, create pipe[read:30, write:31]
uthr_pipe_create, create pipe[read:32, write:33]
uthr_pipe_create, create pipe[read:34, write:35]
uthr_pipe_create, create pipe[read:36, write:37]
uthr_pipe_create, create pipe[read:38, write:39]
uthr_pipe_create, create pipe[read:40, write:41]
aud sys init success.
aud rt sys init success.
systables desc init success.
ndct_db_load_info finished, code:100.
nsvr_process_before_open begin.
nsvr_process_before_open success.
SYSTEM IS READY.
</pre>
<p>查询拉起来库中的数据</p>
<pre class="brush: bash; title: ; notranslate">
[dmdba@xifenfei DAMENG]$ disql SYSDBA/Oracle123@localhost:5236

Server[localhost:5236]:mode is normal, state is open
login used time : 6.192(ms)
disql V8
SQL&gt; select count(1) from t1;

LINEID     COUNT(1)            
---------- --------------------
1          1067

used time: 8.976(ms). Execute id is 601.
SQL&gt; 
</pre>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/04/dm-ctl_recovery.html" rel="bookmark" class="crp_title">达梦数据库dm.ctl文件异常恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/12/oracle-12c-pdb%e9%83%a8%e5%88%86%e5%8a%9f%e8%83%bd%e6%b5%8b%e8%af%95.html" rel="bookmark" class="crp_title">ORACLE 12C PDB部分功能测试</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2024/12/ora-15411.html" rel="bookmark" class="crp_title">ORA-15411: Failure groups in disk group DATA have different number of disks.</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/11/mysqlimport%e4%bd%bf%e7%94%a8.html" rel="bookmark" class="crp_title">mysqlimport使用</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2024/04/postgresql-walminer.html" rel="bookmark" class="crp_title">PostgreSQL解析wal日志之&#8212;walminer</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2026/01/obet-miss-archivelog-recovery.html" rel="bookmark" class="crp_title">obet快速修改scn/resetlogs恢复数据库(缺少归档,ORA-00308）</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/04/db2%e8%a1%a8%e7%a9%ba%e9%97%b4%e7%ae%a1%e7%90%861.html" rel="bookmark" class="crp_title">DB2表空间管理(1)&#8212;基础篇</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2017/04/12c-raw-devices-desupport.html" rel="bookmark" class="crp_title">12c官方不支持裸设备,功能上依旧支持</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/01/oracle-user-read-only.html" rel="bookmark" class="crp_title">Oracle read only用户&#8212;23ai新特性:只读用户</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/09/warning-log-write-time-560ms-size-3kb.html" rel="bookmark" class="crp_title">Warning: log write time 560ms, size 3KB</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2018/08/pg_rman_backup_restore.html" rel="bookmark" class="crp_title">pg_rman 备份还原测试</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/01/aix%e4%b8%adprocmap-%e6%9f%a5%e7%9c%8boracle%e8%bf%9b%e7%a8%8b%e5%8d%a0%e7%94%a8%e7%b3%bb%e7%bb%9f%e5%86%85%e5%ad%98.html" rel="bookmark" class="crp_title">aix中procmap 查看oracle进程占用系统内存</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2026/06/force-open-dm.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
