Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4091146
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:19:45+00:00 2026-05-20T19:19:45+00:00

In my open-source database migration project Flyway , I have a feature that cleans

  • 0

In my open-source database migration project Flyway, I have a feature that cleans all objects in the current database schema, without dropping the schema itself.

The typical implementation works as follows:

  • List all objects
  • Generate drop statements for these objects

Oracle Spatial Indexes have been causing me a lot of grief though.

How can I reliably enumerate them in order to produce DROP INDEX xyz statements?

Note: This must work on both XE, 10g and 11g. All references in the MDSYS schema must be gone.

My current solution looks like this:

On XE:

  • DELETE FROM mdsys.user_sdo_geom_metadata
  • DELETE FROM mdsys.sdo_index_metadata_table WHERE sdo_index_owner = USER
  • SELECT object_type, object_name FROM user_objects WHERE object_type = ‘TABLE’
  • DROP *table_name* CASCADE CONSTRAINTS PURGE /* for all tables */

On Oracle 10g:

  • DELETE FROM mdsys.user_sdo_geom_metadata
  • SELECT object_type, object_name FROM user_objects WHERE object_type = ‘TABLE’ and object_name not like ‘MDRT_%$’
  • DROP *table_name* CASCADE CONSTRAINTS PURGE /* for all tables */

10g seems to cascade the removal of the metadata in MDSYS.sdo_index_metadata_table and the removal of the spatial index tables (MDRT_1234$ and the like).

XE doesn’t.

Both 10g and XE don’t cascade the removal of the metadata in MDSYS.user_sdo_geom_metadata

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T19:19:46+00:00Added an answer on May 20, 2026 at 7:19 pm

    I solved it by enumerating all SPATIAL indexes using

    select INDEX_NAME from USER_SDO_INDEX_INFO
    

    And using INDEX_NAME to generate DROP statements like

    DROP INDEX my_index
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need open source database that I can ship with my commercial application. It
Is there any open source Object Database available? I would like to have a
I am looking for an open-source project involving c++ GUI(s) working with a database.
I once read about an open source database for postal codes with geolocation data
Does anyone know of a good open source plugin for database querying and exploring
Does anyone know of a drop-in replacement for an access database, ideally open source.
I found this open-source library that I want to use in my Java application.
Open source implementation will be preferred.
What open-source / public domain software is there out there for conversion between Latitude/Longitude,
What open source projects would you recommend as a good place for a starting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.