ArcGIS 創建要素時提示“表已經被注冊(table already registered)”


今天一位實施大哥在ArcCatalog中要重建一個要素類,所以就在ArcCatalog中連接上Oracle數據庫,直接刪除了要素類,然后重新創建了一個新的要素類,可是卻報錯“表已經被創建”,並提示不可以在'sde_table_registry'表中插入重復的鍵值,記得以前碰到過這種狀態,刪除的不徹底,雖然將數據庫中的數據表刪除了,可以在sde用戶下的元數據表中的記錄沒有被清除,導致再次創建時報錯。

 

    既然如此,就到元數據表中將相關的信息刪除掉好了,所以就到sde用戶下刪除了table_registry表中的相關記錄,再次新建要素,這次又報出了一個錯誤,“圖層已存在[Error executing stored procedure <schema>.layer_util.insert_layer::ORA-20019: Layer 4681 already exists.]”,看樣子是還有圖層信息沒有清除干凈,這就頭疼了,雖然提示了存儲過程,但也不知道圖層信息保存在哪張表里面… 而且在下懶鬼也沒有去看存儲過程的具體內容,直接google之

 

   幾番查找之后,找到了sde自帶的取消表注冊的命令:

  • sdetable -o unregister -t tablename

 執行之,再創建要素,果然就好使了,看樣子,手動刪除還是有些不靠譜啊 

  后找到sde文檔查看了一下這個命令的說明,具體如下: 

Remove a table from the ArcSDE table registry

Use unregister to remove a table from the TABLE_REGISTRY table (SDE_table_registry in SQL Server databases).

sdetable -o unregister -t av.world -u av -p mo -i 7654

NOTE: Tables cannot be unregistered if they have been registered as multiversioned, are part of a geodatabase object, or have a spatial column. In all cases, the dependencies must be removed first or you must use the -F option.

To manually remove the dependencies, unregister the table from the geodatabase using ArcCatalog (if it has been registered with the geodatabase) and remove the spatial column (if it has one) using the sdelayer -o delete operation.

Alternatively, you can use the -F option to force the unregistering of the table. However, when you do so, all edits stored in the delta tables are lost. The table will not be unregistered with the geodatabase.

 

來自 <http://help.arcgis.com/en/geodatabase/10.0/admin_cmds/Support_files/datamgmt/sdetable.htm#xunregister

大體就是說使用unregister可以從table_registry(在SQL Server中叫做SDE_table_registry)表中刪除一個表記錄,但是被刪除表如果已經被注冊為多版本,或是一個地理數據庫對象的一部分,或是有一個空間列,則不能被取消注冊,在任何情況下都應該先刪除這些依賴關系才能再取消注冊,或者也可以使用-F選項。大概是這么個意思,不過具體需要怎么取消依賴,畢竟筆者對ArcGIS不熟悉,也不甚了解。 

不過從上面來看,unregister操作應該不僅僅只是刪除了table_registry表中的記錄那么簡單,估計還有一些其他表的依賴需要處理,否則開始直接刪除table_registry表中的記錄也不會仍不能新建同樣的要素類了,看樣子,以后還是不要亂動sde的元數據表比較好,應該盡量選擇使用sde提供的命令行工具。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM