<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to delete or clean Legacy Hive Metastore after successful completion of UC migration in Administration &amp; Architecture</title>
    <link>https://community.databricks.com/t5/administration-architecture/how-to-delete-or-clean-legacy-hive-metastore-after-successful/m-p/111921#M3093</link>
    <description>&lt;P&gt;The ability to do this will be in public preview this quarter, so sometime soon you should be able to disable this.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Mar 2025 16:15:14 GMT</pubDate>
    <dc:creator>Rjdudley</dc:creator>
    <dc:date>2025-03-06T16:15:14Z</dc:date>
    <item>
      <title>How to delete or clean Legacy Hive Metastore after successful completion of UC migration</title>
      <link>https://community.databricks.com/t5/administration-architecture/how-to-delete-or-clean-legacy-hive-metastore-after-successful/m-p/111127#M3050</link>
      <description>&lt;P&gt;Say we have completed the migration of tables from Hive Metastore to UC. All the users, jobs and clusters are switched to UC. There is no more activity on Legacy Hive Metastore.&lt;/P&gt;&lt;P&gt;What is the best recommendation on deleting or cleaning the Hive Metastore which are not being anymore.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2025 12:52:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/how-to-delete-or-clean-legacy-hive-metastore-after-successful/m-p/111127#M3050</guid>
      <dc:creator>bhanu_dp</dc:creator>
      <dc:date>2025-02-25T12:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete or clean Legacy Hive Metastore after successful completion of UC migration</title>
      <link>https://community.databricks.com/t5/administration-architecture/how-to-delete-or-clean-legacy-hive-metastore-after-successful/m-p/111921#M3093</link>
      <description>&lt;P&gt;The ability to do this will be in public preview this quarter, so sometime soon you should be able to disable this.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 16:15:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/how-to-delete-or-clean-legacy-hive-metastore-after-successful/m-p/111921#M3093</guid>
      <dc:creator>Rjdudley</dc:creator>
      <dc:date>2025-03-06T16:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete or clean Legacy Hive Metastore after successful completion of UC migration</title>
      <link>https://community.databricks.com/t5/administration-architecture/how-to-delete-or-clean-legacy-hive-metastore-after-successful/m-p/112097#M3100</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/150716"&gt;@bhanu_dp&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;If I understood correctly, all the tables / objects in your HIVE METASTORE is now migrated to UC Catalog. If you have used UCX for migration, you might not see the process / workflow for removing the HIVE&amp;nbsp;METASTORE from your workspace as of now, and this will be coming soon as part of UCX.&lt;/P&gt;&lt;P&gt;UCX Reference:&amp;nbsp;&lt;A href="https://docs.databricks.com/aws/en/data-governance/unity-catalog/ucx" target="_blank"&gt;https://docs.databricks.com/aws/en/data-governance/unity-catalog/ucx&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;But instead if you want to remove as of now, the below approach must be helpful, where under the &lt;STRONG&gt;hive_metastore -&amp;gt; ucx -&amp;gt; tables&lt;/STRONG&gt; you can see the tables under your hive as shown in image below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nivethan_Venkat_0-1741515710325.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/15304i3BAAC55D196E2B9B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Nivethan_Venkat_0-1741515710325.png" alt="Nivethan_Venkat_0-1741515710325.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;List down the tables under your ucx schema:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Read table list from ucx metadata
table_df = spark.sql("SELECT database, name FROM hive_metastore.ucx.tables")&lt;/LI-CODE&gt;&lt;P&gt;Iterate over the results with the below query to drop them from your hive_metastore.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Iterate over tables and drop them
for row in table_df.collect():
    schema_name = row["database"]
    table_name = row["name"]
    
    drop_query = f"DROP TABLE IF EXISTS hive_metastore.{schema_name}.{table_name}"
    
    try:
        spark.sql(drop_query)
        print(f"Dropped table: {schema_name}.{table_name}")
    except Exception as e:
        print(f"Failed to drop table {schema_name}.{table_name}: {e}")&lt;/LI-CODE&gt;&lt;P&gt;PS: Inorder to leverage this approach your workspace you have UCX installed to capture the metadata details. Follow this link to install UCX in your workspace / all for workspaces in your databricks account:&amp;nbsp;&lt;A href="https://databrickslabs.github.io/ucx/docs/installation/" target="_blank"&gt;https://databrickslabs.github.io/ucx/docs/installation/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Please let us know if you found this helpful / or if more guidance is required.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Nivethan V&lt;/P&gt;</description>
      <pubDate>Sun, 09 Mar 2025 10:34:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/how-to-delete-or-clean-legacy-hive-metastore-after-successful/m-p/112097#M3100</guid>
      <dc:creator>Nivethan_Venkat</dc:creator>
      <dc:date>2025-03-09T10:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete or clean Legacy Hive Metastore after successful completion of UC migration</title>
      <link>https://community.databricks.com/t5/administration-architecture/how-to-delete-or-clean-legacy-hive-metastore-after-successful/m-p/115207#M3236</link>
      <description>&lt;P&gt;Sometime in the last couple of days, this setting was pushed to my account, it looks like what you want:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rjdudley_0-1744313932702.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/15916i8C96747841573EA0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rjdudley_0-1744313932702.png" alt="Rjdudley_0-1744313932702.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;To see if you've been added, go to your Account Console and look under Previews.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2025 19:39:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/how-to-delete-or-clean-legacy-hive-metastore-after-successful/m-p/115207#M3236</guid>
      <dc:creator>Rjdudley</dc:creator>
      <dc:date>2025-04-10T19:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete or clean Legacy Hive Metastore after successful completion of UC migration</title>
      <link>https://community.databricks.com/t5/administration-architecture/how-to-delete-or-clean-legacy-hive-metastore-after-successful/m-p/115447#M3252</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Consider also enabling the&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;Enforce User Isolation&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;setting for the workspace...&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 00:52:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/how-to-delete-or-clean-legacy-hive-metastore-after-successful/m-p/115447#M3252</guid>
      <dc:creator>mnorland</dc:creator>
      <dc:date>2025-04-15T00:52:01Z</dc:date>
    </item>
  </channel>
</rss>

