Skip to content

Latest commit

 

History

History
215 lines (135 loc) · 11.6 KB

3.quickstart-using-web-odc.md

File metadata and controls

215 lines (135 loc) · 11.6 KB

Use Web ODC

Create a user

Example: Create a user named ODCUSER1 in ODC as the administrator and grant the system_admin role to the user.

  1. Log on to Web ODC. In the left-side navigation pane, click User Permissions. On the Users tab, click Create User.

    1

  2. On the Create User page that appears, specify the user and role.

    2

    This parameter is optional. You can grant multiple roles to a user. Click the field. In the drop-down list, select the roles that you want to assign to all users you just added. If no role is available, go to the Create Role page to create one.

  3. Click Create to create the user.

Create a data source

Example: Create a data source in ODC for an OceanBase database in MySQL mode.

Parameter Example value
Data Source Name mysql4.2.0
Host IP Address xxx.x.x.x
Port 8080
Cluster Name odc_cluster
Tenant Name mysql_tenant
Database Username odc
Database Password ******
Sys Tenant Account test
Sys Tenant Password ******
  1. Obtain the connection information or connection string of the data source instance. A connection string is in the format of mysql -h host name -P port number -u database username@tenant name # cluster name -D default database -p 'database password'). Example of a connection string:

    -hxxx.x.x.x -P8080 -uodc@mysql_tenant#odc_cluster -Dodc -p'******'
  2. In the left-side navigation pane in the project collaboration window, choose Data Sources > Create Data Source.

    3

  3. In the Create Data Source panel that appears, specify the following information.

    Note

    If you already have the connection string of an OceanBase database, you can directly obtain the required information from the connection string or enter the required information by using the intelligent parsing tool provided on the tab.

    4

    Parameter Description
    Data Source Type OceanBase is selected by default.
    Intelligent Parsing You can paste a connection string to the field. ODC automatically identifies the string and fills in the corresponding value.
    Connection Type The type of the database to be connected. ODC supports the following database types:
    • Independent Deployment/Apsara Stack (OceanBase MySQL/OceanBase Oracle): a database instance deployed in your own environment.
    • Public Cloud (OceanBase MySQL Cloud/OceanBase Oracle Cloud): a database instance deployed on Alibaba Cloud.
    • Logical Database (OceanBase MySQL Sharding): a logical databases, which supports only the MySQL mode.
    Endpoint
    • Host IP: the IP address of the server where the target database is located.
    • Port: the port number of the server where the target database is located.
    • Cluster: the name of the cluster where the target database is located. This parameter is not required for logical databases.
    • Tenant: the name of the tenant in which the target database is located. This parameter is not required for logical databases.
    **Note **
    You can obtain the host name and port number from the details page of the tenant in which the target database is located, such as a tenant created on Alibaba Cloud or in OceanBase Cloud Platform (OCP).
    Database Account
    • Account: the username of an account created in the tenant. In MySQL mode, this account must have the privilege to access the default 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.
    Note
    • An error will be returned if the configurations such as the username, password, and network settings are invalid.
    • You can only connect to a database in the current tenant. Otherwise, a test failure error will be returned.
    • Before saving the settings, you can click Test Connection to test the database connection. If the database username and password are correct, Connection succeeded is displayed. If you use ODC V4.0.0 and later, you can save the connection without setting the database account and password.
    Environment The type of the environment. Valid values: Development, Test, and Production.

    Note

    For more information about how to configure a data source, see Data source management.

  4. Click OK in the lower-right corner of the panel. In the dialog box that appears, enter a connection name.

    5

Create a project

  1. Grant the project creation permission to the user as the ODC system administrator.

    7

  2. Choose Projects > All Projects. Then, click Create Project.

    8

  3. On the Create Project tab that appears, specify the following information.

    9

    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.
    Common Member A user that can access all databases of the project. This parameter is optional.
    Description This parameter is optional.
  4. Click OK. The project is created.

Add databases to the project

Example: Create a database named odc_test in the odc_4.2.0 project.

Parameter Example value
Project Name odc_4.2.0
Data Source mysql410
Database Name odc_test
  1. Choose Project > All Projects, and click the project name odc_4.2.0.

    10

  2. On the Databases tab, click Add Database.

    11

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

    12

  4. In the Databases list, check the odc_test database.

    13

  5. In the Databases list, click Log On to Database in the Actions column for the odc_test database.

    14

  6. Go to the SQL development window.

    15

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 mysql410
The name of the database. odc_test
The name of the table. employee
  1. In the odc_4.2.0 project, click Log On to Database to go to the SQL development window.

    15

  2. In the SQL window, click Select a database to select the project database.

    16

  3. In the Switch Database dialog box, select the target database to which the project belongs.

    17

  4. In the SQL window, edit the following SQL statements to create a table named employee.

    18

    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;
  5. After the SQL statements are edited, click Run F8 in the toolbar to run all SQL statements in the current SQL window.

    Feature Description
    Run F8 Runs all SQL statements in the current window.
    Run the current statement F9 Runs all the selected SQL statements or the SQL statement in the line where the pointer is located.
    Abort Aborts the statement that is being executed.

    19

  6. On the Results tab, view the execution records and logs.

    20

Create a database change task

Example: Change the value of name in the employee table in the odc_test database from xiaoguo to xiaofeng.

Parameter Example value
Project Name odc_4.2.0
Data Source mysql410
The name of the database. odc_test
The name of the table. employee
  1. Choose Project > All Projects, and click the project name odc_4.2.0.

    21

  2. On the Tickets tab, choose Database Changes > Create Database Change.

    22

  3. On the Create Database Change page, enter the following information:

    23

  4. Click Create. The database change task is created.

  5. After the task is generated, you can choose Tasks > Database Changes to view the task approval result and task information.

References