Personally, I find the need to ensure correct Spatial Metadata for geometry tables in Oracle to be an annoying stumbling block that frequently catches me out when creating new tables that contain spatial data.
But, of course, Spatial Metadata is a necessity for every view and table that contains geometry columns. It defines the coordinate system (SRID), tolerance and bounds for the data and allows Oracle to successfully validate and build Spatial Indexes on the data.
In practice, however, with a large number of spatially enabled tables in an Oracle schema, checking Spatial Metadata for each table - one by one - is a laborious, time-consuming process. So, I set about trying to automate the checking process.
Along the way I found that there are a number of items in a normal Oracle database that one would want to exclude from this check – things like Recycle Bin and Log tables.
What I came up with is the query below.
|
Before running this query, change the list of schemas ('SCHEMA_ONE', 'ANOTHER_SCHEMA' in the query above) to include the schemas you want to check in your database.
The output should be something like:
|
This should make the job of keeping your Oracle spatial database running smoothly a little bit easier.
Comments