Deleting a SDE feature dataset with Python in 10.1 fails

4347
11
06-20-2013 09:54 AM
JoseSanchez
Occasional Contributor III
Hi all

I am working in ArcGIs 10.1.

Deleting with python 10.1 or Model Builder 10.1  a SDE feature dataset that has features classes and topology fails with the following error. 

The feature dataset is in a SDE 9.3 geodatabase.

If I delete the same feature dataset with a python script in 9.3 it works fine.




# Import arcpy module
import arcpy


# Local variables:
MDC_TPDistrict = "Database Connections\\Dsde3 MAIN.SDE\\MAIN.TPDistrict"

# Process: Delete
arcpy.Delete_management(MDC_TPDistrict, "FeatureDataset")



=========================================== TRACE


traceback (most recent call last):
  File "C:\Workspace\Delete.py", line 17, in <module>
    arcpy.Delete_management(MDC_TPDistrict, "FeatureDataset")
  File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\management.py", line 3658, in Delete
    raise e
ExecuteError: DBMS table not found [DBMS table not found [ORA-00942: table or view does not exist
][MDC.T_1190_PolyErrors]] DBMS table not found [DBMS table not found [ORA-00942: table or view does not exist
][MDC.T_1190_LineErrors]] DBMS table not found [DBMS table not found [ORA-00942: table or view does not exist
][MDC.T_1190_PointErrors]] DBMS table not found [DBMS table not found [ORA-00942: table or view does not exist
][MDC.T_1192_PolyErrors]] DBMS table not found [DBMS table not found [ORA-00942: table or view does not exist
][MDC.T_1192_LineErrors]] DBMS table not found [DBMS table not found [ORA-00942: table or view does not exist
][MDC.T_1192_PointErrors]] DBMS table not found [DBMS table not found [ORA-00942: table or view does not exist
][MDC.T_1191_PolyErrors]] DBMS table not found [DBMS table not found [ORA-00942: table or view does not exist
][MDC.T_1191_LineErrors]] DBMS table not found [DBMS table not found [ORA-00942: table or view does not exist
][MDC.T_1191_PointErrors]] 
Failed to execute (Delete).

>>>
0 Kudos
11 Replies
EmadAl-Mousa
Occasional Contributor III
10.1 python modules will not work with 9.3 Geodatabase. Its better to upgrade your geodatabase to at least version 10.
0 Kudos
JoseSanchez
Occasional Contributor III
Hi

I tested this module with a  ArcSDE 9.3 and ArcSDE 10 geodatabases and it fails in both.
0 Kudos
JoseSanchez
Occasional Contributor III
These error messages show when copying from ArcSDE 10.0 to another ArcSDe 10.0 or ArcSDE 93 in arcGIs 10.1.

The script runs fine when working with ArccSDe 9.3 instances only.
0 Kudos
WilliamCraft
MVP Regular Contributor
Since you are trying to delete from a 9.3 GDB, try loading the older module with your Python script rather than using the current version as you're doing now:

import arcgisscripting
gp = arcgisscripting.create(9.3)

Replace your "arcpy" functions with "gp" and see if that helps.
0 Kudos
JoseSanchez
Occasional Contributor III
Hi,

I am copying from  ArcSDE 9.3 to ArcSDE 10.0. But before copying a new feature dataset I delete it, and when I delete it, if it has topology it shows the error message when running the script in ArcGIS 10.1 only.

The script works fine in ArcGIS 10.0 or ArcGIS 9.3.

Thanks
0 Kudos
NathanHeick
Occasional Contributor II
I am getting the same problem in ArcGIS 10.1 SP1 with the same version of ArcSDE.  If I create a topology and delete it using the Delete tool in a model, I get the same error.  The tables are created by the topology and are deleted by the tool, but an error is still raised.


Deleting topology C:\GIS\DatabaseConnections\SDEDEV\arc@SDEDEV.sde\ParcelFabricStaging\pfsCadastralCenterlineTopology...
Failed to delete topology C:\GIS\DatabaseConnections\SDEDEV\arc@SDEDEV.sde\ParcelFabricStaging\pfsCadastralCenterlineTopology.
Traceback (most recent call last):
  File "C:\GIS\ETL\Python\DropTopology.py", line 34, in <module>
    arcpy.management.Delete(topology)
  File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 3658, in Delete
    raise e
ExecuteError: DBMS table not found [DBMS table not found [ORA-00942: table or view does not exist
][ARC.T_1_PolyErrors]] DBMS table not found [DBMS table not found [ORA-00942: table or view does not exist
][ARC.T_1_LineErrors]] DBMS table not found [DBMS table not found [ORA-00942: table or view does not exist
][ARC.T_1_PointErrors]]
Failed to execute (Delete).
0 Kudos
WilliamCraft
MVP Regular Contributor
After re-reading through all of this thread, I'm wondering if the permissions here might be the problem.  For the two posts showing the Oracle error, the message indicates that the tables can't be found.  This is typically the case when the user account accessing the database can't "see" the tables because it does not have SELECT permissions on those tables or isn't assigned to a role that does either.  This leads me to ask the question: which user account is embedded within your SDE connection files when connecting to the Oracle geodatabase via your script?  Is it the SDE user, the schema owner (i.e., MDC or ARC), or some other user account?  If it is not the schema owner that is attempting the delete operation, that could the the problem right there.  Also, while the SDE user account should technically be able to see the tables, I don't think it would have rights to delete objects in another user-schema besides its own (unless the SDE user had a DROP ANY TABLE system privilege).  So, could you check to see if the user account specified in your connection file is the data owner or something else?
0 Kudos
JoseSanchez
Occasional Contributor III
In Pyhon version 10.1 you must check if the layer exits otherwise it gives you an error.

if arcpy.Exists ....

# Check for existence of data before deleting
#
if arcpy.Exists("roadbuffer"):
    arcpy.Delete_management("roadbuffer")
0 Kudos
NathanHeick
Occasional Contributor II
Responding to the last two questions, the account being used to delete the topology is the data owner.  Also, I had already checked to see if the topology existed before deleting it.

Thanks,
Nathan
0 Kudos