To use the data migration or synchronization feature of OceanBase Migration Service (OMS), you must create dedicated database users in the source and destination databases for the data migration or synchronization project and grant the required privileges to the users.
OceanBase data source
Create an OceanBase Database user
Enter the OceanBase Database user created here in the Database Username field when you create a physical OceanBase data source, a logical OceanBase data source, or a public cloud OceanBase data source. For example, the database username can be OMSTEST.

Log on to the OceanBase database as the system administrator.
Create a user in the source business tenant for data migration or synchronization.
MySQL tenant of OceanBase Database
CREATE USER '<user_name>' IDENTIFIED BY '<password>';Oracle tenant of OceanBase Database
CREATE USER '<user_name>' IDENTIFIED BY <password>;
Use the
GRANTstatement to grant privileges to the created database user. For more information, see User privileges.
Create a DRC user
To read incremental logs and database object schemas from OceanBase Database, you must create a Data Replication Center (DRC) user in the sys tenant of the source database.
Enter the DRC user created here in the DRC User Name field in the Advanced Options section when you create a physical or logical OceanBase data source. For example, the username of the DRC user can be user01.

CREATE USER <drc_user> IDENTIFIED BY '<drc_password>';
GRANT SELECT ON <db_name>.* TO <drc_user>;
Create a sys tenant user
Enter the sys tenant user created here in the sys Tenant Username field in the Advanced Options section when you create a public cloud OceanBase data source whose OceanBase Cluster Version is Before V4.2.0. For example, the username of the sys tenant user can be user02.

CREATE USER <drc_user> IDENTIFIED BY '<drc_password>';
GRANT SELECT ON <db_name>.* TO <drc_user>;
Create the __oceanbase_inner_drc_user user
If you want to migrate data from a table without a primary key, create a user and grant privileges to the user as needed before the migration.
If the source is a MySQL tenant of OceanBase Database, create a user named
__oceanbase_inner_drc_userin the tenant.Enter the
__oceanbase_inner_drc_useruser created here in the __oceanbase_inner_drc_user Password field when you create an OceanBase MySQL data source.
Create the user
CREATE USER __oceanbase_inner_drc_user IDENTIFIED BY '<password>';Grant privileges
GRANT SELECT ON *.* TO __oceanbase_inner_drc_user;
If the source is an Oracle tenant of OceanBase Database, create a user named
__OCEANBASE_INNER_DRC_USERin the tenant.Enter the
__OCEANBASE_INNER_DRC_USER Passworduser created here in the __OCEANBASE_INNER_DRC_USER Password field when you create an OceanBase Oracle data source.
Create the user
CREATE USER '__OCEANBASE_INNER_DRC_USER' IDENTIFIED BY <your_password>;Grant privileges
OceanBase Database version Statement for granting privileges Earlier than V2.2.77 GRANT CREATE SESSION TO '__OCEANBASE_INNER_DRC_USER';
GRANT SELECT ON *.* TO '__OCEANBASE_INNER_DRC_USER';V2.2.77 and later GRANT CREATE SESSION TO '__OCEANBASE_INNER_DRC_USER';GRANT SELECT ANY DICTIONARY TO '__OCEANBASE_INNER_DRC_USER';
You can grant theSELECTprivilege on database tables to be migrated in either of the following ways:- Grant the system privilege:
GRANT SELECT ANY TABLE TO '__OCEANBASE_INNER_DRC_USER'; - Grant privileges on specific database tables:
GRANT SELECT ON <schema>.<table> TO '__OCEANBASE_INNER_DRC_USER';
- Grant the system privilege:
Oracle data source
Enter the Oracle database user created here in the Database Username field when you create an Oracle data source.

Log on to the Oracle database.
Create a user in the Oracle database for data migration or synchronization.
CREATE USER <user_name> IDENTIFIED BY "<password>";Use the
GRANTstatement to grant privileges to the created database user. For more information, see User privileges.
MySQL data source
Enter the MySQL database user created here in the Database Username field when you create a MySQL data source.

Log on to the MySQL database.
Use the
CREATE USERstatement to create a new user.CREATE USER '<user_name>'@'<host_name>' IDENTIFIED BY '<user_password>';Parameter Description user_name The name of the user to be created. host_name The host from which the user is allowed to log on to the database. To allow the user to log on to the database from any host, set this parameter to a percent sign (%). user_password The password of the user. For example, the following sample statement creates a user named
testwho can log on to the MySQL database from any host by using the passwordpassword.CREATE USER 'test'@'%' IDENTIFIED BY 'password';Use the
GRANTstatement to grant privileges to the created database user. For more information, see User privileges.
PostgreSQL data source
Enter the PostgreSQL database user created here in the Database Username field when you create a PostgreSQL data source.

Log on to the PostgreSQL database.
Create a user in the PostgreSQL database for data migration or synchronization.
CREATE USER <user_name> ENCRYPTED PASSWORD '<password>';Use the
GRANTstatement to grant privileges to the created database user. For more information, see User privileges.
TiDB data source
Enter the TiDB database user created here in the Database Username field when you create a TiDB data source.

Log on to the TiDB database.
Create a user in the TiDB database for data migration or synchronization.
CREATE USER '<user_name>'@'<host_name>' IDENTIFIED BY '<password>';Parameter Description user_name The name of the user to be created. host_name The host from which the account is allowed to log on to the database. To allow the account to log on to the database from any host, set this parameter to a percent sign (%). password The password of the user. Use the
GRANTstatement to grant privileges to the created database user. For more information, see User privileges.