As your MaxCompute data platform matures, you may accumulate tables and projects that are no longer needed. These obsolete resources not only clutter your workspace but also consume storage, leading to unnecessary costs. Removing these resources is key to cost optimization and operational hygiene. This topic guides you through two distinct cleanup procedures: deleting specific tables while retaining the project, or decommissioning an entire project when it has reached the end of its lifecycle.
Delete a table
Delete tables when you no longer need the data they contain but want to keep the MaxCompute project.
If you retain tables, you will continue to incur storage fees. For more information about billing rules, see or Storage fees (pay-as-you-go).
Run the
DROP TABLEcommand in the MaxCompute client to delete a table from a MaxCompute project.DROP TABLE <table_name>;To verify that the table was deleted, run the following command:
SHOW tables;If the table does not appear in the command output, it was successfully deleted.
You can restore an accidentally deleted table if the Backup and Recovery feature is enabled for the project and the data retention period has not expired. For more information, see Local backup.
Delete a MaxCompute project
If you no longer need a project and all the resources within it, you can delete the project. This action deletes all tables in the project.
If you are unsure whether the project's data is still in use, you can temporarily suspend services that depend on it and monitor for any impact on business operations. If no operations are affected, you can proceed with the deletion. If services are affected, you can restore them. For more information about recovery, see Project management.
You cannot delete a MaxCompute project by running a command in the MaxCompute client. You must delete projects in the MaxCompute console.
Deleting a project has the following consequences:
The project and all its data, including all tables, are immediately and permanently deleted. This action is irreversible.
All tasks submitted to the project will fail because the project no longer exists.
If the MaxCompute project is bound to a DataWorks workspace, deleting the project renders the workspace unusable and unrecoverable. You must unbind the workspace in the DataWorks console before you delete the MaxCompute project.
Grant permissions
An Alibaba Cloud Account or a RAM User with the Super_Administrator role for the project can delete the project in the MaxCompute console.
Other RAM users must be explicitly granted the required permissions:
Log on to the Resource Access Management (RAM) console.
In the navigation pane on the left, choose .
On the Create Policy page, select JSON. Enter the following access policy:
{ "Version": "1", "Statement": [ { "Effect": "Allow", "Action":"odps:DeleteProject", "Resource": "*" } ] }Click OK. In the Create Access Policy dialog box, enter a Policy Name. You can also add a description and attach tags.
For example, you can set the Policy Name to
MaxCompute-DeleteProject.On the Grants page, click Grant Permission.
In the Grant Permission dialog box, select a Principal and a Policy.
For Principal, select the tatget RAM user.
For Policy, select the policy that you created. In this example, the policy is named
MaxCompute-DeleteProject.
Click Grant Permissions.
Delete the project in the MaxCompute console
Log on to the MaxCompute console and select a region in the top-left corner.
On the Projects page, in the Actions column for the target project, click Delete.
In the Delete Project dialog box, select the Are you sure that you want to delete the MaxCompute project? checkbox and click OK to delete the MaxCompute project.
Currently, MaxCompute projects can only be Immediately Delete and Prohibit Project Restoration.
Next steps
For more information about using MaxCompute, see Next steps.