SinoDB数据库导入导出工具onunload/onload

onunload以二进制形式将数据库或表写到磁带上或磁盘上。当写到磁盘时,以磁盘页为单位卸下数据,这种方式卸下的数据其效率高于dbexport。

1.onunload语法

复制代码
onunload [-l] [-t <tape_device>] [-b <block size>] [-s <tape size>]
<db_name>[:[<owner>.]<table_name>]
  • tape_device:保存数据的磁带设备。当使用磁盘时,需创建一个空文件并指定该文件。

  • db_name:要导出数据的数据库名称。如果不指定表名称,则导出全库数据。

  • table_name:当需要导出表数据时,指定表名称。

  • 参数b,参数s和参数l主要用于使用磁带设备,当使用磁盘设备时,可以忽略。

示例1:卸载数据库

复制代码
[informix@vm84145 data] touch testdb1.bin

[informix@vm84145 data]$ onunload -t testdb1.bin testdb1

Please mount tape and press Return to continue ...

Please label this as tape number 1 in the tape sequence.

示例2:卸载表

复制代码
[informix@vm84145 data] touch mytable.bin

[informix@vm84145 data]$ onunload -t mytable.bin testdb1:t1

Please mount tape and press Return to continue ...

Please label this as tape number 1 in the tape sequence.

[informix@vm84145 data]$

2. onload语法

复制代码
onload [-l] [-t <tape_device>] [-b <block size>] [-s <tape size>]

[-d <data_dbs>] <db_name>[:[<owner>.]<table_name>]

[{-i <old index name> <new index name>}]

[{-fd old-DBspace-name new-DBspace-name}]

[{-fi index-name old-DBspace-name new-DBspace-name}]

[{-c <old constraint name> <new constraint name>}]
  • tape_device:保存数据的磁带设备或操作系统文件目录。当为操作系统的文件时,需要指定该文件。

  • data_dbs:指定数据导入时,使用的数据库空间。

  • db_name:指定导入的数据库名称。

  • table_name:指定导入的表名称。

示例1:加载数据库

复制代码
[informix@vm84145 data]$ onload -t testdb1.bin -d datadbs1 testdb1

Please mount tape and press Return to continue ...

The load has successfully completed.

[informix@vm84145 data]$

示例2:加载表

复制代码
[informix@vm84145 data]$ onload -t mytable.bin -d datadbs1 testdb1:t1

Please mount tape and press Return to continue ...

Error creating table.

Duplicate table name t1.

[informix@vm84145 data]$ onload -t mytable.bin -d datadbs1 testdb1:t2

Please mount tape and press Return to continue ...

The load has successfully completed.

3.onunload/onload操作注意点

  • 导出数据为二进制格式,只能用于兼容硬件上的兼容数据库版本的数据导入。由于该方式使用限制较严格,真实场景中使用较少。

  • onunload卸载的数据由onload应用程序装入。

  • 接收数据的机器和创建磁带的机器必须具有相同的页面大小。

  • 只有具有数据库DBA特权的用户才能卸下该数据库。

  • 只有表的属主或具有该表所在数据库的拥有DBA特权的用户才可以卸下该表。

  • 卸载表时,只有与该表有关的数据页和索引页被卸下。该表定义的存取权限和与表有关的同义词或视图未被卸到磁带上。

  • 在卸下操作期间,onunload以排他方式封锁新数据库或表。

  • 无法处理clob数据

更多信息内容请移步星瑞格官方社区,期待大家加入

Sinoregal Tech ForumAsk questions, share solutions, and get to know the Sinoregal community.https://forum.sinoregal.cn/

相关推荐
可涵不会debug4 小时前
【IoTDB】时序数据库选型指南:工业大数据场景下的技术突围
数据库·时序数据库
ByteBlossom4 小时前
MySQL 面试场景题之如何处理 BLOB 和CLOB 数据类型?
数据库·mysql·面试
麦兜*4 小时前
MongoDB Atlas 云数据库实战:从零搭建全球多节点集群
java·数据库·spring boot·mongodb·spring·spring cloud
Slaughter信仰4 小时前
深入理解Java虚拟机:JVM高级特性与最佳实践(第3版)第十章知识点问答(10题)
java·jvm·数据库
麦兜*4 小时前
MongoDB 在物联网(IoT)中的应用:海量时序数据处理方案
java·数据库·spring boot·物联网·mongodb·spring
-Xie-4 小时前
Mysql杂志(十六)——缓存池
数据库·mysql·缓存
七夜zippoe4 小时前
缓存与数据库一致性实战手册:从故障修复到架构演进
数据库·缓存·架构
一个天蝎座 白勺 程序猿5 小时前
Apache IoTDB(5):深度解析时序数据库 IoTDB 在 AINode 模式单机和集群的部署与实践
数据库·apache·时序数据库·iotdb·ainode
QQ3596773456 小时前
ArcGIS Pro实现基于 Excel 表格批量创建标准地理数据库(GDB)——高效数据库建库解决方案
数据库·arcgis·excel