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 hereHope this helps.