Before you 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 task and grant corresponding privileges to these users.
Create drc_user
You must create a user in the sys tenant of OceanBase Database, which is used by OMS for authentication when it consumes clogs from an OceanBase database.
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 migration.
When you migrate data from a MySQL tenant of OceanBase Database, create the
__oceanbase_inner_drc_useruser.Create a user
create user __oceanbase_inner_drc_user identified by '<password>';Grant privileges
grant select on *.* to __oceanbase_inner_drc_user;
When you migrate data from an Oracle tenant of OceanBase Database, create the
__OCEANBASE_INNER_DRC_USERuser.Create a user
create user '__OCEANBASE_INNER_DRC_USER'@'%' IDENTIFIED BY '<password>';Grant privileges
OceanBase Database version Statement for granting privileges Versions 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 versions 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 the following ways:- Grant the system privilege:
grant select any table to __OCEANBASE_INNER_DRC_USER; - Grant the object privilege (to a specific database table):
grant select on {schema}.{table} to __OCEANBASE_INNER_DRC_USER;
- Grant the system privilege:
Create a MySQL/TiDB database user
The procedure for creating and granting privileges to a MySQL user is the same as that for a TiDB database user.
Log on to the MySQL/TiDB database.
Create a user in the MySQL/TiDB database for data migration or synchronization.
CREATE USER '<username>'@'<host_name>' IDENTIFIED BY '<password>';Parameter Description username The name of the user to be created. host 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.
Create an Oracle database user
Log on to the Oracle database.
Create a user in the Oracle database for data migration or synchronization.
CREATE USER <username> IDENTIFIED BY "<password>";Use the
GRANTstatement to grant privileges to the created database user. For more information, see User privileges.
Create an OceanBase Database user
For more information about how to manage the user privileges of an OceanBase database, see the OceanBase Database Administrator Guide.
Log on to the OceanBase database as the system administrator.
Create a user in the OceanBase database for data migration or synchronization.
CREATE USER '<username>' IDENTIFIED BY '<password>';Use the
GRANTstatement to grant privileges to the created database user. For more information, see User privileges.
Create a PostgreSQL database user
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.