- You can use MySQL stored procedures in your business. In this case, you are required to standardize the management process and record the operations for future auditing. To submit a ticket for running a stored procedure, choose Task Management > Data Changes, click +Data Change on the page that appears, and then select Stored Procedure.
Log on to the DMS Enterprise console. Choose Task Management > Data Changes in the left-side navigation pane. On the page that appears, click +Data Change and select Stored Procedure.
Fill in the data change ticket. For more information, see the procedure about parameter settings in Data changes.
Click Submit for Approval after precheck.
After the ticket passes the precheck, click Submit for Approval.
Confirm the ticket information and submit the ticket for approval.
After you click Submit for Approval when the precheck is complete, you need to confirm the ticket information again and then submit the ticket for approval.
Approve the ticket.
DMS Enterprise determines the approval process for tickets of running stored procedures based on the security rules for SQL statements of the target database instance, excluding DML and DDL:
- If the statements are allowed and approval is required, you can submit the ticket and run the stored procedure after the ticket is approved.
- If the statements are allowed and approval is not required, DMS Enterprise runs the stored procedure without the need of approval.
- If the statements are not allowed, you can submit the ticket, but cannot submit the ticket for approval or run the stored procedure.
If approval is required, the stored procedure can be run only after the ticket is approved.
Run the store procedure.
After the ticket is approved, you can set the execution time as required. By default, you need to set the start time for running the stored procedure. If you do not set the start time, the execution starts immediately.
Schedule the execution.
If you do not set the start time for running the stored procedure, the execution starts immediately. If you set the start time for running the stored procedure, the execution starts when the specified time arrives.
View execution details.
After the execution is complete or the execution fails, you can click
View Detailsin the Actions column to view the execution details of each SQL statement.
- You are required to check the business logic of SQL statements in stored procedures. DMS Enterprise only checks key elements, excluding the business logic, of stored procedures.
- When you run a stored procedure, you can neither specify characteristics for SQL transactions, nor back up data in images before the data change.
- You cannot replicate a ticket for changing data by using a stored procedure.
- After you submit a ticket, DMS Enterprise verifies the ticket in the background. You can submit the ticket for approval only after the ticket passes the verification. If the ticket fails the verification, you need to apply for relevant permissions or modify the SQL script in the ticket as required until the ticket passes the verification.
- Only ticket stakeholders, DBAs, and DMS Enterprise administrators can view the ticket information. To view the information about a ticket for which you are not a stakeholder, ask the ticket creator to add you to the ticket stakeholders list. The ticket creator can add a user to the ticket stakeholders list by clicking
Edit Stakeholdersin the Submit Ticket section at the top of a ticket.
- You can click Operation Logs in the Submit Ticket section at the top of a ticket to view historical operations on the ticket.