Review and release SQL changes
Use SQL tasks to move database changes out of direct SQL Console execution and into a controlled review process. A SQL task keeps submission, approval, execution, and audit in one place.
Overview
SQL tasks cover the main stages of database change governance:
- Submission: Developers submit SQL changes, execution settings, and rollback plans.
- Policy precheck: NineData checks SQL against the configured SQL development standards.
- Approval: DBAs, data owners, or operations teams review the change risk.
- Execution: Approved tasks can be executed immediately or based on the configured schedule.
- Audit trail: The task records SQL content, approval history, execution result, and related backup information.
What SQL tasks provide
NineData SQL tasks provide:
- Built-in SQL review standards for table structure, indexes, naming, and high-risk SQL.
- Scheduled execution for planned or repeated database changes.
- Multi-user submission, approval, and execution.
- Permission checks before users submit or run SQL tasks.
- Approval-process integration for production change control.
- Automatic backup before data changes, with retention for download and recovery within the configured period.
- Rollback SQL records that can be reviewed when a data issue occurs.
Before you begin
Before you use SQL tasks, make sure that:
- The target data source has been added to NineData.
- SQL development standards are configured for the target environment.
- An approval process is configured if the change requires review.
- Users have the required permissions to submit, approve, or execute SQL tasks.
Procedure
1. Disable direct production changes
Turn off SQL Console change capabilities for the production database so users submit production changes through SQL tasks.

After the policy is applied, change statements in SQL Console are intercepted.

2. Submit an SQL task
Create a SQL task for the production change. The task can include the SQL statement, rollback plan, execution settings, and approvers.

The example uses a single approval level. In production environments, configure the number of approval levels based on your organization's risk policy.
3. Approve or reject the task
Approvers review the SQL task and choose whether to approve or reject the change.

Result
The SQL change is checked and approved before execution. The SQL task keeps the change content, review history, execution result, and rollback information in one record.
Related documents
- SQL Review and High-Risk SQL Blocking
- MySQL Online DDL: Non-Locking Schema Change
- Large-Scale Data Change: Online DML Batch Execution
- Database Slow Query Analysis and SQL Performance Troubleshooting
- Database Sensitive Data Governance and Access Control