Updated on 2023-12-13 GMT+08:00

Creating an Event

This section describes how to create an event to periodically respond to specific operations.

If you set event_scheduler to ON and enable the event function, you can manage events.

When event_scheduler is set to OFF, but the event function is enabled, you can only create events and the events do not take effect.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and project.
  3. Click in the upper left corner, and under Databases, click Data Admin Service.
  4. In the navigation pane on the left, choose Development Tool.

    You can also click Go to Development Tool on the overview page.

  5. Locate the DB instance that you want to log in to and click Log In in the Operation column.
  6. On the top menu bar, choose Database Management.
  7. Click Change on the right of the current database to switch to the database where you want to create an event.

    Figure 1 Switching to another database

  8. On the Objects tab page, choose Events.
  9. Click Create Event.
  10. Enter an event name (mandatory) and event definition statements (mandatory), set the execution time, status, and comment, and click Create.

    Figure 2 Event details
    • Event Definition Statements

      Indicates the SQL statements to be executed when a scheduled event is triggered.

    • Dropped upon expiration
      • Indicates that the events to be executed at a fixed point in time will be deleted after they are executed.
      • Indicates that the events to be periodically executed will be deleted at the specified end time.

  11. In the displayed dialog box, click Execute.

    If there are no errors reported, the event takes effect.