<?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; KingbaseES删除数据恢复</title>
	<atom:link href="https://www.xifenfei.com/tag/kingbasees%e5%88%a0%e9%99%a4%e6%95%b0%e6%8d%ae%e6%81%a2%e5%a4%8d/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, 22 Oct 2026 15:45:06 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>pdu完美支持金仓数据库恢复(KingbaseES)</title>
		<link>https://www.xifenfei.com/2025/04/pdu-support-kingbasees-recovery.html</link>
		<comments>https://www.xifenfei.com/2025/04/pdu-support-kingbasees-recovery.html#comments</comments>
		<pubDate>Tue, 08 Apr 2025 11:41:53 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[pdu工具]]></category>
		<category><![CDATA[KingbaseES删除数据恢复]]></category>
		<category><![CDATA[KingbaseES恢复]]></category>
		<category><![CDATA[KingbaseES无法启动恢复]]></category>
		<category><![CDATA[pdu支持KingbaseES]]></category>
		<category><![CDATA[金仓删除数据恢复]]></category>
		<category><![CDATA[金仓数据库恢复]]></category>
		<category><![CDATA[金仓无法启动恢复]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=11408</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2025/04/pdu-support-kingbasees-recovery.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/2025/04/pdu-support-kingbasees-recovery.html" target="_blank">pdu完美支持金仓数据库恢复(KingbaseES)</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>最近朋友对pdu进行了一些完善,让其可以比较好的支持电科金仓数据库（KingbaseES）的v8/v9版本<br />
<strong>使用pdu直接unload数据</strong></p>
<pre class="brush: sql; title: ; notranslate">
[kingbase@xifenfei ~]$ isql -Usystem test
Password for user system: 
isql (V9.0)
Licesen Type: SALES-企业版.
Type &quot;help&quot; for help.

test=# select version();
         version         
-------------------------
 KingbaseES V009R002C010
(1 row)

test=# \dt
        List of relations
 Schema | Name  | Type  | Owner  
--------+-------+-------+--------
 public | t_xff | table | system
(1 row)

test=# drop table walminer_contents;
DROP TABLE
test=# select * from t_xff;
 id |       name       
----+------------------
  1 | 汉字
  2 | xff测试
  3 | 惜分飞测试
  4 | www.xifenfei.com
(4 rows)

test=# insert into t_xff values(5,'www.xifenfie.com
test'# www.orasos.com');
INSERT 0 1
test=# select * from t_xff;
 id |       name       
----+------------------
  1 | 汉字
  2 | xff测试
  3 | 惜分飞测试
  4 | www.xifenfei.com
  5 | www.xifenfie.com+
    | www.orasos.com
(5 rows)

test=# checkpoint;
CHECKPOINT
</pre>
<p>pdu直接unload恢复</p>
<pre class="brush: bash; title: ; notranslate">
test.public=# b; 
开始初始化...
 -pg_database:&lt;/data/kingbase/v9/data/global/1262&gt;

数据库:test 
      -pg_schema:&lt;/data/kingbase/v9/data/base/13856/2615&gt;
      -pg_class:&lt;/data/kingbase/v9/data/base/13856/1259&gt; 共132行
      -pg_attribute:&lt;/data/kingbase/v9/data/base/13856/1249&gt; 共8863行
      模式:
        --&gt;public 1张表

数据库:kingbase 
      -pg_schema:&lt;/data/kingbase/v9/data/base/13857/2615&gt;
      -pg_class:&lt;/data/kingbase/v9/data/base/13857/1259&gt; 共131行
      -pg_attribute:&lt;/data/kingbase/v9/data/base/13857/1249&gt; 共8855行
      模式:
        --&gt;public 0张表
PDU.public=# use test;    
|----------------------------------------|
|          模式             |  表数量    |
|----------------------------------------|
|    public                 |  1         |
|----------------------------------------|
test.public=# set public;
|--------------------------------------------------|
|               表名                  |  表大小    |
|--------------------------------------------------|
|    t_xff                            |  8.00 KB   |
|--------------------------------------------------|

        仅显示表大小排名前 1 的表名
test.public=# param exmode sql;
-------------------------------------------------------------------
|              参数                |             当前值           |
-------------------------------------------------------------------
|    startwal                      |                              |
|    endwal                        |                              |
|    starttime                     |                              |
|    endtime                       |                              |
|    resmode(Data Restore Mode)    |              TX              |
|    exmode(Data Export Mode)      |              SQL             |
------------------------------------------------------------------
test.public=# unload tab t_xff;
正在解析表 &lt;t_xff&gt;. 已解析数据页: 1, 已解析数据: 5 条
表名&lt;t_xff&gt;-&lt;/data/kingbase/v9/data/base/13856/16384&gt; 解析完成, 1 个数据页 ,共计 5 条数据. 成功 5 条; 失败 0 条 
COPY文件路径为:&lt;test/public/t_xff.sql&gt;

test.public=# unload ddl;

DDL导出完成. 文件路径: test/DDL/public_ddl.sql, 共计 1 张表
</pre>
<p>查看恢复结果,证明可以完美恢复金仓中表的数据</p>
<pre class="brush: bash; title: ; notranslate">
[root@xifenfei pdu]# cat test/public/t_xff.sql
INSERT INTO t_xff VALUES(1,'汉字');
INSERT INTO t_xff VALUES(2,'xff测试');
INSERT INTO t_xff VALUES(3,'惜分飞测试');
INSERT INTO t_xff VALUES(4,'www.xifenfei.com');
INSERT INTO t_xff VALUES(5,'www.xifenfie.com
www.orasos.com');
[root@xifenfei pdu]# cat test/DDL/public_ddl.sql
CREATE SCHEMA public;
set search_path to public;
CREATE TABLE t_xff(
        id int,
        name varchar
);
</pre>
<p><strong>pdu恢复金仓数据库delete数据</strong><br />
删除数据尝试恢复</p>
<pre class="brush: sql; title: ; notranslate">
test=# delete from t_xff where id in(4,2);
DELETE 2
test=# checkpoint;
CHECKPOINT
test=# select * from t_xff;
 id |       name       
----+------------------
  1 | 汉字
  3 | 惜分飞测试
  5 | www.xifenfie.com+
    | www.orasos.com
(3 rows)
</pre>
<p>使用pdu恢复被删除数据</p>
<pre class="brush: bash; title: ; notranslate">
PDU.public=# use test;
|----------------------------------------|
|          模式             |  表数量    |
|----------------------------------------|
|    public                 |  1         |
|----------------------------------------|
test.public=# set public;
|--------------------------------------------------|
|               表名                  |  表大小    |
|--------------------------------------------------|
|    t_xff                            |  8.00 KB   |
|--------------------------------------------------|

        仅显示表大小排名前 1 的表名
test.public=# scan t_xff;

正在扫描表&lt;t_xff&gt;的删除记录...

开始扫描归档目录
|-起始文件&lt;000000010000000000000005&gt;
|-终点文件&lt;000000010000000000000009&gt;

正在扫描中

-------------------------------------------------------------------
当前为 事务号恢复 模式,扫描结果将以 事务号 为单位进行输出
---------------------------------------------------------------------

读取到最后的日志段： 0/504EC68: 


扫描结束,当前扫描的时间段为
|-开始时间：2025-04-06 19:13:15.280234 CST
|-结束时间：2025-04-08 01:45:59.493354 CST

---------------------------------------------------------------------------------------------------------
 时间戳：2025-04-08 01:45:59.493354 CST | 事务号：1120 | 数据文件oid：16384 | toast文件oid：0 |待恢复条数：2 
---------------------------------------------------------------------------------------------------------
test.public=# restore del 1120;
开始扫描归档目录
|-起始文件&lt;000000010000000000000005&gt;
|-终点文件&lt;000000010000000000000009&gt;

正在扫描中
读取到最后的日志段： 0/504EC68: 
|-已解析出2条数据读取到最后的日志段： 0/504EC68: 


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
解析结果：成功 2, 失败 0 (即对应FPW未找到), 共计2条数据
恢复出的csv文件路径为&lt;restore/public/t_xff_1120.csv&gt;
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

扫描结束,当前扫描的时间段为
|-开始时间：2025-04-06 19:13:15.280234 CST
|-结束时间：2025-04-08 01:45:59.493354 CST

restore完成
test.public=# exit;
[root@xifenfei pdu]# cat restore/public/t_xff_1120.csv
2       xff测试
4       www.xifenfei.com
</pre>
<p>通过上述测试,证明pdu工具可以完美的恢复金仓中刚刚被删除的delete数据.</p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/03/pdu-pg-delete-recovery.html" rel="bookmark" class="crp_title">pg删除数据恢复&#8212;pdu恢复pg delete数据</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/03/pdu-single-oid-recovery.html" rel="bookmark" class="crp_title">PostgreSQL恢复工具&#8212;pdu恢复单个表文件</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/09/pg-truncate-recovery.html" rel="bookmark" class="crp_title">Postgres数据库truncate表无有效备份恢复</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><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/03/%e9%80%9a%e8%bf%87%e4%bf%ae%e6%94%b9%e5%9f%ba%e8%a1%a8link%e8%ae%a9%e9%9d%9epublic-dblink%e5%8f%98%e4%b8%bapublic.html" rel="bookmark" class="crp_title">通过修改基表(link$)让非public dblink变为public</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/02/pdu-threshold.html" rel="bookmark" class="crp_title">PostgreSQL恢复工具&#8212;pdu工具介绍</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/07/ora-04091.html" rel="bookmark" class="crp_title">触发器引起ORA-04091</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/2011/07/mysqldumpmysqlbinlog%e6%81%a2%e5%a4%8d%e6%b5%8b%e8%af%95.html" rel="bookmark" class="crp_title">mysqldump+mysqlbinlog恢复测试</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2010/08/mysql-%e4%bd%bf%e7%94%a8%e4%ba%8c%e8%bf%9b%e5%88%b6%e6%97%a5%e5%bf%97%e6%96%87%e4%bb%b6%e6%81%a2%e5%a4%8d%e6%95%b0%e6%8d%ae%e5%ba%93.html" rel="bookmark" class="crp_title">mysql 使用二进制日志文件恢复数据库</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/03/%e9%80%9a%e8%bf%87%e4%bf%ae%e6%94%b9col-col%e6%94%b9%e5%8f%98%e5%88%97%e5%b1%95%e7%a4%ba%e9%a1%ba%e5%ba%8f.html" rel="bookmark" class="crp_title">通过修改col$.col#改变列展示顺序</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/03/grant-dml-to-public-authorization-expires.html" rel="bookmark" class="crp_title">表dml操作权限授权给public,导致只读用户失效</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2025/04/pdu-support-kingbasees-recovery.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
