Select to view content in your preferred language

Database Views and Metadata

6826
15
12-27-2013 11:50 AM
RandyKreuziger
Frequent Contributor
Getting users to create metadata is always hard but they sure complain when it doesn't exist.  With SDE views, created using sdetable -o create_view, metadata could be attached to the views.    Now at version 10.1, creating a database view is very easy through ArcCatalog, but you can't attach metadata to the views as far as I can see.  How are other sites handling this with users expecting metadata?

We are just starting to test ArcSDE 10.1 with SQL 2012.
0 Kudos
15 Replies
WilliamCraft
MVP Regular Contributor
You can perform a variety of metadata operations on views in 10.1 if you utilize the Metadata GP tools under Conversion Tools.  I'm not sure of how you are storing your source metadata, but perhaps something like the Import Metadata tool or the Metadata Importer tool (yes, these are different despite the reversed names) would help you.  These are all found in ArcToolbox which can be launched from ArcCatalog or ArcMap.
0 Kudos
RandyKreuziger
Frequent Contributor
Crafty,
  I've tried both Metadata Importer and Import Metadata.  Each fails with the same message

Exception from HRESULT: 0x80042601
  And when I select the "Description" tab in ArcCatalog for the views it doesn't display any of the Edit, Validate, Export, Import buttons.  Instead it displays
The item's XML contains errors

But you're saying views created using the "Create New View" support metadata?
0 Kudos
WilliamCraft
MVP Regular Contributor
When you say ArcSDE 10.1, are you saying that you geodatabase is at the 10.1 release or that you are running the ArcSDE 10.1 application service or both?  In other words, I just want to verify that your GDB itself has been created at or upgraded to the 10.1 release that matches the desktop client. 

In terms of the first error, I've researched the HRESULT code and it does not appear to be documented online from Esri.  You may need tech support to help troubleshoot this issue.  Have you been able to create, import, and modify metadata for tables and feature classes without issue using the same user account? 

In terms of the second error, I've seen this quite a bit in ArcCatalog when selecting the Description tab.  I don't know if it's necessarily a symptom of or related to the first error you're seeing, though.  I've seen this occur for views (and sometimes for feature classes and tables) if there is no well-formatted XML present for that object class.  Once metadata is able to be added, that error disappears usually. 

To answer your question, I believe the answer I can give you is 'yes' based solely on my opinion.  I was able to import metadata from a table to a view using the Metadata Importer tool without getting the first error.  I also can't find any information online that states that views registered with the geodatabase don't support database so I can only assume they do especially since I don't get the error you are seeing.

I did find some older, Esri-documented rules for metadata for spatial views, which are similar to regular views:

(1) The spatial view must contain an Object Id column; (2) The spatial view must be registered with the geodatabase; (3) Metadata can only exist for items registered with the geodatabase; and (4) Only the owner of a spatial view can edit the metadata for that spatial view. 

I think in your case, I think you probably have 1 - 3 covered already but I am not certain about #4.  Does the user account you're using to connect to SQL Server via ArcCatalog and ArcToolbox have admin rights (or assigned db_owner role, for example) on the database?
0 Kudos
KimPeter
Esri Contributor
ArcGIS metadata is stored in the geodatabase system tables, so you cannot store ArcGIS metadata for objects that are not registered with ArcSDE or the geodatabase.  The views created through ArcGIS Desktop are database views and are not registered with ArcSDE or the geodatabase and, therefore, ArcGIS metadata cannot be stored for them.

We realize this is a limitation that needs to be addressed before the admin commands are retired.  At present, though, the only way to store ArcGIS metadata for a view is to create it with the sdetable command as you described.
0 Kudos
RandyKreuziger
Frequent Contributor

Kim, we recently upgraded to 10.2.2 so we're still able to create SDE views.  You mentioned two years ago that the problem of metadata for views was something that ESRI planned to address before the admin commands were retired.  Has it been addressed at 10.3, or if not, at 10.4?

Thanks

0 Kudos
RandyKreuziger
Frequent Contributor
ArcGIS metadata is stored in the geodatabase system tables, so you cannot store ArcGIS metadata for objects that are not registered with ArcSDE or the geodatabase.  The views created through ArcGIS Desktop are database views and are not registered with ArcSDE or the geodatabase and, therefore, ArcGIS metadata cannot be stored for them.

We realize this is a limitation that needs to be addressed before the admin commands are retired.  At present, though, the only way to store ArcGIS metadata for a view is to create it with the sdetable command as you described.


Thank you kpeter for posting that.  I got the same news from Aleta at ESRI a week ago but forgot to update this thread. 

It was very hard getting users to create metadata but now they expect it which is a good thing.  We've got a couple dozen SDE views that could be SQL views when we migrate to ArcSDE 10.1 later this month.  But, how are sites handling the metadata for SQL Views and Query Layers?
0 Kudos
KimPeter
Esri Contributor
Randy,

Sorry for the delay in responding.

Before you upgrade the geodatabase, please export the existing metadata you have on your views to XML files.  That way, you won't lose the existing metadata information.

Currently, metadata for views would be done by maintaining the metadata information in separate, stand-alone XML files.  You could also look into metadata options in your database...

This is probably not the news you wanted, and I apologize for that.  As mentioned, we are looking into ways to handle this in future.

-Kim
0 Kudos
MiguelParedes
Esri Contributor
Kimberly,

Thank you for your posting.  I have just raised this issue with Esri Support, since I have a user the same issue as reported by  kreuzrsk.  The analyst who dealt with the issue did say that it was possible to have access to the metadata for a spatial view, but only after creating the view using the SDE Command tools to:
1) Creating the view with (sdetable -o create_view), and then
2) registering the view with (sdelayer -o register).

However, it seems the above will work only if the spatial type is SDEBINARY, and not if the spatial type is GEOGRAPHY or GEOMETRY.  Would you be able to confirm if this is the case?  If so, is this Esri would consider as part of whatever solution is implemented to deal with this issue?

Thanks in advance.
Miguel
0 Kudos
TimLangner
Frequent Contributor
Hi there

I started another thread on this, unaware this one existed. The problem exists in 10.2/10.2.1


Can anyone tell me if it is not good practice to have metadata on database views and if so please explain why?

We reported a bug to ESRI UK and this eventually resulted in an American ESRI support analyst logging a feature enhancement for the error message displayed to be more helpful. This isn't the solution we were looking for. Personally I'd rather the problem was fixed. As it is a feature enhancement it isn't possible to search for those online. However the bug number is: NIM098090

The support analyst�??s comments were that it does not make much sense to create meta data for a view when one would have the metadata for the original data source.


If that is the case what is the best practice when you need to publish a subset of data, complete with its own metadata and you�??d rather not duplicate your original database tables, to avoid redundancy in your database.

We are currently in the process of publishing data until our obligations to do use under the EU INSPIRE Directive. However some of our database tables cover multiple INSPIRE Themes so we need to create views of the data. Clearly the metadata has to reflect what we are publishing, rather than what the original database contains. Besides, if we publish a view, how can we publish the metadata if the view doesn't contain any?

Th other thread can be found at:
http://forums.arcgis.com/threads/101034-Bug-NIM098090-when-creating-spaital-views-in-ArcGIS-10.2-usi...
0 Kudos