返回首页

gbase数据、南大通用产品文档:GBase8sarchecker 表级别恢复实用程序

更新日期:2024年09月11日

可以使用 archecker 实用程序执行时间点表级别恢复,这种恢复将从归档和逻辑日志中抽
取表或表的一部分。
archecker 实用程序通过指定要从中抽取数据的源表、放置数据的目标表和链接两个表的
INSERT 语句来恢复表。
有关使用 archecker 实用程序验证备份的信息,请参阅onbar -v 语法:验证备份。


GBase 8s 备份与恢复指南
南大通用数据技术股份有限公司 - 192 -

您可使用可从 UPDATE 语句之内调用的 SQL 函数来导入和导出智能大对象。要了解这
些函数的描述,请参阅 智能大对象函数 页。
下列 UPDATE 语句使用 LOCOPY() 函数来将 BLOB 数据从 fbi_list 表的 mugshot 列复制
到 inmate 表的 picture 列内。(图 1 定义 inmate 和fbi_list 表。)
UPDATE inmate (picture)
SET picture = (SELECT LOCOPY(mugshot, 'inmate', 'picture')
FROM fbi_list WHERE fbi_list.id = 669)
WHERE inmate.id_num = 437;
LOCOPY() 的第一个参数指定从其导出该对象的列(mugshot)。第二个和第三个参数指定
该新创建的对象将使用其存储特性的表(inmate)和列(picture)的名称。该 UPDATE 语
句执行之后,picture 列包含来自 mugshot 列的数据。
当您在该函数参数中指定文件名称的路径时,请应用下列规则:

如果源文件驻留在服务器计算机上,则您必须指定该文件的完全路径名称(而不是
相对于当前工作目录的路径名称)。

如果源文件驻留在客户机计算机上,则您可指定该文件的完全路径名称或相对路径
名称。

示例
示例中所用的表及数据:
DROP TABLE IF EXISTS test;
CREATE TABLE test (ps_partkey bigint,ps_suppkey bigint,ps_availqty
bigint,ps_supplycost decimal(15,2),ps_comment varchar(200));
gbase> select * from test;
+------+------+------+--------+-------------------------------------+
|ps_partkey|ps_suppkey|ps_availqty|ps_supplycost|ps_comment
|
+------+------+------+--------+-------------------------------------
|
1 |
2 | 3325 | 771.64 | , even theodolites. regular
|
|
1 | 2502 | 8076 | 993.49 | ven ideas. quickly
|
|
1 | 5002 | 3956 | 337.09 | after the fluffily ironic
|
|
1 | 7502 | 4069 | 357.84 | al, regular dependencies
|
|
2 |
3 | 8895 | 378.49 | nic accounts. final accounts
|
|
2 | 2503 | 4969 | 915.27 | ptotes. quickly pending
|
|
2 | 5003 | 8539 | 438.37 | blithely bold ideas. furiously
|
|
2 | 7503 | 3025 | 306.39 | olites. deposits wake carefully
|
|
3 |
4 | 4651 | 920.92 | ilent foxes affix furiously quickly |
|
3 | 2504 | 4093 | 498.13 | ending dependencies haggle fluffily |
|
3 | 5004 | 3917 | 645.40 | of the blithely regular theodolites |
|
3 | 7504 | 9942 | 191.92 | unusual, ironic foxes according
|
|
4 |
5 | 1339 | 113.97 | carefully unusual ideas. packages
|
|
4 | 2505 | 6377 | 591.18 | ly final courts haggle
|
|
4 | 5005 | 2694 |