---
title: OceanBase 数据库主备集群切换，获取 switchover_scn 供 DSG、OMS 指向新主集群断点续传-OceanBase数据库使用指南
description: 了解OceanBase数据库在实际应用中关于 OceanBase 数据库主备集群切换，获取 switchover_scn 供 DSG、OMS 指向新主集群断点续传相关的常见问题和使用技巧，帮助您快速解决 OceanBase 数据库主备集群切换，获取 switchover_scn 供 DSG、OMS 指向新主集群断点续传的难题。
---
切换语言

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

划线反馈

# OceanBase 数据库主备集群切换，获取 switchover_scn 供 DSG、OMS 指向新主集群断点续传

更新时间：2026-05-09 08:26

适用版本： V3.1.x、V3.2.x 内容类型：TechNote  

OceanBase 数据库增量同步工具如 DSG、OMS 尚不支持指向备集群进行 CDC 抽取，因此 OceanBase 数据库集群主备切换时，需适配变更指向新主集群 switchover SCN 位点续传。

## 详细说明

以下为 OceanBase 数据库主备集群切换时，获取准确 `siwtchover_scn` 位点指令及查询示例。

切换后在新主集群 SYS 租户下，执行如下语句。

```shell
[oceanbase]> select gmt_create,module,event,name1,usec_to_time(value4) as switchover_timestamp,value4 as switchover_scn from __all_rootservice_event_history where module='switch_cluster' and name4='switchover_timestamp';
+----------------------------+----------------+----------------------------+-------+----------------------------+------------------+
| gmt_create                 | module         | event                      | name1 | switchover_timestamp       | switchover_scn   |
+----------------------------+----------------+----------------------------+-------+----------------------------+------------------+
| 2024-11-23 01:00:46.597627 | switch_cluster | precheck_sys_tenant_schema | ret   | 2024-11-23 01:00:39.514112 | 1732294839514112 |
| 2024-11-23 01:00:46.616999 | switch_cluster | precheck_log_latest        | ret   | 2024-11-23 01:00:39.514112 | 1732294839514112 |
+----------------------------+----------------+----------------------------+-------+----------------------------+------------------+
2 rows in set (0.009 sec)

[oceanbase]> select * from v$ob_cluster_event_history where facility='switchover to primary' order by timestamp desc limit 3;
+-----------------------+----------+------------+----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| facility              | severity | error_code | timestamp                  | message                                                                                                                                                                    |
+-----------------------+----------+------------+----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| switchover to primary | CONTROL  | 0          | 2024-11-23 01:00:46.683730 | flag:"finish", switchover_timestamp:1732294839514112, cost:108977, ddl_stmt_str:"ALTER SYSTEM COMMIT TO SWITCHOVER TO PRIMARY", trace_id:xxxxxxxxxxxx-xxxxxxxxxxxxxxxx-x-x |
| switchover to primary | CONTROL  | 0          | 2024-11-23 01:00:46.574752 | flag:"start", ddl_stmt_str:"ALTER SYSTEM COMMIT TO SWITCHOVER TO PRIMARY", trace_id:xxxxxxxxxxxx-xxxxxxxxxxxxxxxx-x-x                                                      |
+-----------------------+----------+------------+----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.011 sec)

```

## 影响租户

影响 OceanBase 数据库中的 SYS 租户和 Oracle 租户以及 MySQL 租户。

## 适用版本

OceanBase 数据库 V3.x 版本。

上一篇

[备集群宏块与主库不一致导致 sstable checksum not equal 的原因和解决方法](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000002554552)

下一篇

[在 OceanBase 数据库 V3.x 版本中进行主备切换时报错 ERROR 4179 (HY000): pre-check failed, switchover to standby not allowed 的原因和解决方法](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000002397946) ![有帮助](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) 咨询热线
