Cleaning up watsonx.data

After the deletion of a Data Gate for watsonx instance, redundant data and metadata is left on watsonx.data. You can remove this data manually.

About this task

Redundant leftover data resides in the target object store and in the Data Gate for watsonx catalog in the Hive meta-store.

Procedure

To clean up the leftover data and metadata on watsonx.data, follow these steps:

  1. Open the watsonx.data user interface on Cloud Pak for Data and open the Presto engine query workspace, which is shown in Figure 1
    Figure 1. The Presto engine query workspace
    The Presto engine query workspace
  2. Select a Presto engine that is connected to a catalog related to your previously deleted Data Gate for watsonx instance.
    Tip: If you are not sure which engine to choose, open the Infrastructure Manager of watsonx.data. The Infrastructure Manager lists all configured Presto engines, catalogs, and buckets. It also shows how these objects are interconnected.
  3. Identify the schema and tables that you want to remove:
    • To list all schemas in a catalog, replace catalogname with the actual catalog name. Then run the following SQL command from the Presto engine query workspace:
      SHOW SCHEMAS FROM catalogname;
    • To list all tables in a schema, you can use the following command in a similar way:
      SHOW TABLES FROM catalogname.schemaname;
  4. Remove the tables from a schema. To this end, run the following SQL command from the Presto engine query workspace. Replace catalogname, schemaname and tablename with the actual values:
    drop table catalogname.schemaname.tablename
  5. Click the Run on presto button on the upper right.
  6. Drop the schema itself. To this end, replace catalogname and schemaname with the actual names in the following SQL command. Then run the command.
    drop schema catalogname.schemaname
  7. Click the Run on presto-xx button on the upper right, where presto-xx is the name of the actual Presto engine.
  8. Repeat steps 4 through 7 for all tables and schemas in the catalog.