This topic describes some basic operations for using Web ODC.
Create a user
Example: Edit a user named OBD***@oceanbase.com in OceanBase Developer Center (ODC) as the administrator and grant the permissions of the system_admin role to the user.
After the OceanBase Cloud console, enter the Web ODC. In the left-side navigation pane of the project collaboration window, choose User Permissions > Users. On the Users tab, click Create User.
On the Create User page, complete the user and role settings.
This parameter is optional. You can assign multiple roles to a user. Click the field. In the drop-down list, select the roles that you want to assign to all users that you have created. If no role is available, go to the Create Role page to create one.
Click Create.
Create a data source
ODC in the OceanBase Cloud environment supports the creation of OceanBase MySQL compatible and OceanBase Oracle compatible data sources.
Example: Create an OceanBase MySQL compatible data source in ODC.
In the left-side navigation pane of the project collaboration window, choose Data Sources > Create Data Source > OceanBase MySQL.
In the Create Data Source panel, specify the following information.
Parameter Description Endpoint The database instance. You can select a cluster instance or a tenant instance. Database Account - Database User Name: the username of an account created in the tenant. In the MySQL compatible mode, this account must have the privilege to access the default database.
- Database Password: the password of the account created in the tenant. You can click Test Connection next to the password field to test whether you can connect to the target database.
Environment You can select an environment type as needed. Valid values: dev, sit, and prod. Project You can choose to bind the created data source to the specified project. After the data source is bound to the project, the databases created in the data source are automatically moved to the project. Note
The system parameterodc.connect.database.sync.block-internal-databasespecifies whether to automatically synchronize built-in databases to the project. The default value is true, which specifies not to automatically synchronize built-in databases to the bound project. The built-in databases identified by ODC for different data sources are as follows:- OceanBase Oracle:
SYS - OceanBase MySQL:
information_schema,mysql,test, andoceanbase - MySQL:
information_schema,mysql, andtest.
Advanced Settings Startup Script: You can configure a connection session by using an SQL statement, such as set session ob_query_timeout=60000000.After you specify the preceding information, click OK in the lower-right corner of the panel.
In the dialog box that appears, enter the data source name and click OK. The data source is then saved to the data source list of ODC.
After the data source is created, you can view the created data source in the data source list.
Create a project
Example: Create the project odc_4.3.x in ODC.
Grant the project creation permission to the user as the ODC system administrator.
Choose Projects > All Projects and click Create Project.
On the Create Project page, configure the following parameters.
Parameter Description Project Name The name of the project. Administrator A user that manages all databases and members of the project. DBA A user that manages all databases of the project. Developer (Optional) A user that can access all databases of the project. Security Administrator (Optional) A user that can manage only sensitive columns of the project and participate in review. Participant (Optional) A user that can view basic project information, apply for database permissions, and submit tickets. Description (Optional) The description of the project. Click OK.
Note
If you do not have the permission to create projects, you can apply for project permissions on the Projects or Tickets tab to join an existing project.
Add a database to the project
Example: Add the odc_test database to the odc_4.3.x project.
| Parameter | Example value |
|---|---|
| Project name | odc_4.3.X |
| Data source | obmysql4.3.X |
| Database name | odc_test |
Choose Projects > All Projects. On the tab that appears, click the project name odc_4.3.x.
On the Databases tab, click Add Database.

In the Add Database dialog box, select the created data source mysql410 and database odc_test, and then click OK.

In the database list, view the added database odc_test.

Click the database name odc_test in the database list, click Log in to Database in the upper-right corner of the Databases tab, or click Log in to Database in the Actions column of the database to log in to the database.

Go to the SQL development window.

Note
If you do not have database permissions, you can apply for database permissions on the Projects > Databases or Tickets tab.
Edit and execute SQL statements
Example: In the SQL window, create a table in the database of the target project.
| Parameter | Example value |
|---|---|
| Project name | odc_4.2.0 |
| Data source | obmysql4.3.0 |
| Database name | odc_test |
| Table name | employee |
In the odc_4.2.0 project, click Log in to Database to go to the SQL window.

In the SQL window, edit an SQL statement to create a table named
employee.
CREATE TABLE odc_test.employee ( emp_no int(120) COMMENT 'Employee ID' NOT NULL, birthday date COMMENT 'Birthday' NULL, name varchar(120) COMMENT 'Employee name' NULL, CONSTRAINT cons_employee_empno PRIMARY KEY (emp_no)) DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;In the SQL window shown in the preceding figure, click
to switch to another database.After you complete writing SQL statements, click Press F8 in the toolbar to run all SQL statements in the current SQL window. The following table describes the icons related to SQL statement execution.
Icon Description Press F8 Click this icon to run all SQL statements in the current SQL window. Run Current Statement (F9) Click this icon to run all selected SQL statements or the statement in the line where the pointer is hovering. Abort Click this icon to abort the running statements. 
On the result tabs, view the execution records and logs.

Note
If you do not have permission to the table, you can query/export/update the table through Table Permissions Apply in Tickets.

Create a database change task
Example: Change the value of name from xiaoguo to xiaofeng in the employee table in the odc_test database.
Choose Projects > All Projects. On the tab that appears, click the project name odc_4.3.x.
On the Tickets tab, choose Database Change > Create New.

In the Create Database Change Task panel, configure the following parameters.

Click Create.
On the Tickets tab, you can view the approval status and basic information of the task in the database change task list.
