OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Migration Service

V4.2.1Community Edition

  • OMS Documentation
  • What's New
  • OMS Community Edition Introduction
    • What is OMS Community Edition?
    • Terms
    • OMS Community Edition HA
    • Architecture
      • Hierarchical functional system
      • Overview
      • Basic components
    • Limits
  • Quick Start
    • Data migration process
    • Data synchronization process
  • Deploy OMS Community Edition
    • Prepare the environment
    • Memory and disk requirements
    • Deployment modes
    • Check the deployment
    • Scale out OMS Community Edition
    • Deploy OMS on multiple nodes in multiple regions
    • System and network requirements
    • Deploy OMS Community Edition on multiple nodes in a single region
    • Deploy OMS Community Edition on a single node
    • Deploy a time-series database (Optional)
  • OMS Community Edition console
    • Overview
    • Log on to the console of OMS Community Edition
    • User center
      • Change your logon password
      • Log off
      • Configure user information
  • Data migration
    • Overview
    • Migrate data from a MySQL database to OceanBase Database Community Edition
    • Migrate data from OceanBase Database Community Edition to a MySQL database
    • Migrate data from HBase to OBKV
    • Migrate data between instances of OceanBase Database Community Edition
    • Migrate data in active-active disaster recovery scenarios
    • Migrate data from a TiDB database to OceanBase Database Community Edition
    • Migrate data from a PostgreSQL database to OceanBase Database Community Edition
    • Manage data migration projects
      • Start and pause a data migration project
      • Manage computing platforms
      • Use tags to manage data migration projects
      • Download and import settings of migration objects
      • View and modify migration objects
      • Change the name of a data migration project
      • Release and delete a data migration project
      • View details of a data migration project
      • Perform batch operations on data migration projects
    • Features
      • Rename a database table
      • Schema migration mechanisms
      • Create and update a heartbeat table
      • Configure matching rules for migration objects
      • DML filtering
      • DDL synchronization
      • Schema migration operations
      • Use SQL conditions to filter data
      • Wildcard rules
      • Set an incremental synchronization timestamp
    • Supported DDL operations in incremental migration and limits
      • DDL synchronization from MySQL database to OceanBase Community Edition
        • Overview of DDL synchronization from a MySQL database to a MySQL tenant of OceanBase Database
        • CREATE TABLE
          • Create a table
          • Create a column
          • Create an index or a constraint
          • Create partitions
        • Data type conversion
        • ALTER TABLE
          • Modify a table
          • Operations on columns
          • Operations on partitions
          • Operations on constraints and indexes
        • TRUNCATE TABLE
        • RENAME TABLE
        • DROP TABLE
        • CREATE INDEX
        • DROP INDEX
        • DDL incompatibilities between MySQL database and OceanBase Community Edition
          • Overview
          • Incompatibilities of DROP INDEX operations
          • Incompatibilities of the ALTER TABLE statement
            • Delete a constrained column
            • Incompatibilities of ALTER TABLE
            • Change the length of a constrained column
            • Change the type of a constrained column
            • Change the length of an unconstrained column
            • Change the type of an unconstrained column
          • Incompatibilities of the CREATE TABLE statement
            • Incompatibilities of CREATE TABLE
            • Column types that are supported to create indexes or constraints
      • Supported DDL operations in incremental migration from OceanBase Community Edition to a MySQL database and limits
      • Supported DDL operations in incremental migration between MySQL tenants of OceanBase Database
  • Data synchronization
    • Data synchronization overview
    • Create a project to synchronize data from OceanBase Database Community Edition to a Kafka instance
    • Create a project to synchronize data from OceanBase Database Community Edition to a RocketMQ instance
    • Manage data synchronization projects
      • View details of a data synchronization project
      • Download and import the settings of synchronization objects
      • View and modify synchronization objects
      • Release and delete a data synchronization project
      • Start and pause a data synchronization project
      • Perform batch operations on data synchronization projects
      • Change the name of a data synchronization project
      • Use tags to manage data synchronization projects
    • Features
      • DML filtering
      • DDL synchronization
      • Rename a topic
      • Use SQL conditions to filter data
      • Column filtering
      • Data formats
  • Create and manage data sources
    • Create data sources
      • Create a RocketMQ data source
      • Create a TiDB data source
      • Create a PostgreSQL data source
      • Create an HBase data source
      • Create a Kafka data source
      • Create an OceanBase-CE data source
      • Create a MySQL data source
    • Manage data sources
      • Copy a data source
      • Delete a data source
      • Edit a data source
      • View data source information
    • Create a database user
    • User privileges
    • Enable binlogs for the MySQL database
  • OPS & Monitoring
    • O&M overview
    • Go to the overview page
    • Server
      • Update the quota
      • View server logs
      • View server information
    • Components
      • Store
        • Create a store
        • Start and pause a store
        • Update the configurations of a store
        • Delete a store
        • View details of a store
      • Incr-Sync
        • Update the configurations of an Incr-Sync component
        • View details of an Incr-Sync component
        • Migrate an Incr-Sync component
        • Delete an Incr-Sync component
        • Start and pause an Incr-Sync component
        • Batch O&M
      • Full-Import
        • View details of a Full-Import component
        • Pause a Full-Import component
        • Rerun and resume a Full-Import component
        • Update the configurations of a Full-Import component
        • Delete a Full-Import component
      • Full-Verification
        • View details of a Full-Verification component
        • Pause a Full-Verification component
        • Rerun and resume a Full-Verification component
        • Update the configurations of a Full-Verification component
        • Delete a Full-Verification component
    • O&M Task
      • View O&M tasks
      • Skip a task or subtask
      • Retry a task or subtask
  • System management
    • Permission Management
      • Overview
      • Manage users
      • Manage departments
    • Alert center
      • Manage alert settings
      • View system alerts
      • View project alerts
    • Associate with OCP
    • System parameters
      • Modify HA configurations
      • Modify system parameters
  • OMS Community Edition O&M
    • OMS logs
    • Set throttling
    • Manage OMS services
    • Component parameters
      • Coordinator
      • Condition
      • Source Plugin
        • Overview
        • StoreSource
        • DataFlowSource
        • LogProxySource
        • KafkaSource (TiDB)
        • HBaseSource
      • Sink Plugin
        • Overview
        • JDBC-Sink
        • KafkaSink
        • DatahubSink
        • RocketMQSink
        • HBaseSink
      • Store parameters
        • Parameters of a MySQL store
        • Parameters of an OceanBase store
      • Parameters of the CM component
      • Parameters of the Supervisor component
    • Component O&M
      • O&M operations for the Supervisor component
      • CLI-based O&M for the Connector component
      • O&M operations for the Store component
    • Component tuning
      • Incr-Sync or Full-Import tuning
  • Reference Guide
    • API Reference
      • StopProject
      • UpdateFullImport
      • Overview
      • ListFullVerifyCorrectionsResult
      • ListProjects
      • DescribeProjectStepMetric
      • ListProjectFullVerifyResult
      • UpdateFullVerification
      • DeleteProject
      • ResumeProject
      • DescribeProject
      • CreateMysqlDataSource
      • CreateOceanBaseDataSource
      • CreateLabel
      • ListAllLabels
      • UpdateIncrSync
      • DescribeProjectSteps
      • ListDataSource
      • ListFullVerifyInconsistenciesResult
      • StartProjectsByLabel
      • ReleaseProject
      • StartProject
      • DescribeProjectProgress
      • StopProjectsByLabel
      • DescribeProjectComponents
      • CreateProject
      • UpdateStore
    • OMS error codes
    • Alert Reference
      • oms_host_down_migrate_resource
      • oms_sync_status_inconsistent
      • oms_host_threshold
      • oms_migration_delay
      • oms_host_down
      • oms_sync_delay
      • oms_migration_failed
      • oms_sync_failed
  • Upgrade Guide
    • Overview
    • Upgrade OMS in single-node deployment mode
    • Upgrade OMS in multi-node deployment mode
    • FAQ
  • FAQ
    • General O&M
      • How do I modify the resource quotas of an OMS container?
      • How do I troubleshoot the OMS server down issue?
      • Deploy InfluxDB for OMS
      • Increase the disk space of the OMS host
    • Project diagnostics
      • What do I do when a store does not have data of the timestamp requested by the downstream?
      • What do I do when OceanBase Store failed to access an OceanBase cluster through RPC?
    • OPS & monitoring
      • What are the alert rules?
    • Data synchronization
      • FAQ about synchronization to a message queue
        • What are the strategies for ensuring the message order in incremental data synchronization to Kafka
    • Data migration
      • Full migration
        • How do I query the ID of a checker?
        • How do I query log files of the Checker component of OMS?
        • What do I do if the destination table does not exist?
        • What can I do when the full migration failed due to LOB fields?
        • What do I do if garbled characters cannot be written into OceanBase Database V3.1.2?
        • How do I query the verification result files of the Checker component of OMS?
      • Incremental synchronization
        • How do I skip DDL statements?
        • How do I update whitelists and blacklists?
        • What are the application scope and limits of ETL?
    • Installation and deployment
      • What do I do when the "Failed to fetch" error is reported?
      • How do I upgrade CDC?
      • How do I upgrade Store?

Download PDF

OMS Documentation What's New What is OMS Community Edition? Terms OMS Community Edition HA Hierarchical functional system Overview Basic components Limits Data migration process Data synchronization process Prepare the environment Memory and disk requirements Deployment modes Check the deployment Scale out OMS Community Edition Deploy OMS on multiple nodes in multiple regions System and network requirements Deploy OMS Community Edition on multiple nodes in a single region Deploy OMS Community Edition on a single node Deploy a time-series database (Optional) Overview Log on to the console of OMS Community Edition Change your logon password Log off Configure user information Overview Migrate data from a MySQL database to OceanBase Database Community Edition Migrate data from OceanBase Database Community Edition to a MySQL database Migrate data from HBase to OBKV Migrate data between instances of OceanBase Database Community Edition Migrate data in active-active disaster recovery scenarios Migrate data from a TiDB database to OceanBase Database Community Edition Migrate data from a PostgreSQL database to OceanBase Database Community Edition Start and pause a data migration project Manage computing platforms Use tags to manage data migration projects Download and import settings of migration objects View and modify migration objects Change the name of a data migration project Release and delete a data migration project View details of a data migration project Perform batch operations on data migration projects Rename a database table Schema migration mechanisms Create and update a heartbeat table Configure matching rules for migration objects DML filtering DDL synchronization Schema migration operations Use SQL conditions to filter data Wildcard rules Set an incremental synchronization timestamp Supported DDL operations in incremental migration from OceanBase Community Edition to a MySQL database and limits Supported DDL operations in incremental migration between MySQL tenants of OceanBase Database Data synchronization overview Create a project to synchronize data from OceanBase Database Community Edition to a Kafka instance Create a project to synchronize data from OceanBase Database Community Edition to a RocketMQ instance View details of a data synchronization project Download and import the settings of synchronization objects View and modify synchronization objects Release and delete a data synchronization project Start and pause a data synchronization project Perform batch operations on data synchronization projects Change the name of a data synchronization project Use tags to manage data synchronization projects DML filtering DDL synchronization Rename a topic Use SQL conditions to filter data Column filtering Data formats Create a RocketMQ data source Create a TiDB data source Create a PostgreSQL data source Create an HBase data source Create a Kafka data source Create an OceanBase-CE data source Create a MySQL data source Copy a data source Delete a data source Edit a data source View data source information Create a database user User privileges Enable binlogs for the MySQL database O&M overview Go to the overview page Update the quota View server logs View server information View O&M tasks Skip a task or subtask Retry a task or subtask Overview Manage users Manage departments Manage alert settings View system alerts View project alerts
OceanBase logo

The Unified Distributed Database for the AI Era.

Follow Us
Products
OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
Resources
DocsBlogLive DemosTraining & Certification
Company
About OceanBaseTrust CenterLegalPartnerContact Us
Follow Us

© OceanBase 2026. All rights reserved

Cloud Service AgreementPrivacy PolicySecurity
Contact Us
Document Feedback
  1. Documentation Center
  2. OceanBase Migration Service
  3. V4.2.1
iconOceanBase Migration Service
V 4.2.1Community Edition
Enterprise Edition
  • V 4.3.2
  • V 4.3.1
  • V 4.3.0
  • V 4.2.5
  • V 4.2.4
  • V 4.2.3
  • V 4.0.2
  • V 3.4.0
Community Edition
  • V 4.2.13
  • V 4.2.12
  • V 4.2.11
  • V 4.2.10
  • V 4.2.9
  • V 4.2.8
  • V 4.2.7
  • V 4.2.6
  • V 4.2.5
  • V 4.2.4
  • V 4.2.3
  • V 4.2.1
  • V 4.2.0
  • V 4.0.0
  • V 3.3.1

Create and update a heartbeat table

Last Updated:2026-04-14 07:41:54  Updated
share
What is on this page
Background
Prerequisites
MySQL database
PostgreSQL database
Create and update a heartbeat table in a MySQL database
Create and update a heartbeat table in a PostgreSQL database

folded

share

This topic describes how to create and update a heartbeat table when you migrate data from a MySQL database, or PostgreSQL database.

Background

When you create a MySQL, or PostgreSQL database, if you select Allow OMS to automatically write heartbeat data into this instance during incremental synchronization. This resolves the problem of high latency when no business data is written in the source database. and the entered database user has the privileges to create and write tables, OMS Community Edition will create a heartbeat table in the corresponding database and update it every 5 seconds.

If you do not want the heartbeat table to be automatically created and updated by OMS Community Edition, you can create a database table and configure a crontab task to periodically perform the UPDATE operation on the source database.

Prerequisites

The source database account is granted the privileges to create databases or schemas and the privileges to read and write heartbeat tables.

MySQL database

  • Grant a database user the privilege to create the drc.heartbeat table:

    GRANT CREATE ON drc.heartbeat TO '<user_name>';
    
  • Grant a database user the privilege to write the drc.heartbeat table:

    GRANT INSERT, UPDATE, DELETE ON drc.heartbeat TO '<user_name>';
    

PostgreSQL database

  • Grant a database user the privilege to create the drc.heartbeat table:

    GRANT CREATE ON SCHEMA public TO '<user_name>';
    
  • Grant a database user the privilege to write the drc.heartbeat table:

    GRANT INSERT, UPDATE, DELETE ON oms_postgres_heartbeat TO '<user_name>';
    

Create and update a heartbeat table in a MySQL database

  • Create a heartbeat table

    CREATE DATABASE IF NOT EXISTS drc;
    CREATE TABLE IF NOT EXISTS drc.heartbeat (`id` smallint(6) NOT NULL DEFAULT 1,`ts` int(11) DEFAULT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB;
    
  • Insert data

    INSERT INTO drc.heartbeat VALUES (1,0) ON DUPLICATE KEY UPDATE ts=0;
    
  • Update data

    UPDATE drc.heartbeat SET ts=%d WHERE id=1;
    

Create and update a heartbeat table in a PostgreSQL database

  • Create a heartbeat table

    CREATE TABLE IF NOT EXISTS public.oms_postgres_heartbeat (id int NOT NULL DEFAULT 1, ts int DEFAULT NULL, PRIMARY KEY (id));
    
  • Insert data

    INSERT INTO public.oms_postgres_heartbeat VALUES (1,0) ON CONFLICT (id) DO UPDATE SET ts=0;
    
  • Update data

    UPDATE public.oms_postgres_heartbeat SET ts=%d WHERE id=1;
    

Previous topic

Use SQL conditions to filter data
Last

Next topic

Schema migration mechanisms
Next
What is on this page
Background
Prerequisites
MySQL database
PostgreSQL database
Create and update a heartbeat table in a MySQL database
Create and update a heartbeat table in a PostgreSQL database