---
title: "test_io_device - OceanBase 数据库 V4.5.0 | OceanBase 文档中心"
description: test_io_device test_io_device 命令用于验证备份介质所提供的 I/O 接口和当前的 I/O 权限是否能满足备份恢复的需要。 说明 本文适用于 4.2.1 系列中 V4.2.1_BP10_HF1 及之后版本、4.2.5 系列中 V4.2.5_BP1 及之后版本，以及 V4.3.5 及之后版本…
---
切换语言

- 中文站 - 简体中文
- International - English
- 日本站 - 日本語

文档反馈![](https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*P8CuR4UJ_FkAAAAAAAAAAAAADiGDAQ/original) OceanBase 数据库分布式版 - V 4.5.0

# test_io_device

更新时间：2026-03-02 17:05:34

[编辑](https://github.com/oceanbase/oceanbase-doc/edit/V4.5.0/zh-CN/700.reference/1500.Components-and-Tools/100.manage/200.ob-admin/400.backup-and-recovery/700.test-io-device.md)  

test_io_device 命令用于验证备份介质所提供的 I/O 接口和当前的 I/O 权限是否能满足备份恢复的需要。

#### 说明

本文适用于 4.2.1 系列中 V4.2.1_BP10_HF1 及之后版本、4.2.5 系列中 V4.2.5_BP1 及之后版本，以及 V4.3.5 及之后版本。其他版本的使用介绍可参见如 [test_io_device](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000001576764)。

## 前提条件

在测试前，请确保可以使用 [ossutil](https://help.aliyun.com/zh/oss/developer-reference/overview-59/)、[aws-cli](https://docs.aws.amazon.com/cli/) 等工具成功访问目的端。

## 命令介绍

使用方式如下：

```shell
./ob_admin test_io_device -d'<file_path>' -s'<verify_info>'

```

其中，`-d` 指定模拟备份路径，该路径必须为空目录；`-s` 用于指定对象存储校验信息。设置对象存储时 `-d` 和 `-s` 两个参数都需要配置，设置 NFS 存储时仅需配置 `-d` 参数。

## 示例

test_io_device 命令的简单示例如下。

### 示例一：仅设置 `-d`

```shell
./ob_admin test_io_device -d'file:///data/nfs'

```

输出如下，如果测试通过，按模块输出 `OK` 以及运行时间。

```shell
[NOTICE] If specific log is required, you need to set the environment variable OB_ADMIN_LOG_DIR.
         for example: export OB_ADMIN_LOG_DIR=~/.ob_admin_log
         please notice that log files should not be outputted to OceanBase's clog directory.
succ to open, filename=/dev/null, fd=5, wf_fd=2
succ to open, filename=/dev/null, fd=6, wf_fd=2
[RUN TEST1] Backup dest connectivity
[       OK] Backup dest connectivity (485 ms)
[RUN TEST2] archive log
[       OK] archive log (8638 ms)
[RUN TEST3] backup data
[       OK] backup data (1093 ms)
[RUN TEST4] consume clog file
[       OK] consume clog file (1242 ms)
[RUN TEST5] clean backup file
[       OK] clean backup file (169 ms)
[RUN TEST6] test_object_storage_interface
[       OK] test_object_storage_interface (10903 ms)
[RUN TEST7] test_list_before_complete_multipart_write
[       OK] test_list_before_complete_multipart_write (2077 ms)

```

从输出中可以注意到有一条 `[NOTICE]`，提示如果有查看日志的需要，需设置 `OB_ADMIN_LOG_DIR` 环境变量。如果不设置该环境变量，ob_admin 的日志会输出到 `/dev/null`。后面的示例输出省略这一条提示。

### 示例二：同时设置 `-d` 和 `-s`

```shell
./ob_admin test_io_device -d'oss://home/admin/backup_info' -s'host=http://oss-cn-hangzhou.aliyuncs.com&access_id=111&access_key=222'

```

```shell
[RUN TEST1] Backup dest connectivity
[       OK] Backup dest connectivity (485 ms)
[RUN TEST2] archive log
[       OK] archive log (8638 ms)
[RUN TEST3] backup data
[       OK] backup data (1093 ms)
[RUN TEST4] consume clog file
[       OK] consume clog file (1242 ms)
[RUN TEST5] clean backup file
[       OK] clean backup file (169 ms)
[RUN TEST6] test_object_storage_interface
[       OK] test_object_storage_interface (10903 ms)
[RUN TEST7] test_list_before_complete_multipart_write
[       OK] test_list_before_complete_multipart_write (2077 ms)

```

若测试失败，会输出错误信息、错误码和错误码名称。

- 路径访问权限不足报错

  ```shell
  [RUN TEST1] Backup dest connectivity
  ERROR INFO: The path is inaccessible, please check the path and the storage info parameter
  ERROR CODE: -9071 OB_BACKUP_PERMISSION_DENIED
  [ FAILED! ] Backup dest connectivity (62 ms)

  ```
 - 路径错误报错

  ```shell
  [RUN TEST1] Backup dest connectivity
  ERROR INFO: The path is inaccessible, please check the path and the storage info parameter
  ERROR CODE: -9118 OB_INVALID_OBJECT_STORAGE_ENDPOINT
  [ FAILED! ] Backup dest connectivity (50 ms)

  ```

### 示例三：指定 checksum 校验方法

在使用对象存储作为目的端时，可通过 `-s` 参数指定 `checksum_type` 校验方式，命令如下：

- 指定 md5 作为校验方式

  ```shell
  ./ob_admin test_io_device \
      -d 'oss://oss-bucket/your/test/dir' \
      -s 'host=xxx&access_id=xxx&access_key=xxx&checksum_type=md5'

  ```
 - 指定不做校验

  ```shell
  ./ob_admin test_io_device \
      -d 'oss://oss-bucket/your/test/dir' \
      -s 'host=xxx&access_id=xxx&access_key=xxx&checksum_type=no_checksum'

  ```

 上一篇 下一篇 ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
