OceanBase logo

OceanBase

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

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

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

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 Developer Center

V4.4.0

  • Topics Overview
  • Overview
    • What is ODC?
    • Features
    • Architecture
    • Limitations
    • ODC console
  • Quick Start
    • Client ODC
      • Overview
      • Install Client ODC
      • Use Client ODC
    • Web ODC
      • Overview
      • Deploy Web ODC
      • Use Web ODC
  • Data Source Management
    • Create a data source
    • Data sources and project collaboration
    • Database O&M
      • Session management
      • Global variable management
      • Recycle bin management
  • SQL Development
    • Edit and execute SQL statements
    • Perform PL compilation and debugging
    • Use the command-line window
    • Edit and export the result set of an SQL statement
    • Execution analysis
    • Generate test data
    • System settings
    • Database objects
      • Table objects
        • Overview
        • Create a table
      • View objects
        • Overview
        • Create a view
        • Manage views
      • Materialized view objects
        • Overview
        • Create a materialized view
        • Manage materialized views
      • Function objects
        • Overview
        • Create a function
        • Manage functions
      • Stored procedure objects
        • Overview
        • Create a stored procedure
        • Manage stored procedures
      • Sequence objects
        • Overview
        • Create a sequence
        • Manage sequences
      • Package objects
        • Overview
        • Create a program package
        • Manage program packages
      • Trigger objects
        • Overview
        • Create a trigger
        • Manage triggers
      • Type objects
        • Overview
        • Create a type
        • Manage types
      • Synonym objects
        • Overview
        • Create a synonym
        • Manage synonyms
  • Import and Export
    • Import schemas and data
    • Export schemas and data
  • Database Change Management
    • Manage user permissions
      • Users and roles
      • Automatic authorization
      • User permission management
    • Project collaboration management
    • Risk levels, risk identification rules, and approval processes
    • SQL check specifications
    • SQL window specification
    • Database change management
    • Manage changes to logical databases
    • Batch database change management
    • Online schema changes
    • Synchronize shadow tables
    • Schema comparison
  • Data Lifecycle Management
    • Data archiving
    • Data cleanup
    • Manage partitioning plans
      • Manage partitioning plans
      • Set partitioning strategies
      • Examples of partitioning strategies
    • SQL plan task
  • Data Masking and Auditing
    • Desensitize data
    • Operation records
  • Notification Management
    • Overview
    • View notification records
    • Manage notification channels
      • Create a notification channel
      • View, edit, and delete a notification channel
      • Configure a custom channel
    • Manage notification rules
  • System Integration
    • Login integration
    • Approval integration
    • SQL approval integration
    • Bastion host integration
  • Deployment Guide
    • Deployment overview
    • Preparations before deployment
    • Deploy ODC in single-node mode
    • Deploy ODC in high-availability mode
    • Deployment verification
  • Upgrade Guide
    • Upgrade Overview
    • Preparations before upgrade
    • Update single-node ODC
    • Update high-avaliability ODC
    • Upgrade verification
    • Rollback after upgrade failed
  • Best Practices
    • Tips for SQL development
    • Explore ODC team workspaces
    • Understanding real-time SQL diagnostics for OceanBase AP
    • OceanBase historical database solutions
    • ODC SQL check for automatic identification of high-risk operations
    • Integration with ODC enterprise-level account system
    • Manage and modify sharded databases and tables via ODC
    • Data masking and control practices
    • Enterprise-level control and collaboration: Safeguard every database change
  • Troubleshooting
    • ODC troubleshooting process
    • Collect message
      • View the runtime environment and version information
      • View web ODC logs
      • View client ODC logs
      • View end-to-end ODC-related logs
      • View ODC MetaDB data
      • Query the index status in OceanBase Database V4.x
      • Query the index status in OceanBase Database V1.4.x to V3.2.x
      • Collect JVM runtime information
      • Use tcpdump to capture packets
    • FAQ
      • Installation of client ODC
      • Web ODC deployment and startup
      • Connection Information
      • Command-line window
      • DDL statement display
  • Common features
  • Release Notes
    • V4.4
      • ODC V4.4.0
    • V4.3
      • ODC V4.3.4
      • ODC V4.3.3
      • ODC V4.3.2
      • ODC V4.3.1
      • ODC V4.3.0
    • V4.2
      • ODC V4.2.4
      • ODC V4.2.3
      • ODC V4.2.2
      • ODC V4.2.1
      • ODC V4.2.0
    • V4.1
      • ODC V4.1.3
      • ODC V4.1.2
      • ODC V4.1.1
      • ODC V4.1.0
    • V4.0
      • ODC V4.0.2
      • ODC V4.0.0
    • V3.4
      • ODC V3.4.0
    • V3.3
      • ODC V3.3.3
      • ODC V3.3.2
      • ODC V3.3.1
      • ODC V3.3.0
    • V3.2
      • ODC V3.2.3
      • ODC V3.2.2
      • ODC V3.2.1
      • ODC V3.2.0

Download PDF

Topics Overview What is ODC? Features Architecture Limitations ODC console Overview Install Client ODC Use Client ODC Overview Deploy Web ODC Use Web ODC Create a data source Data sources and project collaboration Session management Global variable management Recycle bin management Edit and execute SQL statements Perform PL compilation and debugging Use the command-line window Edit and export the result set of an SQL statement Execution analysis Generate test data System settings Import schemas and data Export schemas and data Users and roles Automatic authorization User permission management Project collaboration management Risk levels, risk identification rules, and approval processes SQL check specifications SQL window specification Database change management Manage changes to logical databases Batch database change management Online schema changes Synchronize shadow tables Schema comparison Data archiving Data cleanup Manage partitioning plans Set partitioning strategies Examples of partitioning strategies SQL plan task Desensitize data Operation records Overview View notification records Create a notification channel View, edit, and delete a notification channel Configure a custom channel Manage notification rules Login integration Approval integration SQL approval integration Bastion host integration Deployment overview Preparations before deployment Deploy ODC in single-node mode Deploy ODC in high-availability mode Deployment verification Upgrade Overview Preparations before upgrade Update single-node ODC Update high-avaliability ODC Upgrade verification Rollback after upgrade failed Tips for SQL development Explore ODC team workspaces Understanding real-time SQL diagnostics for OceanBase AP OceanBase historical database solutions ODC SQL check for automatic identification of high-risk operations Integration with ODC enterprise-level account system Manage and modify sharded databases and tables via ODC Data masking and control practices Enterprise-level control and collaboration: Safeguard every database change ODC troubleshooting process View the runtime environment and version information View web ODC logs View client ODC logs View end-to-end ODC-related logs View ODC MetaDB data Query the index status in OceanBase Database V4.x Query the index status in OceanBase Database V1.4.x to V3.2.x Collect JVM runtime information Use tcpdump to capture packets Installation of client ODC Web ODC deployment and startup Connection Information Command-line window DDL statement display Common features ODC V4.4.0 ODC V4.3.4 ODC V4.3.3 ODC V4.3.2 ODC V4.3.1 ODC V4.3.0 ODC V4.2.4
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 Developer Center
  3. V4.4.0
iconOceanBase Developer Center
V 4.4.0
  • V 4.4.2
  • V 4.4.1
  • V 4.4.0
  • V 4.3.4
  • V 4.3.3
  • V 4.3.2
  • V 4.3.1
  • V 4.3.0
  • V 4.2.4
  • V 4.2.3
  • V 4.2.2
  • V 4.2.1
  • V 4.2.0
  • V 4.1.3 and earlier

Data archiving

Last Updated:2026-04-07 10:00:35  Updated
share
What is on this page
Background information
Principles
Considerations
Create data archiving task
View a data archiving task
Task information
Execution records
Operation records
References

folded

share

This topic describes how to archive data by submitting a data archiving ticket.

Background information

ODC allows you to archive table data from the source database to another database on a scheduled basis. This way, the increase of online data does not affect the query performance and business operations.

The example in this topic shows you how to archive the employee and order tables from the odc_test database to the test2 database in the same project.

Note

All data in this example is for reference only. You can replace them with actual data.

Principles

1

Considerations

  • Prerequisites:

    • The table to be archived must have a primary key. If the data source type is OceanBase MySQL compatible mode or MySQL, a unique index can also be archived.

    • The database user for archiving data must have the read/write permissions and access permissions to the internal views. For more information, see View user privileges, Overview of users and privileges, and Modify user privileges.

    • The source table columns must be compatible with the target database. The data archiving feature does not handle compatibility issues.

    • Table structure synchronization is not supported for homogeneous archiving links that involve subpartitioning. It is also not supported for heterogeneous databases, which means that you cannot synchronize schemas or create tables automatically.

  • Supported archiving links:

    • Links from OceanBase MySQL compatible mode to OceanBase MySQL compatible mode databases

    • Links from Oracle databases to OceanBase Oracle compatible mode databases

    • Links from MySQL databases to MySQL databases

    • Links from Oracle databases to Oracle databases

    • Links from PostgreSQL databases to OceanBase MySQL compatible mode databases

    • Links from OceanBase MySQL compatible mode, OceanBase Oracle compatible mode, MySQL, Oracle, and PostgreSQL databases to object storage services (OSS, COS, OBS, and S3)

  • Unsupported scenarios:

    • If the OceanBase MySQL compatible mode data source contains the XMLTYPE field type, archiving is not supported.

    • If the OceanBase Oracle compatible mode data source contains the JSON or XMLTYPE field type, archiving is not supported.

    • If the PostgreSQL data source defines tables that contain the array, composite, enumeration, geometric, XML, HSTORE, or full-text search type, archiving is not supported.

    • If the archiving condition contains the LIMIT clause, archiving is not supported.

    • Archiving is not supported if the table contains foreign keys.

  • Supported automatic table creation links:

    • Links from OceanBase Oracle compatible mode to OceanBase Oracle compatible mode databases
    • Links from OceanBase MySQL compatible mode to OceanBase MySQL compatible mode databases
    • Links from MySQL databases to MySQL databases, except for MySQL 5.7 and earlier
  • Supported schema synchronization links:

    • Links from OceanBase MySQL compatible mode to OceanBase MySQL compatible mode

Create data archiving task

  1. In the SQL window, execute the following SQL statements to create an employee table and an order table.

    CREATE TABLE `employee` (
    `emp_no` int(120) NOT NULL COMMENT 'employee number',
    `birthday` date DEFAULT NULL COMMENT 'employee birthday',
    `name` varchar(120) DEFAULT NULL COMMENT 'employee name',
    `time` date NOT NULL COMMENT 'time' COMMENT 'create time',
    PRIMARY KEY (`time`)
    ) partition by range columns(time) (
    partition p2023_01
    values
    less than ('2023-01-01'),
     partition p2023_02
    values
     less than ('2023-02-01')
    );
    
    CREATE TABLE `order` (
    `time` date NOT NULL,
     `parti_key` int(11),
     `name` varchar(120) DEFAULT NULL,
     PRIMARY KEY (`time`, parti_key)
    ) partition by range columns(time, parti_key)
    (partition p2023_01 values less than ('2023-01-01', 20230101),
    partition p2023_02 values less than ('2023-02-01', 20230201));
    
  2. Right-click the name of the source database and choose Scheduled Task > Data Archiving. You can also choose Ticket > Data Archiving > Create Ticket.

    1

  3. On the Create Ticket page, configure the following parameters.

    2

    Parameter Description
    Source Database The database to which the source table belongs.

    Note

    In ODC V4.2.2 and later, you can select a MySQL database to archive data from the MySQL database to the OceanBase database.

    Destination Database The database to which the source table is archived.

    Note

    In ODC V4.2.2 and later, you can select a MySQL database to archive data from the OceanBase database to the MySQL database.

    Archiving Scope
    • Partial archiving: Archive data from specific tables in the source database based on filter conditions.
      • You can set filter conditions by using constants or variables defined in the variable configuration. For example, time<'${create_time}'. In this example, create_time is the name of a variable defined in the variable configuration, and time is a column in the table to be archived.

        Note

        You can set filter conditions for associated tables.

      • If you want to archive data from specific partitions, select the Specify Partition check box.
      • Click +Add to add a table to be archived and archive the table to the destination database.
      • Click +Batch Add to add multiple tables to be archived and archive the tables to the destination database.
    • Archive all tables in the source database.
    Custom Variables Optional. Define variables and set time offsets to archive rows that meet the conditions.
    Execution Mode Select Execute Immediately, Execute On Schedule, or Cycle Execution to specify the task execution mode.
    Task Settings
    • Clean Up Archived Data in Source: If you select this option, data in the source is cleaned up based on the settings. By default, the data is immediately cleaned up and not backed up. You can roll back the cleanup task.
    • Specify Task Duration: If the task is not completed after running for the specified duration, the scheduling is paused and resumed in the next schedule.
    • Synchronize Source and Target Table Schemas: Before task scheduling, schema comparison is performed. If the schemas in the source and destination databases are inconsistent, the task is skipped for the source database.
    • Data Retrieval through Full Table Scan: If you search for data by using full table scan, the processing is more stable but the performance may be affected.
    • Insert Policy: When data archiving is executed, duplicate data is ignored or updated.
    • Set Limit: Configure row throttling and data size throttling.
    Description You can enter up to 200 characters in the description field.
  4. Click Create. On the page that appears, click OK to confirm the archiving SQL statements.

    3

  5. After the task is generated, you can view or delete the task in the Tickets > Data Archiving list.

    4

View a data archiving task

Task information

  1. On the data archiving list on the Tickets page, click View in the Actions column.

    4

  2. In the task details panel that appears, click the Basic Information tab to view the task type, source database, destination database, variable settings, archiving scope, and execution mode.

    5

  3. Click Initiate Again in the lower-right corner. The data archiving information is copied to the Create Ticket panel, allowing you to quickly create a data archiving task.

Execution records

In the task details panel, click the Execution Records tab to view the task status and execution details.

Operation records

In the task details panel, click the Operation Records tab to view the approval status and change history of the task.

7

References

  • Data cleanup

Previous topic

Schema comparison
Last

Next topic

Data cleanup
Next
What is on this page
Background information
Principles
Considerations
Create data archiving task
View a data archiving task
Task information
Execution records
Operation records
References