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/

相关推荐
嘻哈baby29 分钟前
Redis高可用部署与集群管理实战
数据库·redis·bootstrap
DolphinDB智臾科技2 小时前
DolphinDB 面向金融交易与定价的统一数据模型
数据库·时序数据库
檀越剑指大厂2 小时前
时序数据库性能之战:金仓数据库如何在复杂场景下反超 InfluxDB?
数据库·时序数据库
计算机毕设VX:Fegn08952 小时前
计算机毕业设计|基于springboot + vue图书借阅管理系统(源码+数据库+文档)
数据库·vue.js·spring boot·后端·课程设计
数据与人2 小时前
mongodb报错Sort exceeded memory limit of 104857600 bytes
数据库·mongodb
程序员鱼皮2 小时前
消息队列从入门到跑路,保姆级教程!傻子可懂
数据库·程序员·消息队列
C++业余爱好者2 小时前
SQL语言家族入门指南:标准SQL、T-SQL与PL/SQL详解
数据库·sql
白驹过隙^^3 小时前
OB-USP-AGENT安装使用方法
数据库·经验分享·网络协议·tcp/ip·github·ssl
计算机程序设计小李同学3 小时前
基于Python的在线零食购物商城系统的设计与实现
数据库·sqlite
Java爱好狂.3 小时前
Java面试Redis核心知识点整理!
java·数据库·redis·分布式锁·java面试·后端开发·java八股文