Before you use the data migration or synchronization feature of OceanBase Migration Service (OMS) Community Edition, 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.
OceanBase-CE data source
Create an OceanBase Community Edition user
In this example, an OceanBase Community Edition user is created. Specify this user for the
OMSTEST.
Log in to the OceanBase Community Edition console as the system administrator.
In the source business tenant, create a data migration or synchronization user.
CREATE USER '<user_name>' IDENTIFIED BY '<password>';Use the
GRANTstatement to grant privileges to the database user. For more information, see User privileges.
Create a DRC user
If you need to read incremental log data and database object schemas from OceanBase Community Edition, create a DRC user in the sys tenant of the source.
In this example, a DRC user is created. Specify this user for the
user01.
Create a user
CREATE USER <drc_user> IDENTIFIED BY <drc_password>;Grant privileges
GRANT SELECT ON <db_name>.* TO <drc_user>;
Create the __oceanbase_inner_drc_user user
If you need to migrate a table without a primary key, create the __oceanbase_inner_drc_user user in the Source Business Tenant before you execute the data migration task.
Here, the __oceanbase_inner_drc_user user is created. Specify this user for the __oceanbase_inner_drc_user Password field when you create an OceanBase-CE data source.
Create a user
CREATE USER __oceanbase_inner_drc_user IDENTIFIED BY '<password>';Grant privileges
GRANT SELECT ON *.* TO __oceanbase_inner_drc_user;
MySQL data source
The MySQL database user created in this section is used to fill in
Log in to the MySQL database.
Create a user in the MySQL 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 in to the database. If the account is allowed to log in to the database from any host, use percent sign (%). password The password of the user to be created. Execute the
GRANTstatement to grant privileges to the created database user. For more information, see User privileges.
PostgreSQL data source
The PostgreSQL database user created in this section is used to fill in
Log in to the PostgreSQL database.
Create a user in the PostgreSQL database for data migration or synchronization.
CREATE USER <user_name> ENCRYPTED PASSWORD '<password>';Execute the
GRANTstatement to grant privileges to the created database user. For more information, see User privileges.
TiDB data source
The TiDB database user created in this section is used to fill in
Log in 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 in to the database. If the account is allowed to log in to the database from any host, use percent sign (%). password The password of the user to be created. Execute the
GRANTstatement to grant privileges to the created database user. For more information, see User privileges.
ElasticSearch
The ElasticSearch database user created in this section is used to fill in
Create a role.
POST /_security/role/{roleName} { "cluster": ["all"], "indices": [ { "names": [ "*" ], "privileges": ["all"] } ], "metadata": {}, "transient_metadata": { "enabled": true } }Create a user and assign the role to the user.
POST /_security/user/{username} { "password" : "123456", "roles" : ["role"], "full_name" : "username", "email" : "", "metadata" : { } }