OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase AI DatabaseOceanBase Cloud OceanSeekOceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog ServiceOceanBase DataPilotOceanBase OAgent

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase AI DatabaseOceanBase Cloud OceanSeekOceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog ServiceOceanBase DataPilotOceanBase OAgent
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Migration Service

V4.4.0Enterprise Edition
  • OMS Documentation
  • OMS Introduction
    • Overview of OMS
    • Terms
    • OMS HA
    • Principles of Store
    • Principles of Full-Import and Incr-Sync
    • Data verification principles
    • Architecture
      • Overview
      • Hierarchical functional system
      • Basic components
    • OMS Oracle full migration design and impact
    • Limitations
  • Quick Start
    • Data migration process
    • Data synchronization process
  • Deploy OMS
    • Deployment types
    • System and network requirements
    • Memory and disk requirements
    • Environment preparations
    • Deploy OMS on a single node
    • Deploy OMS on multiple nodes in a single region
    • Deploy OMS on multiple nodes in multiple regions
    • Scale out
    • Scale down deployment
    • Check the deployment
    • Deploy a time-series database (Optional)
  • OMS console
    • Log in to the OMS console
    • Overview
    • User center
      • Configure user information
      • Change your login password
      • Log out
  • Data migration
    • Data Migration Overview
    • Migrate data from a MySQL database to the MySQL-compatible mode of OceanBase Database
    • Migrate data from an OceanBase database in MySQL-compatible mode to a MySQL database
    • Migrate data from an Oracle database to the MySQL compatible mode of OceanBase Database
    • Migrate data from an OceanBase database in Oracle compatible mode to an Oracle database
    • Migrate data from an Oracle database to OceanBase Database in Oracle compatible mode
    • Migrate data from a DB2 LUW database to an Oracle-compatible tenant of OceanBase Database
    • Migrate data from an Oracle-compatible tenant of OceanBase Database to a DB2 LUW database
    • Migrate data from a DB2 LUW database to a MySQL-compatible tenant of OceanBase Database
    • Migrate data from a MySQL-compatible tenant of OceanBase Database to a DB2 LUW database
    • Migrate data between OceanBase databases of the same tenant type
    • Configure a bidirectional synchronization task
    • Migrate data from a TiDB database to a MySQL-compatible tenant of OceanBase Database
    • Migrate data from a PostgreSQL database to the Oracle compatible mode of OceanBase Database
    • Migrate data from a PostgreSQL database to the MySQL compatible mode of OceanBase Database
    • Migrate data from a PolarDB-X 1.0 database to a MySQL-compatible tenant of OceanBase Database
    • Migrate data from a Milvus database to a MySQL-compatible tenant of OceanBase Database
    • Migrate data from an OBSharding database to a MySQL-compatible tenant of OceanBase Database
    • Migrate incremental data from an Oracle-compatible tenant of OceanBase Database to a MySQL database
    • Migrate data from a Doris database to the MySQL-compatible mode of OceanBase Database
    • Migrate data from a DM database to an OceanBase database in MySQL-compatible mode
    • Migrate data from DM Database to OceanBase Database in Oracle compatible mode
    • Migrate data from Elasticsearch to OceanBase Database in MySQL-compatible mode
    • Migrate data from a SQL Server database to OceanBase Database in MySQL-compatible mode
    • Migrate data from an SQL Server database to OceanBase Database in Oracle compatible mode
    • Manage data migration tasks
      • View details of a data migration task
      • Rename a data migration task
      • View and modify migration objects
      • Use tags to Manage data migration tasks
      • Perform batch operations on data migration tasks
      • Download and import settings of migration objects
      • View and modify migration parameters
      • Download a conflict log file
      • Start and pause a data migration task
      • End and delete a data migration task
    • Supported DDL operations and limits for synchronization
      • Synchronize DDL operations from a MySQL database to a MySQL-compatible tenant of OceanBase Database
        • Overview of DDL synchronization from MySQL to OceanBase Database's MySQL compatible mode
        • CREATE TABLE
          • Create a table
          • Create a column
          • Create indexes or constraints
          • Create partitions
        • Data type conversion
        • ALTER TABLE
          • Modify tables
          • Operations on columns
          • Operations on constraints and indexes
          • Partition operations
        • TRUNCATE TABLE
        • RENAME TABLE
        • DROP TABLE
        • CREATE INDEX
        • DROP INDEX
        • DDL incompatibilities between a MySQL database and a MySQL-compatible tenant of OceanBase Database
          • Overview
          • Incompatibilities of the CREATE TABLE statement
            • Incompatibilities of CREATE TABLE
            • Column types that are supported to create indexes or constraints
          • Incompatibilities of the ALTER TABLE statement
            • Incompatibilities of ALTER TABLE
            • Change the type of a constrained column
            • Change the type of an unconstrained column
            • Change the length of a constrained column
            • Change the length of an unconstrained column
            • Delete a constrained column
          • Incompatibilities of DROP INDEX operations
      • Synchronize DDL operations from the MySQL compatible mode of OceanBase Database to a MySQL database
      • DDL operations for synchronizing data from an Oracle database to an Oracle-compatible tenant of OceanBase Database
        • Overview of DDL synchronization from Oracle to OceanBase Database Oracle compatible mode
        • CREATE TABLE
          • Overview for CREATE TABLE
          • Create a relational table
            • Create a relational table
            • Define columns of a relational table
          • Virtual columns
          • Regular columns
          • Create partitions
            • Overview for creating partitions
            • Partitioning
            • Subpartitioning
            • Composite partitioning
            • Custom partitioning
            • Subpartition templates
          • Constraints
            • Overview
            • Inline constraints
            • Out-of-line constraints
        • CREATE INDEX
          • Overview
          • Regular table indexes
        • ALTER TABLE
          • Overview
          • Modify, drop, and add table attributes
          • Column attribute management
            • Modify, drop, and add column attributes
            • Rename a column
            • Add columns and column attributes
            • Modify column attributes
            • Drop columns
          • Modify, drop, and add constraints
          • Partition management
            • Modify, drop, and add partitions
            • Drop a partition
            • Drop a subpartition
            • Add partitions and subpartitions
            • Modify partitions
            • Drop partition data
        • DROP TABLE
        • RENAME OBJECT
        • TRUNCATE TABLE
        • DROP INDEX
        • DDL incompatibilities between an Oracle database and an Oracle-compatible tenant of OceanBase Database
          • Overview
          • Incompatibilities of CREATE TABLE
          • Incompatibilities in table modification operations
            • Incompatibilities of ALTER TABLE
            • Change the type of a constrained column
            • Change the type of an unconstrained column
            • Change the length of a constrained column
            • Change the length of an unconstrained column
      • Synchronize DDL operations from the Oracle compatible mode of OceanBase Database to an Oracle database
      • Synchronize DDL operations from a DB2 LUW database to an Oracle-compatible tenant of OceanBase Database
      • Synchronize DDL operations from the Oracle compatible mode of OceanBase Database to a DB2 LUW database
      • Synchronize DDL operations from a DB2 LUW database to a MySQL-compatible tenant of OceanBase Database
      • Synchronize DDL operations from the MySQL compatible mode of OceanBase Database to a DB2 LUW database
      • Synchronize DDL operations between MySQL-compatible tenants of OceanBase Database
      • Synchronize DDL operations between Oracle-compatible tenants of OceanBase Database
      • Synchronize DDL operations from a PostgreSQL database to the MySQL compatible mode of OceanBase Database
      • Synchronize DDL operations from a PostgreSQL database to the Oracle compatible mode of OceanBase Database
      • Synchronize DDL operations from an OBSharding database to the Oracle compatible mode of OceanBase Database
      • Synchronize DDL operations from an SQL Server database to an OceanBase database
  • Data synchronization
    • Data synchronization overview
    • Synchronize data from OceanBase Database to a Kafka instance
    • Synchronize data from OceanBase Database to a RocketMQ instance
    • Synchronize data from OceanBase Database to a DataHub instance
    • Synchronize data from OceanBase Database to Swift
    • Synchronize data from an ODP logical table to a physical table in a MySQL-compatible tenant of OceanBase Database
    • Synchronize data from an ODP logical table to a DataHub instance
    • Synchronize data from an IDB logical table to a MySQL-compatible tenant of OceanBase Database
    • Synchronize data from an IDB logical table to a DataHub instance
    • Synchronize data from a MySQL database to a DataHub instance
    • Synchronize data from an Oracle database to a DataHub instance
    • Synchronize data from an OBSharding database to Kafka
    • Manage data synchronization tasks
      • View details of a data synchronization task
      • Change the name of a data synchronization task
      • View and modify synchronization objects
      • Use tags to Manage data synchronization tasks
      • Perform batch operations on data synchronization tasks
      • Download and import the settings of synchronization objects
      • View and modify the parameter configurations of a data synchronization task
      • Start and pause a data synchronization task
      • End and delete a data synchronization task
  • Data validation
    • Data verification overview
    • Create a data validation task
    • Manage data validation tasks
      • View details of a data validation task
      • Change the name of a data validation task
      • View and modify validation objects
      • View and modify verification parameters
      • Manage data validation tasks by using tags
      • Import validation objects
      • Start, stop, and resume a data validation task
      • Clone a data validation task
      • Delete a data validation task
  • Create and manage data sources
    • Create data sources
      • Create an OceanBase data source
        • Create a physical OceanBase data source
        • Create an ODP data source
        • Create an IDB data source
        • Create a public cloud OceanBase data source
        • Create a standalone OceanBase data source
      • Create a MySQL data source
      • Create an Oracle data source
      • Create a TiDB data source
      • Create a Milvus data source
      • Create a Kafka data source
      • Create a RocketMQ data source
      • Create a DataHub data source
      • Create a Swift data source
      • Create a DB2 LUW data source
      • Create a PostgreSQL data source
      • Create an SQL Server data source
      • Create a PolarDB-X 1.0 data source
      • Create an OBSharding data source
      • Create a DM data source
      • Create a Doris data source
      • Create an Elasticsearch data source
    • Manage data sources
      • View data source information
      • Copy a data source
      • Edit a data source
      • Delete a data source
    • Create a database user
    • User privileges
    • Enable binlogs for the MySQL database
    • Minimum privileges required when an Oracle database serves as the source
  • OPS & Monitoring
    • O&M overview
    • Go to the overview page
    • Server
      • View server information
      • Add a server
      • Delete a server
      • Update the quota
      • View server logs
      • Manage resource groups
    • Components
      • Store
        • Add a Store component
        • View details of a Store component
        • Update the configurations of a Store component
        • Start and pause a Store component
        • Delete a Store component
      • Incr-Sync
        • View details of an Incr-Sync component
        • Start and pause an Incr-Sync component
        • Migrate an Incr-Sync component
        • Update the configurations of an Incr-Sync component
        • Batch O&M
        • Delete an Incr-Sync component
      • 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
      • Incr-Verification
        • View details of the Incr-Verification component
        • Pause an Incr-Verification component
        • Rerun and resume an Incr-Verification component
        • Update an Incr-Verification component
      • Row-Verification
        • View details of a Row-Verification component
    • O&M Task
      • View O&M tasks
      • Skip a task or subtask
      • Retry a task or subtask
    • Parameter Template
      • Overview
      • Task Template
        • Create a task template
        • View and edit task templates
        • Copy and export a task template
        • Delete a task template
      • Component Template
        • Create a component template
        • View and edit component templates
        • Copy and export a component template
        • Delete a component template
      • Component parameters
        • Store component parameters
        • Incr-Sync component parameters
        • Full-Import component parameters
        • Full-Verification component parameters
        • Incr-Verification component parameters
        • Parameters of the Row-Verification component
        • CM component parameters
        • Supervisor component parameters
  • System management
    • Permission Management
      • Overview
      • Manage users
      • Manage departments
    • Alert center
      • View task alerts
      • View system alerts
      • Manage alert settings
    • Associate with OCP
    • System parameters
      • Modify system parameters
      • Modify HA configurations
      • oblogproxy parameters
    • Manage access keys
    • Operation audit
  • Troubleshooting Guide
    • Manage OMS services
    • OMS logs
    • 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/Full-Import tuning
      • Oracle store tuning
    • Set throttling
    • Store performance diagnostics
  • Reference Guide
    • Features
      • Configure DDL/DML synchronization
      • DDL synchronization scope
      • Rename databases and tables
      • Use SQL conditions to filter data
      • Set the incremental synchronization start timestamp
      • Configure matching rules for migration or synchronization objects
      • Configure matching rules for validation objects
      • Wildcard patterns supported for matching rules
      • Hidden column mechanisms
      • Procedure for schema migration
      • Create and update a heartbeat table
      • Change a topic
      • Column filtering and column mapping
      • Data formats
      • Supported SQL Hints
    • API Reference
      • Overview
      • CreateProject
      • StartProject
      • StopProject
      • ResumeProject
      • ReleaseProject
      • DeleteProject
      • ListProjects
      • Query task details
      • DescribeProjectSteps
      • DescribeProjectStepMetric
      • DescribeProjectProgress
      • DescribeProjectComponents
      • ListProjectFullVerifyResult
      • StartProjectsByLabel
      • StopProjectsByLabel
      • CreateMysqlDataSource
      • CreateOceanBaseDataSource
      • CreateOceanBaseODPDataSource
      • CreatePolarDBDataSource
      • CreateMilvusDataSource
      • ListDataSource
      • CreateLabel
      • ListAllLabels
      • DeleteDataSource
      • CreateProjectModifyRecords
      • ListProjectModifyRecords
      • StopProjectModifyRecords
      • RetryProjectModifyRecords
      • CancelProjectModifyRecord
      • SubmitPreCheck
      • GetPreCheckResult
      • UpdateProjectConfig
      • Download schema conversion information
      • DownloadConflictData
      • ListConflictData
      • ResetIncrStartTimestamp
      • AdvanceProject
      • DescribeRegions
      • Create a user
      • Delete a user
      • Query user details
      • Query department list
      • Upload a Kafka authentication file
      • Create a Kafka data source
      • Create a DB2 LUW data source
    • Alert Reference
      • oms_host_down
      • oms_host_down_migrate_resource
      • oms_host_threshold
      • oms_migration_failed
      • oms_migration_delay
      • oms_sync_failed
      • oms_sync_status_inconsistent
      • oms_sync_delay
    • SSO
      • Integrate OMS with OIDC for SSO
      • Integrate the SAML 2.0 protocol to OMS to implement SSO
      • Access Microsoft Entra ID using OMS SAML 2.0
    • OMS error codes
    • SQL statements for querying database objects
    • Create a trigger
    • Change the log level for a PostgreSQL database instance
    • Online DDL tools
    • Supplemental logging in Oracle databases
    • Configure Milvus topics
  • 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
    • Task diagnostics
      • How do I troubleshoot common problems with Oracle Store?
      • How do I perform performance tuning for Oracle Store?
      • What do I do when Oracle Store reports an error at the isUpdatePK stack?
      • 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?
      • How do I use LogMiner to pull data from an Oracle database?
    • 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
      • User privileges
        • What privileges do I need to grant to a user during data migration to or from an Oracle database?
      • Full migration
        • How do I query the ID of a checker?
        • How do I query log files of the Checker component of OMS?
        • How do I query the verification result files of the Checker component of OMS?
        • What do I do if the target 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?
      • Incremental synchronization
        • How do I skip DDL statements?
        • How do I migrate or synchronize Oracle database objects whose names exceed 30 bytes?
        • How do I update whitelists and blacklists?
        • What are the application scope and limits of ETL?
    • Installation and deployment
      • How do I upgrade Store?
  • Release Note
    • Release Note
      • Version number rules
      • V4.4
        • OMS V4.4.0
      • V4.3
        • OMS V4.3.3
        • OMS V4.3.2
        • OMS V4.3.1
        • OMS V4.3.0
      • V4.2
        • OMS V4.2.5
        • OMS V4.2.4
        • OMS V4.2.3
        • OMS V4.2.2
        • OMS V4.2.1
        • OMS V4.2.0
      • V4.1
        • OMS V4.1.0
      • V4.0
        • OMS V4.0.2
        • OMS V4.0.1
      • V3.4
        • OMS V3.4.0
      • V3.3
        • OMS V3.3.1
        • OMS V3.3.0
      • V3.2
        • OMS V3.2.2
        • OMS V3.2.1
      • V3.1
        • OMS V3.1.0
      • V2.1
        • OMS V2.1.2
        • OMS V2.1.0

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Migration Service
  3. V4.4.0

User privileges

Last Updated:2026-11-26 09:35:11

User privileges required when a MySQL database serves as the source
User privileges required when a MySQL database serves as the destination
User privileges required when OceanBase Database in MySQL-compatible mode serves as the source
User privileges required when the target database is OceanBase Database in MySQL-compatible mode
User privileges required when an Oracle database serves as the source or target
Select an authorization scheme
Procedure for non-minimum authorization
Supplemental privileges by scenario
User privileges required when OceanBase Database in Oracle compatible mode serves as the source
User privileges required for migrating PL objects from the source
User privileges required when the target is an OceanBase Database in Oracle compatible mode
User privileges required for OceanBase Database in Oracle compatible mode V2.2.5 or V2.2.3
User privileges required for OceanBase Database in Oracle compatible mode V2.2.7 and later
User privileges required when migrating source PL objects to the target
User privileges required when a DB2 LUW database serves as the source or destination
User privileges required when a PostgreSQL database serves as the source
User privileges required when a DM database serves as the source or the destination for reverse incremental data flow
Basic read privileges
Additional privileges by scenario
Archiving and logging configuration for incremental synchronization
User privileges required when a TiDB database serves as the source
User privileges required when a SQL Server database serves as the source
User privileges required when DataHub serves as the destination
User privileges required when Kafka serves as the destination
User privileges required when RocketMQ serves as the destination
User privileges required when DM database serves as the source
User privileges required when Elasticsearch is the source
User privileges required when Elasticsearch is the destination

Before you use OceanBase Migration Service (OMS) to migrate databases, ensure that a database user has been created for migration or synchronization on all data sources. This user must have the required privileges on both the source and target data sources.

User privileges required when a MySQL database serves as the source

  • The database user must have read privileges on the database to be migrated. For MySQL databases V5.7 and V8.0, grant the SHOW VIEW privilege as well.

    GRANT SELECT ON <database_name>.* TO '<user_name>';
    
  • During incremental synchronization from a MySQL database, the database user must have the REPLICATION CLIENT, REPLICATION SLAVE, and SELECT *.* privileges.

    GRANT REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO '<user_name>' [WITH GRANT OPTION];
    GRANT SELECT ON *.* TO '<user_name>';
    

    Note

    • During incremental synchronization, lacking read privileges on all tables at the source may cause the task to interrupt abnormally.

    • WITH GRANT OPTION is an optional parameter.

    If you selected Allow OMS to automatically write heartbeat data to this instance during incremental synchronization to resolve high latency issues at the source in scenarios without business writes when adding the MySQL data source, OMS will create and update the drc.heartbeat table for the corresponding MySQL database. In this case, the MySQL database user must have the privileges to create and write to the table. For more information, see Create and update a heartbeat table.

  • When migrating data from a MySQL database to the MySQL-compatible mode of OceanBase Database, if reverse incremental migration is involved, the migration user must also have the CREATE, SELECT, INSERT, UPDATE, and DELETE privileges on the source's test database.

    GRANT CREATE,SELECT,INSERT,UPDATE,DELETE ON test.* TO '<user_name>';
    

User privileges required when a MySQL database serves as the destination

  • The database user must have the CREATE, CREATE VIEW, INSERT, UPDATE, and DELETE privileges on the destination database.

    GRANT <privilege_type> ON <database_name>.<table_name> TO '<user_name>'@'<host_name>' [WITH GRANT OPTION];
    
    Parameter
    Description
    privilege_type Grants operation privileges such as CREATE, INSERT, and UPDATE to the account. To grant all privileges to the account, use ALL.
    database_name The name of the database. To grant operation privileges on all databases to the account, use an asterisk (*).
    table_name The name of the table. To grant operation privileges on all tables to the account, use an asterisk (*).
    user_name The account to be authorized.
    host_name The host from which the account is allowed to log in. To allow the account to log in from any host, use a percent sign (%).
    WITH GRANT OPTION Grants the account the privilege to use the GRANT command. This parameter is optional.
  • For schema migration, the following privileges are required for migrating views and indexes respectively.

    • To migrate views, the database user must have the SELECT privilege.

      GRANT SELECT ON <database_name>.* TO '<user_name>';
      
    • To migrate indexes, the database user must have the INDEX privilege.

      GRANT INDEX ON <database_name>.* TO '<user_name>';
      
  • The database user must have trigger privileges.

    This privilege is used to check whether triggers exist at the destination. If triggers exist, data inconsistency may occur.

    GRANT TRIGGER ON *.* TO '<user_name>';
    

    or

    GRANT TRIGGER ON <database_name>.* TO '<user_name>';
    
  • For bidirectional synchronization tasks between the MySQL-compatible mode of OceanBase Database and a MySQL database, the destination must have the SELECT, CREATE, INSERT, and UPDATE privileges on the oms database.

    GRANT SELECT, CREATE, INSERT, UPDATE ON oms.* TO '<user_name>';
    
  • When creating an incremental verification task, the database user must have the REPLICATION CLIENT and REPLICATION SLAVE privileges.

    GRANT REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO '<user_name>' [WITH GRANT OPTION];
    

User privileges required when OceanBase Database in MySQL-compatible mode serves as the source

When OceanBase Database in MySQL-compatible mode serves as the source, the migration/sync user must have the following privileges:

  • If the destination is a message queue such as Kafka, DataHub, or RocketMQ, the user must have the SELECT privilege on the source database to be synchronized.

    If the destination is a database such as MySQL Database or OceanBase Database in MySQL-compatible mode, the user must have the SELECT privilege on the source database to be migrated and on the oceanbase database.

    GRANT SELECT ON <database_name>.* TO '<user_name>';
    GRANT SELECT ON oceanbase.* TO '<user_name>';
    

    Note

    • The SELECT privilege on the oceanbase database is required only for OceanBase Database in MySQL-compatible mode V4.0.0 and later.

    • For OceanBase Database in MySQL-compatible mode versions earlier than V4.0.0, if you do not grant the oceanbase.* privilege, you must grant the SELECT privilege on oceanbase.gv$table.

  • For incremental data synchronization scenarios, where you need to read incremental log data and database object structure information, create a user under the source sys tenant and grant it the SELECT ON *.* privilege.

    GRANT SELECT ON *.* TO <drc_user>;
    
  • During data migration between instances of OceanBase Database in MySQL-compatible mode, if reverse incremental migration is involved, the migration user must also have the CREATE, SELECT, INSERT, UPDATE, and DELETE privileges on the source test database.

    GRANT CREATE,SELECT,INSERT,UPDATE,DELETE ON test.* TO '<user_name>';
    

User privileges required when the target database is OceanBase Database in MySQL-compatible mode

When OceanBase Database in MySQL-compatible mode serves as the target, the migration user must have the following privileges:

  • The CREATE, CREATE VIEW, DROP VIEW, SELECT, INSERT, UPDATE, ALTER, INDEX, and DELETE privileges on the target database.

    GRANT CREATE, SELECT, INSERT, UPDATE, ALTER, INDEX, DELETE, DROP ON *.* TO '<user_name>';
    GRANT CREATE VIEW ON *.* TO '<user_name>';
    
  • The SELECT privilege on the entire tenant.

    GRANT SELECT ON *.* TO '<user_name>';
    
  • For OceanBase Database in MySQL-compatible mode, when the version is from V4.2.4 to V4.3.0 or from V4.3.3 onwards, serving as the target:

    • The migration user must have trigger privileges to check whether triggers exist in the target. If triggers exist, data inconsistency may occur.

    • If you select schema migration when creating a data migration task and the database table structure contains foreign key constraints, the migration user must also have the REFERENCES privilege on the database where the tables dependent on foreign keys are located.

    You can grant the corresponding database trigger and REFERENCES privileges, or global trigger and REFERENCES privileges.

    • Grant the corresponding database privileges

      GRANT TRIGGER,REFERENCES ON <database_name>.* TO '<user_name>';
      
    • Grant global privileges

      GRANT TRIGGER,REFERENCES ON *.* TO '<user_name>';
      

User privileges required when an Oracle database serves as the source or target

The user privileges required for forward migration when an Oracle database serves as the source and for reverse migration when it serves as the target are the same. After creating a migration user, first select an authorization scheme, then grant additional privileges based on the migration scenario.

Select an authorization scheme

  • Minimal privileges

    When an Oracle database serves as the source, to grant minimal privileges, see Minimal privileges for an Oracle database source.

  • Non-minimal privileges

    Choose an authorization scheme from the following table based on the Oracle database version and whether the environment allows granting the DBA role.

    For Oracle Database 12c and later, further confirm whether the database to connect is a pluggable database (PDB), and refer to the corresponding authorization steps for PDB or non-PDB in the selected scheme.

    Oracle database version
    Allows granting DBA role
    Does not allow granting DBA role
    Before 12c User privileges required for DBA users in Oracle databases earlier than 12c User privileges required for non-DBA users in Oracle databases earlier than 12c
    12c and later User privileges required for a DBA user in Oracle Database 12c and later User privileges required for a non-DBA user in Oracle Database 12c and later

    After completing the above authorization, see Supplemental privileges by scenario to grant the required privileges for the migration scenario.

Procedure for non-minimum authorization

User privileges required for DBA users in Oracle databases earlier than 12c

If your environment allows granting the DBA role to the migration user and the Oracle database version is earlier than 12c, execute the following statement to grant DBA privileges to the migration user:

GRANT DBA TO <user_name>;

User privileges required for non-DBA users in Oracle databases earlier than 12c

If your environment requires more restrictive user authorization and the Oracle database version is earlier than 12c, perform the following operations:

  1. Grant the CONNECT privilege.

    GRANT CONNECT TO <user_name>;
    
  2. Grant the migration user the CREATE SESSION, ALTER SESSION, SELECT ANY TRANSACTION, SELECT ANY TABLE, and SELECT ANY DICTIONARY privileges.

    GRANT CREATE SESSION, ALTER SESSION,
    SELECT ANY TRANSACTION, SELECT ANY TABLE, SELECT ANY DICTIONARY TO <user_name>;
    
  3. Grant the migration user the LOGMINER privilege.

    Note

    If the Oracle data source is configured with Obtain incremental data through Kafka, you do not need to grant the LOGMINER privilege.

    GRANT EXECUTE ON SYS.DBMS_LOGMNR TO <user_name>;
    
  4. Grant the migration user the CREATE TABLE and UNLIMITED TABLESPACE privileges.

    GRANT CREATE TABLE, UNLIMITED TABLESPACE TO <user_name>;
    
  5. If the name of the schema to be migrated is the same as user_name, execute the following statement:

    GRANT CREATE SEQUENCE,CREATE VIEW TO <user_name>;
    

    If the name of the schema to be migrated is different from user_name, execute the following statement:

    GRANT CREATE ANY TABLE,CREATE ANY INDEX,DROP ANY TABLE,ALTER ANY TABLE,COMMENT ANY TABLE,
    DROP ANY INDEX,ALTER ANY INDEX,CREATE ANY SEQUENCE,ALTER ANY SEQUENCE,DROP ANY SEQUENCE,
    CREATE ANY VIEW,DROP ANY VIEW,INSERT ANY TABLE,DELETE ANY TABLE,UPDATE ANY TABLE TO <user_name>;
    

    You can also execute the following statement:

    GRANT CREATE ANY TABLE,CREATE ANY INDEX,DROP ANY TABLE,ALTER ANY TABLE,COMMENT ANY TABLE,
    DROP ANY INDEX,ALTER ANY INDEX,CREATE ANY SEQUENCE,ALTER ANY SEQUENCE,DROP ANY SEQUENCE,
    CREATE ANY VIEW,DROP ANY VIEW TO <user_name>;
    # Add the specific table to be migrated to the Oracle database.
    GRANT DELETE, INSERT, UPDATE ON <database_name>.<table_name> TO <user_name>;
    

User privileges required for a DBA user in Oracle Database 12c and later

If your environment allows granting the database administrator (DBA) role to the migration user and the Oracle database version is 12c or later, you must determine whether a pluggable database (PDB) of 12c, 18c, or 19c is used.

Non-PDB
  1. Execute the following statement to grant DBA privileges to the migration user:

    GRANT DBA TO <user_name>;
    
  2. Execute the following statement to grant the migration user read permission on the SYS.USER$ table:

    GRANT SELECT ON SYS.USER$ TO <user_name>;
    
PDB

When migrating from an Oracle database to an OceanBase Oracle database, if the source is a pluggable database (PDB) of 12c, 18c, or 19c, the account used to pull data from the PDB must be a common user.

  1. Execute the following statement to switch to CDB$ROOT:

    ALTER SESSION SET CONTAINER=CDB$ROOT;
    

    Every common user can connect to the root container (named CDB$ROOT) and any PDB for which they have connection permissions, and perform related operations.

  2. Execute the following statement to grant DBA privileges to the migration user:

    GRANT DBA TO C##XXX CONTAINER=ALL;
    
  3. Execute the following statement to grant the migration user read permission on the SYS.USER$ table:

    GRANT SELECT ON SYS.USER$ TO C##XXX CONTAINER=ALL;
    

User privileges required for a non-DBA user in Oracle Database 12c and later

If your environment requires strict user authorization and the Oracle database version is 12c or later, perform the following operations:

Non-PDB
  1. Grant the CONNECT privilege.

    GRANT CONNECT TO <user_name>;
    
  2. Execute the following statement to grant the migration user read permission on the SYS.USER$ table.

    GRANT SELECT ON SYS.USER$ TO <user_name>;
    
  3. Grant the migration user the CREATE SESSION, ALTER SESSION, SELECT ANY TRANSACTION, SELECT ANY TABLE, and SELECT ANY DICTIONARY privileges.

    GRANT CREATE SESSION, ALTER SESSION, SELECT ANY TRANSACTION, SELECT ANY TABLE, SELECT ANY DICTIONARY TO <user_name>;
    
  4. Grant the migration user the LOGMINER privileges.

    Note

    If the Oracle data source is configured with Obtain incremental data via Kafka, you do not need to grant the LOGMINER privileges.

    GRANT LOGMINING TO <user_name>;
    GRANT EXECUTE ON SYS.DBMS_LOGMNR TO <user_name>;
    
  5. Grant the migration user the CREATE TABLE and UNLIMITED TABLESPACE privileges.

    GRANT CREATE TABLE, UNLIMITED TABLESPACE TO <user_name>;
    
  6. If the name of the schema to be migrated matches user_name, execute the following statement.

    GRANT CREATE SEQUENCE,CREATE VIEW TO <user_name>;
    

    If the name of the schema to be migrated does not match user_name, execute the following statement.

    GRANT CREATE ANY TABLE,CREATE ANY INDEX,DROP ANY TABLE,ALTER ANY TABLE,COMMENT ANY TABLE,
    DROP ANY INDEX,ALTER ANY INDEX,CREATE ANY SEQUENCE,ALTER ANY SEQUENCE,DROP ANY SEQUENCE,
    CREATE ANY VIEW,DROP ANY VIEW,INSERT ANY TABLE,DELETE ANY TABLE,UPDATE ANY TABLE TO <user_name>;
    
PDB

When migrating from an Oracle database to an OceanBase Oracle database, if the source is a pluggable database (PDB) of version 12c, 18c, or 19c, the account used to pull data from the PDB must be a common user.

  1. Grant the CONNECT privilege.

    GRANT CONNECT TO <C##XXX> CONTAINER=ALL;
    
  2. Execute the following statement to grant the migration user read permission on the SYS.USER$ table.

    GRANT SELECT ON SYS.USER$ TO <C##XXX> CONTAINER=ALL;
    
  3. Grant the migration user the CREATE SESSION, ALTER SESSION, SELECT ANY TRANSACTION, SELECT ANY TABLE, and SELECT ANY DICTIONARY privileges.

    GRANT CREATE SESSION, ALTER SESSION,
    SELECT ANY TRANSACTION, SELECT ANY TABLE, SELECT ANY DICTIONARY TO <C##XXX> CONTAINER=ALL;
    
  4. Grant the migration user the LOGMINER privileges.

    Note

    If the Oracle data source is configured with Obtain incremental data via Kafka, you do not need to grant the LOGMINER privileges.

    GRANT LOGMINING TO <C##XXX> CONTAINER=ALL;
    GRANT EXECUTE ON SYS.DBMS_LOGMNR TO <C##XXX> CONTAINER=ALL;
    
  5. Grant the migration user the CREATE TABLE and UNLIMITED TABLESPACE privileges.

    GRANT CREATE TABLE, UNLIMITED TABLESPACE TO <C##XXX> CONTAINER=ALL;
    
  6. If the name of the schema to be migrated matches C##XXX, execute the following statement.

    GRANT CREATE SEQUENCE, CREATE VIEW TO <C##XXX> CONTAINER=ALL;
    

    If the name of the schema to be migrated does not match C##XXX, execute the following statement.

    GRANT CREATE ANY TABLE, CREATE ANY INDEX, DROP ANY TABLE, ALTER ANY TABLE, COMMENT ANY TABLE,
    DROP ANY INDEX, ALTER ANY INDEX,CREATE ANY SEQUENCE,ALTER ANY SEQUENCE, DROP ANY SEQUENCE,
    CREATE ANY VIEW, DROP ANY VIEW, INSERT ANY TABLE, DELETE ANY TABLE, UPDATE ANY TABLE TO <C##XXX> CONTAINER=ALL;
    

Supplemental privileges by scenario

Grant the following corresponding privileges based on whether the Oracle database serves as the source or target, and the operations to be performed.

Notice

For an ADG standby database, granted privileges may sometimes fail to take effect. In this case, you need to execute the command ALTER SYSTEM FLUSH SHARED_POOL; on the standby database to flush the Shared Pool.

Source Oracle database DDL query privilege description

When an Oracle database serves as the source, if you use the DBMS_METADATA.GET_DDL package function to query DDL, the following privileges are required.

GRANT SELECT_CATALOG_ROLE TO <user_name>;

An example statement for querying DDL using the DBMS_METADATA.GET_DDL package function is shown below.

SELECT DBMS_METADATA.GET_DDL('TABLE', '<table_name>', '<schema_name>') FROM DUAL;

Source Oracle database PL object privilege description

When migrating PL objects from an Oracle database to the Oracle compatible mode of OceanBase Database, the source PL objects require the following privileges.

GRANT CREATE ANY PROCEDURE TO <user_name>;
GRANT CREATE ANY TYPE TO <user_name>;
GRANT SELECT ANY SEQUENCE TO <user_name>;
GRANT CREATE ANY TRIGGER TO <user_name>;

Target Oracle database trigger privilege description

When an Oracle database serves as the target, in addition to granting the corresponding privileges based on different versions, the CREATE ANY TRIGGER privilege is also required.

GRANT CREATE ANY TRIGGER TO <user_name>;

Target Oracle database sequence privilege description

When an Oracle database serves as the target, if schema migration is required and the tables to be migrated contain identity columns, the SELECT and CREATE privileges on sequences are also required.

GRANT SELECT ANY SEQUENCE TO <user_name>;
GRANT CREATE ANY SEQUENCE TO <user_name>;

User privileges required when OceanBase Database in Oracle compatible mode serves as the source

When OceanBase Database in Oracle compatible mode serves as the source, the migration/sync user must have the following privileges:

  • For OceanBase Database in Oracle compatible mode versions earlier than V2.2.70, the required privilege for the source migration user is GRANT SELECT ON *.* TO '<user_name>';.

  • For OceanBase Database in Oracle compatible mode V2.2.70 and later, the required privilege for the source migration user is GRANT DBA TO '<user_name>';.

    • For OceanBase Database in Oracle compatible mode V4.0.0 and later, the source migration user must also have the SELECT privilege on the DBA_OB_ARCHIVELOG role.

      GRANT SELECT ON DBA_OB_ARCHIVELOG TO '<user_name>';
      
    • For OceanBase Database in Oracle compatible mode V4.2.0 and later, the source migration user must also have the SELECT privilege on the DBA_OB_TABLE_LOCATIONS role.

      GRANT SELECT ON DBA_OB_TABLE_LOCATIONS TO '<user_name>';
      

User privileges required for migrating PL objects from the source

When migrating PL objects such as sequences, types, stored procedures, functions, packages, triggers, and synonyms from OceanBase Database in Oracle compatible mode, if the migration user is not granted the DBA role, the source user must also have the following privileges.

GRANT SELECT ON SYS.DBA_OBJECTS TO '<user_name>';
GRANT SELECT ON SYS.DBA_SOURCE TO '<user_name>';
GRANT SELECT ON SYS.DBA_SEQUENCES TO '<user_name>';

When reading triggers across schemas, the source user must also have the CREATE ANY TRIGGER privilege.

GRANT CREATE ANY TRIGGER TO '<user_name>';

User privileges required when the target is an OceanBase Database in Oracle compatible mode

The user privileges required vary depending on the version of the OceanBase Database in Oracle compatible mode.

User privileges required for OceanBase Database in Oracle compatible mode V2.2.5 or V2.2.3

You can grant privileges to the migration user by using one of the following two methods:

  • Method 1

    • Execute the following statement to grant all privileges to the migration user. This method is simpler but grants higher-level privileges.

      GRANT ALL PRIVILEGES ON *.* TO '<user_name>';
      
  • Method 2

    1. Grant the SELECT privilege on system views under SYS to the migration user.

      GRANT SELECT ON SYS.* TO '<user_name>';
      
    2. Grant various privileges on business database tables to the migration user. If multiple business databases exist, grant the privileges separately.

      GRANT SELECT, UPDATE, DELETE ON <db_name>.* TO '<user_name>';
      GRANT CREATE, INDEX, ALTER ON <db_name>.* TO '<user_name>';
      

User privileges required for OceanBase Database in Oracle compatible mode V2.2.7 and later

You can grant privileges to the migration user by using one of the following two methods:

  • Method 1

    Execute the following statement. This method is simpler but grants higher-level privileges to the user.

    GRANT DBA TO '<user_name>';
    
  • Method 2

    Grant various privileges on business database tables to the user. If multiple business databases exist, grant the privileges separately.

    GRANT CONNECT TO '<user_name>';
    GRANT CREATE SESSION, ALTER SESSION, SELECT ANY TABLE, SELECT ANY DICTIONARY TO '<user_name>';
    GRANT CREATE ANY TABLE, CREATE ANY INDEX, CREATE ANY VIEW, INSERT ANY TABLE, UPDATE ANY TABLE, ALTER ANY TABLE, DELETE ANY TABLE, DROP ANY INDEX TO '<user_name>';
    

User privileges required when migrating source PL objects to the target

When migrating PL objects from an Oracle database to an OceanBase Database in Oracle compatible mode, the target OceanBase Database in Oracle compatible mode must have the following privileges:

GRANT CREATE ANY PROCEDURE TO '<user_name>';
GRANT CREATE ANY SYNONYM TO '<user_name>';
GRANT CREATE ANY SEQUENCE TO '<user_name>';
GRANT CREATE ANY TRIGGER TO '<user_name>';
GRANT CREATE ANY TYPE TO '<user_name>';

Note

When an OceanBase Database in Oracle compatible mode V3.0.0 or later serves as the target, the CREATE ANY TRIGGER privilege is required.

User privileges required when a DB2 LUW database serves as the source or destination

When a DB2 LUW database serves as the source or destination, the migration user must have administrator (DBADM) privileges.

  1. Connect to the target database.

    db2 CONNECT TO <database_name>
    
  2. Grant database administrator privileges to the migration user.

    db2 GRANT DBADM ON DATABASE TO USER <user_name>;
    

User privileges required when a PostgreSQL database serves as the source

During schema migration from a PostgreSQL database to an OceanBase Database instance in MySQL or Oracle compatible mode, you must grant the SELECT privilege on tables and views to the migration user.

During incremental synchronization from a PostgreSQL database to an OceanBase Database instance in MySQL or Oracle compatible mode, the following privileges are required for the migration user:

  • To avoid potential data loss in scenarios such as adding new tables, rebuilding tables, or table name conflicts, and to reduce the maintenance overhead of multiple publications, OMS subscribes to all tables in the specified database. Therefore, the migration user must have the superuser privilege.

  • The migration user must have the REPLICATION and LOGIN roles and the CREATE PUBLICATION privilege.

    • CREATE USER <user_name> REPLICATION LOGIN ENCRYPTED PASSWORD '<password>';

    • GRANT CREATE ON DATABASE <database_name> TO <user_name>;

  • The migration user must be the owner of the tables to be migrated.

    // Create a role named replication_group.
    CREATE ROLE <replication_group>;  
    // Add the original owner of the tables to be migrated to the replication_group role.
    GRANT <replication_group> TO <original_owner>; 
    // Add the migration account to replication_group as well.
    GRANT <replication_group> TO <replication_user>; 
    // Change the owner of the tables to be migrated to the replication_group role.
    ALTER TABLE <table_name> OWNER TO <replication_group>; 
    
  • If you selected Allow OMS to automatically write heartbeat data to this instance during incremental synchronization to resolve high latency issues at the source when no business data is being written when adding the PostgreSQL data source, OMS creates and updates the oms_postgres_heartbeat table in the corresponding PostgreSQL database. In this case, the PostgreSQL database user must have the privileges to create and write to this table. For more information, see Create and update a heartbeat table.

User privileges required when a DM database serves as the source or the destination for reverse incremental data flow

Before using OceanBase Migration Service (OMS) to migrate data from a DM database, create a database user for migration or synchronization and grant the appropriate privileges based on your actual migration scenario.

This section applies to DM8 in standalone, DW, and DSC modes. When DM serves as the source, it supports migration to the MySQL-compatible mode or Oracle-compatible mode of OceanBase Database. The description for DM as the write destination applies only to the reverse incremental data flow of the original migration link.

Basic read privileges

The following privilege baseline can be used for schema migration, full migration, or data verification. Execute the statements below by an authorized administrator, replacing <user_name> with the actual migration account.

GRANT CREATE SESSION TO <user_name>;
GRANT SOI TO <user_name>;
GRANT VTI TO <user_name>;
GRANT SELECT ANY DICTIONARY TO <user_name>;
GRANT SELECT ANY TABLE TO <user_name>;
GRANT SELECT ANY VIEW TO <user_name>;
GRANT SELECT ANY SEQUENCE TO <user_name>;
Permission or role
Purpose
CREATE SESSION Connect to the DM database.
SOI Query system tables and database object metadata.
VTI Query dynamic management views.
SELECT ANY DICTIONARY Query the system dictionary.
SELECT ANY TABLE Read the business tables to be migrated.
SELECT ANY VIEW Query view-related objects.
SELECT ANY SEQUENCE Query sequence-related objects.

Note

  • The preceding solution is a unified privilege baseline, not a least-privilege-per-object approach.

  • The current schema and full read pre-check pass if the effective privilege set includes ADMIN. Other accounts must meet the four SELECT system privilege requirements; even if the migrated objects belong to the connecting account itself, this does not automatically exempt them.

  • ADMIN refers to the effectively queried privileges. You cannot assume exemption just because the account has a role named DBA. After passing this check, other actual query capability requirements must still be met.

  • If only source-side reading is performed without enabling heartbeat or reverse incremental data flow, the migration account does not require business data write privileges.

Additional privileges by scenario

Incremental synchronization privileges

For full + incremental or incremental-only synchronization, you must configure incremental read privileges. If incremental heartbeat is enabled, you must also grant the privileges to create and read from/write to the heartbeat table. Full migration only requires enabling heartbeat for full reads.

Incremental read privileges

During incremental synchronization, the migration account must also have execute privileges on the SYS.DBMS_LOGMNR package.

GRANT EXECUTE ON SYS.DBMS_LOGMNR TO <user_name>;

The SYS.DBMS_LOGMNR package and its contents must be visible and in the VALID state. The migration account should also be able to read the following information:

  • Metadata of database objects, table columns, constraints, and indexes.
  • Log-mining views such as V$LOGMNR_CONTENTS and V$LOGMNR_LOGS.
  • Parameter, instance, version, and archiving information such as V$DM_INI, V$INSTANCE, V$VERSION, V$RLOG, and V$ARCHIVED_LOG.
  • Cluster member and archiving information such as V$DSC_EP_INFO, V$DM_ARCH_INI, and V$ARCH_FILE in DSC mode.

Note

The SOI, VTI, and dictionary read privileges in basic authorization provide the corresponding access capabilities. Please use the actual migration account to perform a pre-check to confirm that the privileges are effective and that key archival information and the metadata of the selected tables are visible.

Additional privileges when incremental heartbeat is enabled

If heartbeat is enabled for incremental synchronization, OMS manages the heartbeat table in the schema of the data source connection account itself. When heartbeat is not enabled, no additional privileges to create the table or write to it are required for the heartbeat table.

When registering a data source or testing a connection, privileges and existing objects are primarily checked; the heartbeat table is not created immediately as a result. Actual table creation and record initialization occur during the heartbeat initialization phase, which precedes incremental log pull.

If the heartbeat table has not yet been created, the migration account must have the privilege to create the table:

GRANT CREATE TABLE TO <user_name>;

The migration account must also have the capability to initialize, read from, and update the heartbeat table. The account obtains the corresponding operation privileges through object ownership.

Note

  • If the heartbeat table already exists and meets OMS requirements, the account must have the SELECT and UPDATE privileges on that table.

  • The heartbeat table name is determined by the system parameter dm.heartbeat.table-name, with a default value of OMS_HEARTBEAT_DEFAULT. Existing data sources use the heartbeat table they are bound to.

  • In standalone mode, the heartbeat is written to one node; in DW mode, it is written to the current primary node; in DSC mode, it is written to each node in sequence.

  • The schema of the connection account itself must already exist and have sufficient table creation space.

Reverse incremental privileges

When reverse incremental migration is enabled for a migration link, the original DM source will serve as the data write-back endpoint. The migration account must have:

  • The ability to create transaction tables in its own schema and clean up their indexes.
  • The privilege to query, insert, and delete records from transaction tables for transaction deduplication and cleanup of expired records.
  • The SELECT, INSERT, UPDATE, and DELETE privileges on the write-back business tables.

Regular accounts can use the following baseline authorization for creating tables and indexes:

GRANT CREATE TABLE TO <user_name>;
GRANT CREATE INDEX TO <user_name>;

Transaction tables and their indexes are located in the connecting account's own schema. If an account already has the required ownership or equivalent authorization for object operations, no duplicate authorization is needed, nor is it necessary to grant cross-schema privileges such as CREATE ANY INDEX.

If the write-back business table does not belong to the migration account, grant the appropriate privileges on the actual objects:

GRANT SELECT, INSERT, UPDATE, DELETE
ON <schema_name>.<table_name> TO <user_name>;

If the business table belongs to the migration account itself, no duplicate object privileges need to be granted for that table.

Note

  • Reverse incremental migration follows the same switching process as the migration link. Forward and reverse incremental migrations cannot run simultaneously.

  • Writer checks the transaction tables and indexes during initialization; missing objects are automatically created. Even if the transaction tables exist, the account must have the capability to create any missing indexes for initialization to succeed.

  • Cleanup indexes are built on the GMT_CREATE column of the transaction tables. Being unable to create a missing index will cause initialization to fail.

  • Transaction markers are appended in INSERT mode. During recovery, deduplication is performed via SELECT, and expired records are cleaned up in batches via DELETE. Shutting down Writer will not delete the transaction tables or indexes.

  • Adequate tablespace and storage capacity should be reserved for the transaction tables and indexes.

Archiving and logging configuration for incremental synchronization

In addition to account permissions, the DM source also needs to meet the following requirements:

Parameter
Requirements
Archive Enable archiving,ARCH_INI=1and configure the available archive destinations.
Logical Log SettingsRLOG_APPEND_LOGIC=2.
Log Recording Scope You can use theRLOG_IGNORE_TABLE_SET=1Enabled globally. DM also supports setting it to be0When enabling it for the table to be collected.ADD LOGIC LOGHowever, the complete connection procedure for this table-level method to automatically initialize the heartbeat with OMS has not been verified. Therefore, it cannot be used as a verified out-of-the-box solution in this section.
Retention Period The archiving should be continuous and cover the incremental start point, the backlog of tasks, and the window required for fault recovery.
Current Architecture Scope DPC_MODE=0、MPP_INI=0.

You can execute the following read-only statement to check related parameters:

SELECT PARA_NAME, PARA_VALUE
FROM V$DM_INI
WHERE PARA_NAME IN (
    'ARCH_INI',
    'RLOG_APPEND_LOGIC',
    'RLOG_IGNORE_TABLE_SET',
    'DPC_MODE',
    'MPP_INI'
);

Note

  • Archiving or LogMiner is not required to be enabled for full read operations.

  • After configuring parameters, ensure that the required logs have actually been generated. Configuration changes cannot retrospectively capture previously unrecorded logical logs.

  • When using table-level logical logs, you must also overwrite the heartbeat tables relied on by incremental collection. Currently, when OMS automatically creates heartbeat tables, it does not append the ADD LOGIC LOG statement and proceeds directly to initialize records. The timing of supplementing table-level settings after automatic table creation to match the first heartbeat and the start point of collection has not been verified.

  • In DSC mode, you need to overwrite all visible nodes and confirm the relevant configurations and access capabilities node by node.

  • When RLOG_LLOG_COMPRESS, DSC_TRX_CMT_LSN_SYNC, or DSC_TRX_VIEW_SYNC are different from the validated baseline, OMS will provide related observation information and will not block the process directly due to numerical differences.

  • Even after passing the pre-check, the incremental collection component will continue to check archive minability and recovery conditions.

User privileges required when a TiDB database serves as the source

The migration user for a TiDB database must have full SELECT privileges.

GRANT SELECT ON *.* TO '<user_name>';

User privileges required when a SQL Server database serves as the source

For a data migration task from a SQL Server database to an OceanBase database in MySQL or Oracle compatible mode, the following user privileges are required for the migration user:

  • During schema migration and full migration, the migration user must have read permission on the database to be migrated and the privilege to view object definitions, that is, the db_datareader role and the VIEW DEFINITION privilege.

  • During incremental synchronization, the migration user must have permission to read incremental logs, that is, the sysadmin or db_owner role.

    Note

    To enable CDC for a database for the first time (EXECUTE sys.sp_cdc_enable_db), you must use an account with the sysadmin privilege. For details, see the "Prerequisites" section in the corresponding migration topic documentation.

  • If you keep the default checked option Allow OMS to write heartbeat data during data synchronization when adding the SQL Server data source, OMS creates and updates the heartbeat table in the source SQL Server database. In this case, the migration user must have the privileges to create objects and update data, that is, the db_ddladmin and db_datawriter roles.

  • When configuring reverse incremental synchronization, the migration user must also have the db_ddladmin and db_datawriter roles.

Examples of granting these privileges are shown below.

-- Grant database read permission.
USE <database_name>;
GO
ALTER ROLE db_datareader ADD MEMBER <user_name>;
-- Grant the privilege to view object definitions.
GRANT VIEW DEFINITION TO <user_name>;
GO

Note

The ALTER ROLE … ADD MEMBER statement is supported starting with SQL Server 2012. For SQL Server 2008 and 2008 R2, use sp_addrolemember instead:

USE <database_name>;
GO
EXECUTE sp_addrolemember 'db_datareader', <user_name>;
GO

User privileges required when DataHub serves as the destination

DataHub performs authentication based on endpoints, access keys, and secret keys. For more information, see DataHub privilege control.

A DataHub user must have the GetProject, CreateTopic, ListTopic, GetTopic, ListShard, PutRecords, GetRecords, and GetCursor privileges.

User privileges required when Kafka serves as the destination

If authentication is enabled for Kafka, see Create a Kafka data source.

When Kafka serves as the destination, the synchronization user must have privileges to perform the following operations:

  • Create and view topics

  • View topic partition information

  • Write records

  • Read records

User privileges required when RocketMQ serves as the destination

When RocketMQ serves as the destination, the synchronization user must have the privileges to perform the following operations:

  • Create and view topics.

  • View topic message queue information.

  • Write records.

  • Read records.

User privileges required when DM database serves as the source

In this scenario, DM database acts as the source. During schema migration, full data migration, or data verification, OMS only performs read operations at the source. If you allow OMS to write heartbeat data when creating the DM data source, OMS creates and updates the heartbeat table in the DM database. If Reverse Incremental is selected for the migration link, OMS also writes back changes generated at the target after business switchover to the DM database. Therefore, read-only authorization applies only to scenarios where heartbeat writing is disabled and reverse incremental migration is not selected. For other scenarios, grant the additional table creation, write, and update privileges on the basis of the following privileges. It is recommended that you create a dedicated migration user for OMS. Have an authorized administrator execute the following statements, replacing <user_name> with the actual migration username.

GRANT CREATE SESSION TO <user_name>;
GRANT SOI TO <user_name>;
GRANT VTI TO <user_name>;
GRANT SELECT ANY DICTIONARY TO <user_name>;
GRANT SELECT ANY TABLE TO <user_name>;
GRANT SELECT ANY VIEW TO <user_name>;
GRANT SELECT ANY SEQUENCE TO <user_name>;

The purpose of each privilege is as follows:

Permission
Purpose
CREATE SESSION Establish a database connection.
SOI Read directly accessed by OMSSYS.*System tables, as well as metadata for objects such as tables, stored procedures, functions, packages, triggers, and types.
VTI readV$INSTANCE、V$DM_INIand other dynamic management views.
SELECT ANY DICTIONARY OverwriteALL_*、DBA_*、CTISYS.*and access to other system dictionaries. This permission is related toSOIThere is some overlap between them. Retaining all of them can reduce the permission gaps caused by different security baselines of DM.
SELECT ANY TABLE Read data from business tables across schemas for full migration. Schema migration is performed additionally only on auto-increment columns.SELECT MAX(column).
SELECT ANY VIEW Ensure that cross-schema views areALL_VIEWSIt is visible and readable.
SELECT ANY SEQUENCE Ensure that cross-schema sequences areALL_SEQUENCESThe sequence attributes can be viewed and read.

Note

The precheck for data migration verifies whether the migration user has the SOI and VTI roles, as well as the SELECT ANY TABLE, SELECT ANY DICTIONARY, SELECT ANY VIEW, and SELECT ANY SEQUENCE privileges. Lacking any of these will result in a failed precheck.

  • If you allow OMS to write heartbeat data when creating the DM data source, OMS creates and updates the heartbeat table in the DM database (the table name is determined by the system parameter dm.heartbeat.table-name, with a default value of OMS_HEARTBEAT_DEFAULT). The migration user must also have the privileges to create this table and to query and update it. No additional authorization is required for full data migration only. For details, see Create and update the heartbeat table.

  • If Reverse Incremental is selected for the migration link, DM database serves as the write-back endpoint to receive changes generated at the target after business switchover. The migration user must also have the INSERT, UPDATE, and DELETE privileges on the write-back objects.

User privileges required when Elasticsearch is the source

When Elasticsearch serves as the source, OMS needs to read the index's mapping, settings, and document data. You can create the following role using Kibana's Dev Tools or Elasticsearch's Security API, and assign it to the OMS migration user:

POST /_security/role/oms_migration_role
{
  "cluster": ["monitor"],
  "indices": [
    {
      "names": ["*"],
      "privileges": ["view_index_metadata", "read"]
    }
  ]
}

The purpose of each privilege is as follows:

  • view_index_metadata: reads the index's mapping and settings for schema migration.

  • read: reads documents from the index for full migration, incremental synchronization, and data verification.

  • monitor (cluster-level): retrieves index statistics for scenarios such as row count verification.

Note

If the indexes to be migrated have a common prefix, you can configure names with a matching pattern for those indexes to narrow down the scope of privileges.

User privileges required when Elasticsearch is the destination

After you select Reverse Incremental for a data migration task, OMS needs to write the changes generated by OceanBase Database back to Elasticsearch. In this case, the migration user must also have the following privileges:

POST /_security/role/oms_reverse_role
{
  "cluster": ["monitor"],
  "indices": [
    {
      "names": ["*"],
      "privileges": ["write", "view_index_metadata"]
    }
  ]
}
  • write: Writes, updates, and deletes documents in the original index bound to the migration task. OMS does not automatically create indexes, so the create_index privilege is not required.

  • view_index_metadata: Validates the index structure.

Notice

Reverse incremental migration only writes back to the original index bound to the migration task. OMS verifies the index UUID. If the original index has been deleted, it cannot be rebuilt with the same name to continue writing. Therefore, keep the original source index during migration and reverse incremental migration.

Previous topic

Create a database user
Last

Next topic

Enable binlogs for the MySQL database
Next
on this page
User privileges required when a MySQL database serves as the source
User privileges required when a MySQL database serves as the destination
User privileges required when OceanBase Database in MySQL-compatible mode serves as the source
User privileges required when the target database is OceanBase Database in MySQL-compatible mode
User privileges required when an Oracle database serves as the source or target
Select an authorization scheme
Procedure for non-minimum authorization
Supplemental privileges by scenario
User privileges required when OceanBase Database in Oracle compatible mode serves as the source
User privileges required for migrating PL objects from the source
User privileges required when the target is an OceanBase Database in Oracle compatible mode
User privileges required for OceanBase Database in Oracle compatible mode V2.2.5 or V2.2.3
User privileges required for OceanBase Database in Oracle compatible mode V2.2.7 and later
User privileges required when migrating source PL objects to the target
User privileges required when a DB2 LUW database serves as the source or destination
User privileges required when a PostgreSQL database serves as the source
User privileges required when a DM database serves as the source or the destination for reverse incremental data flow
Basic read privileges
Additional privileges by scenario
Archiving and logging configuration for incremental synchronization
User privileges required when a TiDB database serves as the source
User privileges required when a SQL Server database serves as the source
User privileges required when DataHub serves as the destination
User privileges required when Kafka serves as the destination
User privileges required when RocketMQ serves as the destination
User privileges required when DM database serves as the source
User privileges required when Elasticsearch is the source
User privileges required when Elasticsearch is the destination