POST
|
Have you considered placing all of your SDE Connection Files in a List then Loop through the List. Here's an example that returns the number of Feature Datasets and Standalone Feature Classes in each of the different SDE Connection Files contained within a List :
import arcpy
def main():
try:
sdeConnList = ["Database Connections\\ORCL - SDE@SERVER.sde",
"Database Connections\\ORCL1 - SDE@SERVER1.sde",
"Database Connections\\ORCL2 - SDE@SERVER2.sde",
"Database Connections\\ORCL3 - SDE@SERVER3.sde"]
for sdeConn in sdeConnList:
fcCount = 0
fdCount = 0
wk = arcpy.env.workspace = sdeConn
if arcpy.Exists(wk):
print("\n\n SDE Connection File EXISTS : " + sdeConn)
fdList = arcpy.ListDatasets("*")
for fd in fdList:
fdCount += 1
fcList = arcpy.ListFeatureClasses("*")
for fc in fcList:
fcCount += 1
print(" # of Feature Datasets in this workspace : {0}".format(str(fdCount)))
print(" # of Standalone Feature Classes in this workspace : {0}".format(str(fcCount)))
else:
print("\n\n SDE Connection File DOES NOT EXIST : " + sdeConn)
print("\n\n COMPLETED!! \n\n")
except arcpy.ExecuteError:
print (arcpy.GetMessages(2))
except Exception as e:
print (e[0])
if __name__ == '__main__':
main()
Results :
SDE Connection File DOES NOT EXIST : Database Connections\ORCL - SDE@SERVER.sde
SDE Connection File EXISTS : Database Connections\ORCL1 - SDE@SERVER1.sde
# of Feature Datasets in this workspace : 9
# of Standalone Feature Classes in this workspace : 43
SDE Connection File EXISTS : Database Connections\ORCL2 - SDE@SERVER2.sde
# of Feature Datasets in this workspace : 5
# of Standalone Feature Classes in this workspace : 13
SDE Connection File EXISTS : Database Connections\ORCL3 - SDE@SERVER3.sde
# of Feature Datasets in this workspace : 10
# of Standalone Feature Classes in this workspace : 27
COMPLETED!!
... View more
06-12-2014
08:31 AM
|
1
|
0
|
461
|
POST
|
One possible explanation for this behavior in the TEST instance is if you have a User-Schema Geodatabase and the AA user loaded the Feature Dataset into the User-Schema Geodatabase, but BB and CC users are both connecting to the Master (SDE) Geodatabase, so they wont see the Feature Datasets. And in the PROD instance, the AA user loaded the Feature Dataset into the Master (SDE) Geodatabase, and both the BB & CC are also connected to the same Master (SDE) Geodatabase, so they would see the Feature Datasets. As Vince pointed out, you will see the Feature Datasets appear but their contents are not viewable unless the owner has granted privileges to the user to see them. Here's a link to better explain : Multiple geodatabases in Oracle Another reason for this behavior, is if you were using ArcGIS Desktop 10.2.x, and the box is checked under ArcCatalog > Customize > ArcCatalog Options ... > General Tab > "List only objects owned by the connecting user with enterprise geodatabases" checkbox. Only the objects owned by the connecting user would be displayed, regardless if other users have granted them privileges to see the data. Hope this helps. -Shawn
... View more
06-09-2014
12:46 PM
|
0
|
0
|
371
|
POST
|
I would recommend using Oracle version 11.2.0.4.0 - to avoid Oracle Bug 14026888 when using ST_GEOMETRY and Datapump. http://support.esri.com/en/knowledgebase/techarticles/detail/41252 Hope this helps. -Shawn
... View more
05-23-2014
12:34 PM
|
0
|
0
|
161
|
POST
|
The behavior you are encountering sounds very similar to a known Oracle limitation involving Datapump and ST_GEOMETRY. Here is a Knowledge Base Article describing this issue in more detail : http://support.esri.com/index.cfm?fa=knowledgebase.techArticles.articleShow&d=41252 The solution is to either move to 11.2.0.3.0 and apply the Oracle Patch or move to 11.2.0.4.0. Contact Oracle Support Services for more information regarding this issue. Hope this helps. -Shawn
... View more
04-08-2014
08:53 AM
|
0
|
0
|
370
|
POST
|
When you're listing the Feature Datasets, you're specifying an asterisk (*) - which is getting everything. Try specifying ("*", "Feature") to list just the Feature Classes. dsList = arcpy.ListDatasets("*","Feature") Here's a script I wrote that lists all of the Feature Datasets (and the Feature Classes contained within them, with their geometry type) in an SDE/Oracle instance. Just modify the name of the connection file for the SDE user. Hope this helps. -Shawn import arcpy, gc # Write results to a textfile logfile = open(r'C:\TEMP\List_FCs_in_FDs.log', 'w') def log_results(message): print(message) logfile.write(message) logfile.flush() return def main(): try: EGDB = arcpy.env.workspace = r'Database Connections\ORCL - SDE@SERVER.sde' fdList = arcpy.ListDatasets("*", "Feature") fdCnt = 0 totalFCcnt = 0 if arcpy.Exists(EGDB) == True: for eachFD in sorted(fdList) : fdCnt += 1 log_results("\n {0}. Feature Dataset '{1}'\n".format(str(fdCnt),eachFD)) fcCnt = 0 # Cannot use fdEGDB = EGDB + '/' + eachFD returns Cartesian Product fdEGDB = arcpy.env.workspace = EGDB + '/' + eachFD fcList = arcpy.ListFeatureClasses("*") for eachFC in sorted(fcList): desc = arcpy.Describe(eachFC) log_results(" -> " + eachFC + ' (' + desc.shapeType + ')') fcCnt += 1 totalFCcnt += 1 if fcCnt == 0: log_results("\n Feature Dataset '{0}' does not contain any Feature Classes!!\n".format(eachFD)) else: log_results("\n # of Feature Classes in the '{0}' Feature Dataset : {1}\n".format(eachFD,str(fcCnt))) log_results("\n TOTAL # OF FEATURE DATASETS COUNTED : {0}".format(str(fdCnt))) log_results(" TOTAL # OF FEATURE CLASSES COUNTED : {0}\n".format(str(totalFCcnt))) else: log_results("\n The specified SDE Connection File DOES NOT EXIST\n") return log_results ("\n\n COMPLETED!! \n\n") del fcCnt del fdCnt del fcList del fdList del fdEGDB del eachFD del totalFCcnt gc.collect() except arcpy.ExecuteError: log_results (arcpy.GetMessages(2)) except Exception as e: log_results (e[0]) if __name__ == '__main__': main()
... View more
03-14-2014
11:51 AM
|
1
|
0
|
1370
|
POST
|
You will need to install ArcSDE 10.0 and execute the 'sdesetup -o install ...' command to create a 10.0 Geodatabase in your RDBMS. Since you've already created a Geodatabase using ArcGIS Desktop 10.2, there is no way to downgrade it to 10.0. The only alternative is to delete & recreate the SDE user, before running the command above. Refer to the 10.0 Help for more information on using this command. http://help.arcgis.com/en/arcgisdesktop/10.0/help/ > Search for : sdesetup Hope this helps. -Shawn
... View more
03-14-2014
10:05 AM
|
0
|
0
|
265
|
POST
|
I was getting the same ORA-00911 & ORA-00933 errors as well. But after removing the reference to the SDE Connection File, it worked.
import cx_Oracle
def main():
try:
orcl = cx_Oracle.connect("xxxx/xxxx@XXXXXX/XXXXXX")
curs = orcl.cursor()
vw = ("COUNTRIES_PY_VIEW")
fc = ("COUNTRIES")
createView = (" CREATE OR REPLACE VIEW " + vw + " AS (select * from " + fc + " where country like '%States%' or country = 'Canada')")
print ("\n Create View Syntax ---> " + createView)
curs.execute(createView)
print ("\n Successfully created the View '" + vw + "'.\n")
orcl.close()
print ("\n Completed!! \n")
del orcl
del curs
del createView
del fc
del vw
except arcpy.ExecuteError:
print (arcpy.GetMessages(2))
except Exception as e:
print (e[0])
if __name__ == '__main__':
main()
Results :
Create View Syntax ---> CREATE OR REPLACE VIEW COUNTRIES_PY_VIEW AS (select * from COUNTRIES where country like '%States%' or country = 'Canada')
Successfully created the View 'COUNTRIES_PY_VIEW'.
Completed!!
... View more
02-06-2014
12:17 PM
|
0
|
0
|
362
|
POST
|
It would appear that the GIS.CITY_ALL Feature Class has some kind of association with a view which is causing the migration to fail (ie: Spatial View, Oracle View, Materialized View, Multiversion View, even a user defined Triggers could cause the migration to fail). I've even seen a rare case where a spatial view was created on a feature class then the spatial view was registered with ArcSDE - so it didn't appear as a view anymore - it showed up as an SDE Feature Class. Then when the parent Feature Class was migrated, it failed because it had dependent views associated to it. Log into SQL*Plus as the GIS user, execute the following queries, then examine the results to ensure that the CITY_ALL Feature Class is not partaking in any views. set long 999999 set pages 500 set lines 130 col table_name for a30 -- Metadata for all Views select dbms_metadata.get_ddl('VIEW',vw.view_name) from user_views vw; -- Metadata for all Materialized Views select dbms_metadata.get_ddl('VIEW',mvw.mview_name) from user_mviews mvw; -- Multiversioned Views present select owner,table_name,imv_view_name from sde.table_registry where UPPER(table_name) like '%CITY_ALL%'; -- Metadata for Triggers select dbms_metadata.get_ddl('TRIGGER',tr.trigger_name) from user_triggers tr; -- Metadata for the CITY_ALL Feature Class select dbms_metadata.get_ddl('TABLE','CITY_ALL') from dual; Also check your sdedc_Oracle.log in your %TEMP% directory - to see if any additional information is present which may explain why the migration failed. Hope this helps. -Shawn
... View more
05-02-2013
10:40 AM
|
0
|
0
|
298
|
POST
|
Hi Greg, You need to specify a port number when creating a multiple geodatabase - as outlined in the documentation below. ~~~~~~~~ http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Using_multiple_geodatabases_in_Oracle You create user geodatabases by running the sdesetup command with the install operation. For the instance (the �??i option), you must specify the port number and the schema. For the user name and password, these must be the user name and password of the user who will own the geodatabase. Be aware that even if you are using a direct connection to the master SDE geodatabase, you must provide a valid service number with the �??i option. If no service was created for the master SDE geodatabase, one must be created (though it doesn't have to be started) on Windows. This service must be added to the Windows services file. On UNIX or Linux, the service must be added to the services.sde file and the /etc/service file. NOTE: The user must be given the same privileges you provide for the SDE user while installing or upgrading the SDE geodatabase. ~~~~~~~~ Here's an example : sdesetup -o install -d ORACLE10G -i 5151:imagery -u imagery -p password@zoes -N Hope this helps, -Shawn
... View more
09-09-2010
05:11 PM
|
0
|
0
|
215
|
Title | Kudos | Posted |
---|---|---|
1 | 03-14-2014 11:51 AM | |
1 | 06-12-2014 08:31 AM |
Online Status |
Offline
|
Date Last Visited |
07-13-2021
10:03 AM
|