AddIndex_Management throws maximum open cursors exceeded

المشرف العام

Administrator
طاقم الإدارة
The following script is run to create indexes across all the feature classes within a particular dataset:

import arcpyimport os.pathdef listFcsInGDB(): for fds in arcpy.ListDatasets("FRED.GS*", "Feature") + ['']: for fc in arcpy.ListFeatureClasses('', '', fds): yield os.path.join(arcpy.env.workspace, fds, fc)def listIndexNamesInFeature(f): return [i.name for i in arcpy.ListIndexes(f)]def listFieldNamesInFeature(f): return [i.name for i in arcpy.ListFields(f)]arcpy.env.workspace = "C:\Users\rmorgan\AppData\Roaming\ESRI\Desktop10.1\ArcCatalog\ds08.sde"idx_stub = "IXGS_"attributes = [ "QASTATUS", "POINTUSAGE", #... several more here ]fc = listFcsInGDB()for f in fc: indexes = listIndexNamesInFeature(f) fieldList = listFieldNamesInFeature(f) for a in attributes: if a not in fieldList: print a + " is not in " + f continue if any(a[:4] in s for s in indexes): print a + " has an index already in " + f continue arcpy.AddIndex_management(f, a, idx_stub + a) print a + " is now indexed in " + fAfter some time of successfully creating around a hundred indexes, the following error is thrown:

Traceback (most recent call last): File "E:\PyScripts\AddIndexes.py", line 57, in arcpy.AddIndex_management(f, a, idx_stub + str(counter) + a) File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\management.py", line 5271, in AddIndex raise eExecuteError: ERROR 999999: Error executing function.Underlying DBMS error [ORA-01000: maximum open cursors exceeded] [FRED.GS_FC1]....Underlying DBMS error [Error executing stored procedure sde.version_util.close_state::ORA-01000: maximum open cursors exceeded] [SDE.DEFAULT][STATE_ID = 2561192]Wrong column type [ORA-01000: maximum open cursors exceeded]Underlying DBMS error [ORA-01000: maximum open cursors exceeded]Underlying DBMS errorUnderlying DBMS errorUnderlying DBMS errorUnderlying DBMS errorUnderlying DBMS errorUnderlying DBMS errorFailed to execute (AddIndex).This is ArcMap 10.1 running on top on Oracle 11g SDE.

Running the Oracle command show parameter open_curs; results in 2000 cursors. Certainly, this script doesn't need 2000 cursors. There are about 35 feature classes and 15 fields needing indexed.



أكثر...
 
أعلى