POST
|
Yes - if you use the old tnsnames connection syntax. This does not mean that oracle 11g is being used to connect though and you don't have to provide the "sde:oracle11g", just the instance "Dev" in your case. Adding "sde:oracle12c" is incorrect and is expected to fail. The easiest and best solution is to just use the newer syntax of "server/orainstance" (or another valid easy connect syntax detailed in the help: Database connections in ArcMap—Help | ArcGIS Desktop ).
... View more
07-12-2017
10:11 PM
|
0
|
0
|
434
|
POST
|
Hi Michael, will you try connecting using the ez connect syntax, please? Make sure on the server you are connecting to the sqlnet.ora file has EZCONNECT specified within the NAMES.DIRECTORY_PATH parameter, and then use server/servicename in the instance parameter. See this blog post by Melissa Jarman: Easy Connect – Connecting to ArcSDE just got easier! Does this work for you?
... View more
07-12-2017
10:02 PM
|
0
|
0
|
434
|
POST
|
Hi Michael. A few questions: -what error do you receive? -are you trying to connect with ArcGIS desktop or Pro,etc. and what version e.g. 10.2.1 do you have -Is the oracle instant client 12.1.0.1 32-bit or admin client 64-bit etc.?
... View more
07-11-2017
02:44 PM
|
0
|
4
|
567
|
POST
|
I thought this might be worth mentioning. There are several issues customers are encountering with Oracle 11.2.0.3. Here's an technical article that describes some: Technical Article #44687 - Index: Issues related to Oracle 11.2.0.3
... View more
07-30-2015
11:19 AM
|
2
|
0
|
918
|
POST
|
There were a few issues in 11.2 related to datapump that you could be running into. This one looks like a possibility: Technical Article #41252 - Problem: Importing an Oracle 11g R2 Data Pump file containing an ArcSDE 10.x geodatabase encounters Oracle errors ORA-31693, ORA-02354, ORA-00600 There is another mentioned here: Technical Article #44687 - Index: Issues related to Oracle 11.2.0.3
... View more
07-30-2015
10:40 AM
|
0
|
0
|
710
|
BLOG
|
That is great that it works for Windows. It should probably also work for Linux. If I get a chance I'll see if it could be used to optimize the script a bit.
... View more
07-28-2015
04:57 PM
|
1
|
0
|
1069
|
BLOG
|
Hi Blake, I've never used the tempfile module, but from a brief look it seems like it might work as long as you can use the temp file in the arcpy functions. That would definitely make the management of the file even more optimized and easier.
... View more
07-22-2015
02:27 PM
|
0
|
0
|
1069
|
BLOG
|
With ArcGIS, to administer an enterprise geodatabase, you need to utilize the catalog window in ArcGIS or the many geoprocessing tools. They operate through the use of a database connection file (.sde file). The connection file can also be shared and used for scripting. This works great and is easy to manage if you do all your administration through ArcCatalog/ArcMap or the geoprocessing window. However, what if you have many databases to manage, want to use Linux, want to script tasks, or just don't want to have to deal with creating connection files all the time? With the old sde command line this was very easy, no .sde files to manage, just pass in the connection parameters and away you go. Well, here's some good news! You can easily mimic the same behavior using some simple python concepts along with the powerful arcpy geoprocessing scripting environment. The sample code is available here if you want dig in immediately! The example below works on Linux and Windows and uses the concepts detailed in the ArcGIS geoprocessing tools help to create a database connection file and then loads data from a specified directory to the enterprise geodatabase. This can easily be modified to run other tools or to do other tasks. I'll highlight the key pieces of the script. First, the usage. You pass in the connection properties to a database and a location to where the data is you would like to load: Examples:
(Linux)
/tmp>loaddata_sde_params.py --DBMS ORACLE -i myserver/orcl -u user1 -p user1 --dataloc /net/sharedata/location/data
(Windows)
c:\tmp>loaddata_sde_params.py --DBMS ORACLE -i myserver/orcl -u user1 -p user1 --dataloc \\sharedata\location\data
>loaddata_sde_params.py --help
Usage: loaddata_sde_params.py [Options]
Options:
--version show program's version number and exit
-h, --help show this help message and exit
--DBMS=DATABASE_TYPE Type of enterprise DBMS: SQLSERVER, ORACLE, or
POSTGRESQL.
-i INSTANCE DBMS instance name
--auth=ACCOUNT_AUTHENTICATION
Authentication type options (case-sensitive):
DATABASE_AUTH, OPERATING_SYSTEM_AUTH.
Default=DATABASE_AUTH
-u USER user name
-p PASSWORD password
--dataloc=DATALOCATION
Path to the data (either a geodatabase or a directory
with shapefiles
-D DATABASE Database name (Not required for Oracle)
Let's break it down a bit more... The core component is the ability to accept parameters similar to the old command line, parse them correctly, and then automate the creation of the database connection file (It uses some code from the Upgrade Geodatabase (Data Management) help documentation). The parser used is in the python module "optparse". This first defines the program, and then all the options: # Define usage and version
parser = optparse.OptionParser(usage = "usage: %prog [Options]", version="%prog 2.0; valid for 10.1+ only")
#Define help and options
parser.add_option ("--DBMS", dest="Database_type", type="choice", choices=['SQLSERVER', 'ORACLE', 'POSTGRESQL', 'DB2','INFORMIX','DB2ZOS',''], default="", help="Type of enterprise DBMS: SQLSERVER, ORACLE, or POSTGRESQL.")
parser.add_option ("-i", dest="Instance", type="string", default="", help="DBMS instance name")
parser.add_option ("--auth", dest="account_authentication", type ="choice", choices=['DATABASE_AUTH', 'OPERATING_SYSTEM_AUTH'], default='DATABASE_AUTH', help="Authentication type options (case-sensitive): DATABASE_AUTH, OPERATING_SYSTEM_AUTH. Default=DATABASE_AUTH")
parser.add_option ("-u", dest="User", type="string", default="", help="user name")
parser.add_option ("-p", dest="Password", type="string", default="", help="password")
parser.add_option ("--dataloc", dest="DataLocation", type="string", default="", help="Path to the data (either a geodatabase or a directory with shapefiles")
parser.add_option ("-D", dest="Database", type="string", default="none", help="Database name (Not required for Oracle)") Then we need to assign values to local variables from the options that get passed in: #Usage parameters for spatial database connection.
account_authentication = options.account_authentication.upper()
username = options.User.lower()
password = options.Password
dataloc = options.DataLocation
database = options.Database.lower()
database_type = options.Database_type.upper()
instance = options.Instance Next, we need to do some basic checks and find a location to put the .sde connection file. On Windows, the path to files uses backslashes, whereas on Linux, forward slashes are needed. # Local variables
instance_temp = instance.replace("\\","_")
instance_temp = instance_temp.replace("/","_")
instance_temp = instance_temp.replace(":","_")
Conn_File_NameT = instance_temp + "_" + database + "_" + username
if os.environ.get("TEMP") == None:
temp = "c:\\temp"
else:
temp = os.environ.get("TEMP")
if os.environ.get("TMP") == None:
temp = "/usr/tmp"
else:
temp = os.environ.get("TMP")
Connection_File_Name = Conn_File_NameT + ".sde"
Connection_File_Name_full_path = temp + os.sep + Conn_File_NameT + ".sde" Create the connection file: print "\nCreating Database Connection File...\n"
# Process: Create Database Connection File...
# Usage: out_file_location, out_file_name, DBMS_TYPE, instance, database, account_authentication, username, password, save_username_password(must be true)
outFile = arcpy.CreateDatabaseConnection_management(out_folder_path=temp, out_name=Connection_File_Name, database_platform=database_type, instance=instance, database=database, account_authentication=account_authentication, username=username, password=password, save_user_pass="TRUE") Then the connection file can be used to run any other task or set of tasks. Here it loads data using the FeatureClassToGeodatabase tool: # Set environment settings
# Set the workspace to the specified data location
env.workspace = dataloc
# Get all the feature classes in the environment
# list of fc's should be similar to this: ["accident.shp", "veg.shp"]
inFeatures = arcpy.ListFeatureClasses()
# Process: Load Data (Use the "Feature Class To Geodatabase" Tool...)
try:
# Execute FeatureClassToGeodatabase
print "Loading data...\n"
arcpy.FeatureClassToGeodatabase_conversion(inFeatures, outLocation)
except:
for i in range(arcpy.GetMessageCount()):
arcpy.AddReturnMessage(i) Full code is available here. Enjoy!
... View more
07-16-2015
05:16 PM
|
4
|
6
|
4442
|
POST
|
Hi Steve, It sounds like a bug. Here are a few things to try/check: 1- You mention you have the latest 10.2.1 service packs, does this include the ArcGIS 10.2.1 for (Desktop, Engine, Server) Utilities and Telecom Update 1 Patch | Samples and Utilities ? 2- Make sure the st_shapelib.dll (or .so on unix) matches the packages in the database. For example, if you updated the geodatabase to 10.2.1 with service packs, make sure you upgraded/updated packages and also updated st library on the database server to the same release. 3- Does it work if you manually use the st_transform? For example: SELECT SDE.ST_AsText(SDE.ST_Intersects(sde.st_transform(a.shape,4326), b.shape)) FROM table1 a, table2 b; 4- Are you able to send a sql repro case? For example, create two tables, create spatial indexes, insert records, run st_intersects. I can test in-house. You should probably open an incident with tech support too.
... View more
11-06-2014
09:57 AM
|
1
|
1
|
740
|
POST
|
Hi Steve, as Tero suggests, see if it works with the sde user. It could be a privileges issue for the user you are trying to create the procedure with. You should also be able to run describe sde.st_geometry.
... View more
08-28-2014
10:06 AM
|
0
|
0
|
220
|
POST
|
Hi Sandra, This should work. A few things to check: -Are you using an application server connection? Try using a direct connection instead. This might be the problem. -Are there any errors in the sde error log? For direct connections it will be on your arcgis client machine in the %temp% directory (app server in sdehome\etc) -If it still fails and there is nothing helpful in the sde dc error log, I would suggest opening an incident so we can look into it further. Thanks.
... View more
07-31-2014
10:19 AM
|
1
|
0
|
187
|
POST
|
Hi jbatbayar, The script you are running from the install guide takes in many parameters as the output shows. You just need to provide those for it to run - such as the type of DBMS (--DBMS), user name (-u), etc. It is in fact just a wrapper around the GP tool which you can also use.
... View more
06-30-2014
08:28 AM
|
0
|
0
|
404
|
POST
|
This appears to be the following issue under investigation: NIM101461: When feature classes with different SRIDs are used in an ST_intersection query, it fails with the message 'ORA-06530: Reference to uninitialized composite.' The workaround is to use st_transform as rluedey mentiones.
... View more
06-04-2014
05:45 AM
|
0
|
0
|
678
|
POST
|
We specifically use the sde command-line scripting to handle loading data into sde from non-Windows platforms such as Linux systems. All in all this move away from sde command line is not very helpful for those of us that are just trying to automate loading of shapefiles into SDE/geodatabase in a shell scripting environment on a Linux platform. Hi Betsy, What about using python and Engine or Server on Linux? This is from the geprocessing tools help: FeatureClassToGeodatabase example 2 (stand-alone script) The following stand-alone script demonstrates how to use the FeatureClassToGeodatabase function.
# Name: FeatureClassToGeodatabase_Example2.py
# Description: Use FeatureClassToGeodatabase to copy feature classes
# to geodatabase format
# Import system modules
import arcpy
from arcpy import env
# Set environment settings
env.workspace = "C:/data"
# Set local variables
inFeatures = ["climate.shp", "majorrds.shp"]
outLocation = "C:/output/output.gdb"
# Execute TableToGeodatabase
arcpy.FeatureClassToGeodatabase_conversion(inFeatures, outLocation)
To take this a step further here's an example (pseudo code) that uses a folder location to load data to an enterprise geodatabase. Pseudo code:
# Import system modules
import arcpy
from arcpy import env
# Process: Create Database Connection File...
# Usage: out_file_location, out_file_name, DBMS_TYPE, instance, database, account_authentication, username, password, save_username_password(must be true)
arcpy.CreateDatabaseConnection_management("/net/shared/location/connections/",
"zion.sde",
"ORACLE",
"zionserver/ORCL")
# Set environment settings
# Set the workspace to the specified data location
env.workspace = "/net/sharedata/location/data"
outLocation = "Database Connections\zion.sde"
# Get all the feature classes in the environment
# list of fc's should be similar to this: ["accident.shp", "veg.shp"]
inFeatures = arcpy.ListFeatureClasses()
# Process: Load Data (Use the "Feature Class To Geodatabase" Tool...)
try:
# Execute FeatureClassToGeodatabase
print "Loading data...\n"
arcpy.FeatureClassToGeodatabase_conversion(inFeatures, outLocation)
except:
for i in range(arcpy.GetMessageCount()):
arcpy.AddReturnMessage(i)
Finally to take this yet another step further, there is a script available that works on Linux and Windows and uses the above concepts to create a database connection file and then load data from a specified directory to the enterprise geodatabase. It also uses some code from the Upgrade Geodatabase (Data Management) help documentation for parsing the sde connection parameters (similar feel to the sde command line tools). Full script Usage:
Examples:
(Linux)
/tmp>loaddata_sde_params.py --DBMS ORACLE -i myserver/orcl -u user1 -p user1 --dataloc /net/sharedata/location/data
(Windows)
c:\tmp>loaddata_sde_params.py --DBMS ORACLE -i myserver/orcl -u user1 -p user1 --dataloc \\sharedata\location\data
>loaddata_sde_params.py --help
Usage: loaddata_sde_params.py [Options]
Options:
--version show program's version number and exit
-h, --help show this help message and exit
--DBMS=DATABASE_TYPE Type of enterprise DBMS: SQLSERVER, ORACLE, or
POSTGRESQL.
-i INSTANCE DBMS instance name
--auth=ACCOUNT_AUTHENTICATION
Authentication type options (case-sensitive):
DATABASE_AUTH, OPERATING_SYSTEM_AUTH.
Default=DATABASE_AUTH
-u USER user name
-p PASSWORD password
--dataloc=DATALOCATION
Path to the data (either a geodatabase or a directory
with shapefiles
-D DATABASE Database name (Not required for Oracle)
The full working sample script and code is available here Hope this helps.
... View more
04-10-2014
06:29 PM
|
0
|
0
|
780
|
POST
|
Thanks Fojo. In My Oracle Support (MOS), a search for Bug 13693393 beneath Patches & Updates > Number/Name or Bug Number (Simple) with Bug Number selected from the drop down and 13693393 in the search box revealed nothing. Does this mean the bug hasn't been fixed yet or was so recently submitted that it's not appearing the the search? Presuming User Error on my part and will keep looking. [UPDATE: MOS ID 1411854.1 reports the bug in Data Pump has not yet been fixed; and to use suggested workarounds] If you search in the general search for "13693393" the bug info and a document will come up (Doc ID 1411854.1). The document mentions to then go to the Patch search as you did and look for Patch ID or Number : 14026888 Hope this helps.
... View more
04-07-2014
12:18 PM
|
0
|
0
|
370
|
Title | Kudos | Posted |
---|---|---|
1 | 09-05-2013 09:16 AM | |
2 | 03-03-2014 06:38 AM | |
1 | 01-22-2014 09:44 AM | |
2 | 07-30-2015 11:19 AM | |
1 | 07-28-2015 04:57 PM |
Online Status |
Offline
|
Date Last Visited |
07-27-2023
12:46 AM
|