---
title: 分区表 JOIN 报错，错误码 1317-OceanBase数据库使用指南
description: 了解OceanBase数据库在实际应用中关于分区表 JOIN 报错，错误码 1317相关的常见问题和使用技巧，帮助您快速解决分区表 JOIN 报错，错误码 1317的难题。
---
切换语言

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

划线反馈

# 分区表 JOIN 报错，错误码 1317

更新时间：2026-05-21 09:16

适用版本： V2.2.x 内容类型：Troubleshoot  

本文介绍对分区表 JOIN 报 1317 错误的问题排查方法以及解决方法。

## 适用版本

OceanBase 数据库 V2.X 版本

## 问题现象

在租户 Primary Zone 设置为 RANDOM，分区表的分区 leader 打散到各个 Zone 的场景中，对两张分区表 t11 与 t12 进行 JOIN 操作报错。

```unknow
obclient> SELECT t11.c1,t12.c2 FROM t11 ,t12 WHERE t11.c1=t12.c1 AND t11.c1=1;
ERROR 1317 (70100): strong consistency across distributed node not supported

```

## 可能原因

1. 查询两张表的表 ID。

   ```unknow
   obclient> SELECT table_id FROM __all_virtual_table WHERE table_name='t11';
   +---------------+
   | table_id      |
   +---------------+
   | 1099511678139 |
   +---------------+
   1 row in set (0.02 sec)
   obclient> SELECT table_id FROM __all_virtual_table WHERE table_name='t12';
   +---------------+
   | table_id      |
   +---------------+
   | 1099511678140 |
   +---------------+
   1 row in set (0.02 sec)

   ```
 2. 根据表 ID ，分别查询两张表的分区 Leader 分布。

   发现两张表的 partition 1 不在同一个节点，t11 的 partition 1 位于`xx.xxx.xx.xxb`，t12 的 partition 1 位于`xx.xxx.xx.xxd`。

   ```unknow
   obclient> SELECT svr_ip,partition_idx,tg_id,partition_state FROM __all_virtual_pg_partition_info WHERE table_id=1099511678139 AND partition_state LIKE 'L%' ORDER BY partition_idx;
   +---------------+---------------+---------------+-----------------+
   | svr_ip        | partition_idx | tg_id         | partition_state |
   +---------------+---------------+---------------+-----------------+
   | xx.xxx.xx.xxa |             0 | 1099511678139 | L_WORKING       |
   | xx.xxx.xx.xxb |             1 | 1099511678139 | L_WORKING       |
   | xx.xxx.xx.xxc |             2 | 1099511678139 | L_WORKING       |
   | xx.xxx.xx.xxd |             3 | 1099511678139 | L_WORKING       |
   | xx.xxx.xx.xxe |             4 | 1099511678139 | L_WORKING       |
   +---------------+---------------+---------------+-----------------+
   5 rows in set (0.12 sec)
   obclient> SELECT svr_ip,partition_idx,tg_id,partition_state FROM __all_virtual_pg_partition_info WHERE table_id=1099511678140 AND partition_state LIKE 'L%' ORDER BY partition_idx;
   +---------------+---------------+---------------+-----------------+
   | svr_ip        | partition_idx | tg_id         | partition_state |
   +---------------+---------------+---------------+-----------------+
   | xx.xxx.xx.xxa |             0 | 1099511678140 | L_WORKING       |
   | xx.xxx.xx.xxd |             1 | 1099511678140 | L_WORKING       |
   | xx.xxx.xx.xxc |             2 | 1099511678140 | L_WORKING       |
   | xx.xxx.xx.xxb |             3 | 1099511678140 | L_WORKING       |
   | xx.xxx.xx.xxe |             4 | 1099511678140 | L_WORKING       |
   +---------------+---------------+---------------+-----------------+

   ```
 3. 对 partition 分布不同的分区进行连接，复现问题。

   ```

   对 partition 分布相同的分区进行连接，查询可以正常执行。

   ```unknow
   obclient> SELECT t11.c1,t12.c2 FROM t11,t12 WHERE t11.c1=t12.c1 AND t11.c1=3;
   +------+------+
   | c1   | c2   |
   +------+------+
   |    3 |    3 |
   +------+------+
   1 row in set (0.01 sec)

   ```

出现该问题的原因是由于 OceanBase 数据库 V2.x 版本如果没有开启 GTS，不支持跨机查询、更新、删除等操作。

## 解决方式

开启 GTS 或将这些表的分区 Leader 切换到同一台 OBServer上，都可以解决该问题。但推荐您在开启 GTS 的同时将表的分区 leader 切换到同一台 OBServer 上。

- 开启 GTS。

  ```unknow
  obclient> SET GLOBAL ob_timestamp_service='GTS';

  ```
 - 将这些表的分区 leader 切换到同一台 OBServer 上。

     1. 创建表组。

       ```unknow
       obclient> CREATE TABLEGROUP tg1 LOCALITY='F,R{ALL_SERVER}@z1' PARTITION BY hash PARTITIONS 5;
       Query OK, 0 rows affected (0.09 sec)

       ```
     2. 将 t11 与 t12 加入表组。

       ```unknow
       obclient> ALTER TABLE t11 SET TABLEGROOUP tg1;
       Query OK, 0 rows affected (0.09 sec)
       obclient> ALTER TABLE t12 SET TABLEGROOUP tg1;
       Query OK, 0 rows affected (0.09 sec)

       ```

上一篇

[V1.4.7x 版本 truncate 分区表导致分区上限超单机限问题](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000000232778)

下一篇

[删除分区失败，错误代码 1235](https://www.oceanbase.com/knowledge-base/oceanbase-database-20000000146) ![有帮助](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) 咨询热线
