无痕客

落花无情,流水无痕……

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
ArcSDE Administration Command Reference

sdeexport

This command creates an ArcSDE export file.

 

Usage syntax

 

sdeexport [-o create]  -t <table> [-V <version_name>] [-O] [-q]
      
[-a {all | file=<file_name>}]
       -f <{export_file | -}> [-X <volume_size>]
      [-r <target_ArcSDE_version_number>]
      [-w <"where_clause">] [-i <service>] [-s <server_name>]
      [-D <database>] -u <DB_User_name> [-p <DB_User_password>]

 

sdeexport [-o create]  -l <table,column> [-V <version_name>] [-O] [-q]
      [-a {all | file=<file_name>}]
     -f <{export_file | -}> [-X <volume_size>]
     [-r <target_ArcSDE_version_number>]
     [-w <"where_clause">] [-i <service>] [-s <server_name>]
     [-D <database>] -u <DB_User_name> [-p <DB_User_password>]

 

sdeexport -h

 

sdeexport -?

 

Operations

 

create

Creates export format file

 

Options

 

-a

Attribute modes:

all

Loads all columns into the export file.

file=<file_name>

File containing a list of columns to be exported.

-D

Database or data source name. Not supported by all DBMSs.

-f

Export format filename. Export to standard output if set to "-".

-h

Displays usage and options

-i

ArcSDE service name

-l

The table and either the spatial column or raster column name

-o

Operation

-O

Export in spatial index order (obsolete at version 8.0)

-p

ArcSDE user DBMS password

-q

Quiet; all titles and warnings are suppressed

-r

The export version number

-s

ArcSDE server hostname (default: localhost)

-t

Table to be exported

-u

ArcSDE user DBMS username

-V

Version name. If specified, use only the data that belongs to the version. Version names are case-sensitive. For example SDE.DEFAULT is a different version from SDE.default.

-w

SQL where clause

-X

Maximum file size in Bytes, KiloBytes, MegaBytes or GigaBytes for each export file volume. The upper limit is dependent on the O/S file size.  The minimum volume size that may be specified with the -X option is 4096 bytes or 4K.  When specified, export files are created with the extensions .000 through .999.

-?

Displays usage and options

 

Discussion

 

The sdeexport command creates an export format that can be imported by ArcSDE sdeimport command or examined with the sdexinfo command.

 

If you intend to import the file into an earlier version of ArcSDE, you must use the -r option and specify the version. For example, if you want to export from ArcSDE 9.0 and then import to ArcSDE 8.3, you must specify -r 8.3.

 

The -f option specifies the output file that you want to export to. You can enable file volumes by specifying the -X option. When file volumes are enabled, the extension .000 is appended to the filename specified at the -f option. When this file volume fills to the limit specified by the -X option, a new file with the extension .001 is created and sdeexport continues to export data to this file. Up to 1000 file volumes may be created with extensions from .000 through .999 given that enough space exists. The minimum volume size that may be specified with the -X option is 4096 bytes or 4K (kilobytes). The maximum volume size is determined by the limits imposed by the filesystem where the volume is being created. See your system documentation for the appropriate limits. The file volume sizes are specified in bytes but they may also be specified in either kilobytes, megabytes, or gigabytes by appending a modifiers K, M, or G to the integer value.

 

The -V option specifies the version of the table or layer to be exported. Versions can be created with either the ArcGIS desktop or the sdeversion command. The base table or layer and all edits unique to that version are exported.

 

Examples

 

The following sdeexport command creates file volumes that are no larger than 500 megabytes, named roadex.000, roadex.001, and so on.

 

$ sdeexport -l roads,shape -f roadex -X 500M -u gisuser

 

You may direct sdeexport to export to standard output by specifying the "-" with the -f option..This is useful if you want to pipe standard output to a device such as a tape device. For example, you could pipe standard output to the UNIX dd command which is writing to the tape device.

 

$ sdeexport -l roads,shape -f - -u gisuser | dd of=/dev/rmt/Ocn bs=16k

 

You may export either a business table by specifying the -t option or a feature class or raster catalog (or raster dataset) by specifying the -l option. If the -t option is used to export a business table that contains a spatial column or a raster column, all of the dependent tables are exported as well. In fact, if the -t option is used to export a business table containing a spatial column the resulting export file is equivalent to one created by the -l option specifying the table and spatial column of a feature class. The following examples would create export file that contains the same data, assuming that the roads business table specified by the -t option contains the spatial column shape.

 

$ sdeexport -l roads,shape -f roadex -u gisuser

or

$ sdeexport -t roads -f roadex -u gisuser

 

You may specify only the records of a version be exported by including the -V option. Only the records of the base table and the edits unique to the states of the specified version are included in the sdexport file.

 

$ sdeexport -t roads -f roadex_newpavement -u gisuser -V newpavement

 

转载:http://edndoc.esri.com/arcsde/9.1/admin_cmd_refs/sdeexport.htm

ArcSDE Administration Command Reference

sdeimport

This command imports data from an ArcSDE export file.

 

Usage syntax

 

sdeimport -o append {-l <table,column> | -t <table>} [-V <version_name>]
         -f <{export_file | -}> [-v] [-c <commit_interval>]
         [-i <service>] [-s <server_name>] [-D <database>]
          -u <DB_User_name> [-p <DB_User_password>]

 

sdeimport -o init {-l <table,column> | -t <table>} -f <{export_file | -}> [-v]
         [-c <commit_interval>] [-i <service>]
         [-s <server_name>] [-D <database>]
          -u <DB_User_name> [-p <DB_User_password>]

 

sdeimport -o create {-l <table,column> | -t <table>} [-V <version_name>]
         -f <{export_file | -}> [-v] [-g <grid_size> ]
         [-M <minimum_ID>] [-k <config_keyword>]
         [-c <commit_interval>] [-i <service>]
         [-s <server_name>] [-D <database>]
          -u <DB_User_name> [-p <DB_User_password>]

 

sdeimport -o delete {-l <table,column> | -t <table>} -K <key_columns>
         [-V <version_name>] -f <{export_file | -}> [-q] [-v]
         [-c <commit_interval>] [-i <service>] [-s <server_name>]
         [-D <database>] -u <DB_User_name> [-p <DB_User_password>]

 

sdeimport -o update {-l <table,column> | -t <table>} -K <key_columns>
         [-V <version_name>] -f <{export_file | -}> [-q] [-v]
         [-c <commit_interval>] [-i <service>] [-s <server_name>]
         [-D <database>] -u <DB_User_name> [-p <DB_User_password>]

 

sdeimport -o update_else_insert {-l <table,column> | -t <table>} -K <key_columns>
         
[-V <version_name>] -f <{export_file | -}> [-q] [-v]
         [-c <commit_interval>] [-i <service>] [-s <server_name>]
         [-D <database>] -u <DB_User_name> [-p <DB_User_password>]

 

Where

[Spatial_Index] := [-g {<grid_size1>[,<grid_size2>[,<grid_size3>]] |
                        SPIDX_GRID,<grid_1>[,<grid_2>[,<grid_3>]] |
                        SPIDX_NONE |
                        SPIDX_RTREE |
                        SPIDX_DBTUNE |
                        SPIDX_FIXED,<sdo_level> |
                       SPIDX_HYBRID,<sdo_level>,<sdo_numtiles>}]

 

sdeimport -h

 

Operations

 

update_else_insert

Updates the records of the target table, feature class or raster layer that match the key column values of the export file. The records of the export file whose key values do not match are inserted into the target table, feature class or raster layer.

update

Updates the records in the target table, feature class or raster layer that match the key column values of the export file.

delete

Deletes the records from the target table, feature class or raster layer that match the key column values of the export file.

create

Creates a new table, feature class or raster layer based on the definition stored in the export file and imports records into it. An error is returned if the layer already exists.

init

Deletes all features of an existing table, feature class or raster layer before importing new records.

append

Imports records into an existing table, feature class or raster layer (default).

 

Options

 

-c

Commit rate (defaults to the AUTOCOMMIT value in the giomgr.defs file)

-D

Database or data source name. Not supported by all RDBMSs.

-f

Export format filename. If set to '-', import from standard input.

-g

Spatial index type and parameters
<grid1,grid2,grid3> or SPIDX_GRID,<grid1,grid2,grid3> -- Create multi-level grid index; grid2, grid3 are optional.
SPIDX_DBTUNE -- Use DBTUNE parameters to index.
SPIDX_NONE -- No spatial index is created.
SPIDX_RTREE -- Create Rtree index.
SPIDX_FIXED,<lvl> -- Create fixed Quadtree index.
SPIDX_HYBRID,<lvl,ntiles> -- Create hybrid Quadtree index.

-h

Prints usage and options

-i

ArcSDE service name

-k

DBTUNE configuration keywordused with the "create" operation only

-K

The list of columns used to locate matching records for the delete, update, or update_else_insert operations.

-I

Either the feature class business table and spatial column or raster layers's business table and raster column. If you are not the owner of the table, you must qualify the table name as "owner.table" and have insert privileges.

-I

Minimum feature ID. New feature or raster IDs are assigned the larger of the minimum ID or the maximum assigned ID + one. Default is 1.

-M

Operation

-o

ArcSDE user RDBMS password

-p

ArcSDE user RDBMS password

-s

ArcSDE server hostname (default: localhost)

-t

Business table name

-u

ArcSDE user RDBMS username

-v

Verbose optionreports records committed

-V

Version name. If specified, insert the data into the version. Not allowed for the init operation.Version names are case-sensitive. For example SDE.DEFAULT is a different version from SDE.default.

-?

Prints usage and options (use "-\?" on C shell)

 

Discussion

ArcSDE export files created by the sdeexport command are imported using the sdeimport command. The sdeexport command can create exports of records from a table, feature class, or raster layer. If you are importing data from a later release of ArcSDE, you would have needed to specify a version using the -r option for the export file when you created it. For example, if you want to export data from ArcSDE 9.0 and then import it to an ArcSDE 8.3 geodatabase, you must specify -r 8.3 when you run sdeexport. ArcSDE stores the format version as well as other metadata in the header of the export file.

 

Note: If the 3.0.1 format was specified when the export file was created, only the records of the feature class can be exported.

 

The sdeimport command depends on what kind of records the export file contains to create the appropriate object. If the export file contains feature class records and the -t option is specified to create a table from the export file, ArcSDE will import a feature class. If the -l option is specified, to create a feature class or raster layer from an export file that contains table records, the sdeimport command will return an error.

 

If the -l option is specified with any operation other than create, the spatial reference stored in the export files header must match the spatial reference of either the feature class or the raster layer.

 

The create operation allows you to create a new table, feature class or raster layer. If the object specified by the it option already exists, the sdeimport command returns an error. A configuration keyword can be specified with the -k option, allowing you to control the storage within the DBMS. If the -k option is not specified, the DEFAULTS keyword is used.

 

Examples

 

Example 1: Creating a table from a table description in an export file.

 

In this example the sdeimport command creates the table customer_names in the DBMS from the table description stored in the header of the custname export file. The records of the custname export file are loaded into the customer_names table.

 

$ sdeimport -o create -t customer_names -f custname -k smalltab -u admin -p passwd

 

The init operation allows you to delete the existing records of the target, before inserting the records. If the target does not exist an error is returned. The target business table definition must match the definition of the exported records.

 

Example 2: Replacing records

 

In this example the init operation deletes the records of the montana raster layer and inserts the records of the montana export file.

 

$ sdeimport -o init -l montana,image -f montana -u admin -p passwd

The append operation allows you to add records to an existing target, be it a table, feature class or raster layer. If the target does not exist, sdeimport returns an error.

 

Example 3: Appending records

 

In this example the append operation adds the records of the usa export file to the world feature class.

 

$ sdeimport -o append -l world,shape -f usa -u admin -p passwd

 

The delete operation allows you to remove records from an existing target. The records of the target whose key column values match those of the export file are deleted. The key columns are specified by the -K option. The key columns must exist in both the export file and the target; otherwise an error is returned.

 

Example 4: Selectively deleting records

 

In this example the delete operation removes the records from the usa feature class whose fips column values match those of the california export file.

 

$ sdeimport -o delete -l usa,shape -f california -K fips -u admin -p passwd

 

The update operation allows you to update the records of the target. The target records whose key column values match those of the export file are updated with the records stored in the export file.

 

Example 5: Replacing records

 

In this example the update operation replaces the records of the usa feature class with the records from the export file that match the fips key column value.

 

$ sdeimport -o update -l usa,shape -f nebraska -K fips -u admin -p passwd

 

The update_else_insert operation allows you to either update or insert the records of the target. If the target key columns match the values of the sdeexport file's the records are updated. For those records of the export file for which a match is not found, the records are inserted into the target.

 

Example 6: Selectively replacing records

 

In this example the update_else_insert operation replaces the records of the usa feature class with the records of the texas export file whose fips key column match. Those records of the texas export file that do not match on the fips key column are inserted in the usa feature class.

 

$ sdeimport -o update_else_insert -l usa,shape -f texas -K fips -u admin -p passwd

 

Example 7: Importing output files created with volumes

 

This example shows an import of an export set created in volumes.

 

$ sdeimport -o create -t countries.000 -f countries -u admin -p passwd

 

转载:http://edndoc.esri.com/arcsde/9.1/admin_cmd_refs/sdeimport.htm
posted on 2010-03-19 14:33  无痕客  阅读(844)  评论(0编辑  收藏  举报