ArcSDE Administration Command Reference

sdelayer

This command administers feature classes.

Usage syntax

sdelayer -o add -l <table,column> -e <entity_mask>
          [Spatial_Index] [{-R <SRID> | [Spatial_Ref_Opts]}]
          [-M <minimum_id>] [{-f <init_features,avg_points> | -k <config_keyword>}]
          [-E <{empty | xmin,ymin,xmax,ymax}>] [-t <storage_type>]
          [-L {ON | OFF}] [-C <row_id_column>[,{SDE|USER}[,<min_ID>]]]
          [-P {32 | 64}] [-S <layer_description_str>] [-i <service>]
          [-s <server_name>] [-D <database>] -u <DB_User_name>
          [-p <DB_User_password>] [-q]

sdelayer -o alter -l <table,column> [-e <entity_mask>] [-M <minimum_id>]
          [-S <layer_description_str>]
          [-k <config_keyword>] [-i <service>] [-s <server_name>]
          [-D <database>] [Spatial_Index] [-L <ON | OFF>]
          [-E <{empty | calc | xmin,ymin,xmax,ymax}>]
          [-G {<projection_ID> | file=<proj_file_name}>]
          -u <DB_User_name> [-p <DB_User_password>] [-N] [-q]

sdelayer -o {grant | revoke} -l <table,column> -U <user>
         -A <SELECT,UPDATE,INSERT,DELETE>

         [-i <service] [-s <server_name] [-D <database]
         -u <DB_User_name> [-p <DB_User_password>] [-I] [-q]

sdelayer -o {describe | describe_long} [{-O <owner | -l <table,column>}]
         [-i <service>] [-s <server_name>] [-D <database>]
          -u <DB_User_name> [-p <DB_User_password>] [-q]

sdelayer -o list -l <table,column> -v <shape_id> [-i <service>]
          [-s <server_name>] [-D <database>]
          -u <DB_User_name> [-p <DB_User_password>] [-q]

sdelayer -o delete -l <table,column> [-i <service>]
          [-s <server_name>] [-D <database>]
          -u <DB_User_name> [-p <DB_User_password>] [-N] [-q]

sdelayer -o truncate -l <table,column> [-i <service>]
         [-s <server_name>] [-D <database>]
         -u < DB_User_name> [-p <DB_User_password>] [-N] [-q]

sdelayer -o {stats | si_stats} -l <table,column> [-i <service>]
         [-s <server_name>] [-D <database>]
         -u <DB_User_name> [-p <DB_User_password>] [-q]

sdelayer -o {load_only_io | normal_io} -l <table,column> [-i <service>]
         [-s <server_name>] [-D <database>]
         -u <DB_User_name> [-p <DB_User_password>] [-q]

sdelayer -o register -l <table,column> [-e <entity_mask>]
          {[-C NONE] | [-C <row_id_column>[,{SDE|USER}[,<min_ID>]]]}
          [Spatial_Index] [-S <layer_description_str>] [-q]
          [-k <config_keyword>] [-i <service>] [-s <server_name>]
          -u <DB_User_name> [-p <DB_User_password>] [-D <database>]

Where

         [Spatial_Ref_Opts] := [-x <xoffset,yoffset,xyscale>]
                                       [-z <zoffset,zscale>] [-m <moffset,mscale>]
                                       [-G {<projection_ID> | file=<proj_file_name>}]

        [Spatial_Index] :=  [-g {<grid_sz0>[,<grid_sz1>[,<grid_sz2>]] |
                                 GRID,<grid_sz0>[,<grid_sz2>[,<grid_sz2>]] |
                                 DBTUNE |
                                 NONE |
                                 RTREE |
                                 FIXED,<sdo_level> |
                                 HYBRID,<sdo_level>,<sdo_numtiles>}]

sdelayer -h

sdelayer -?

Operations

add

Adds a spatial column to a business table, creating a feature class.

alter

Modifies some characteristics of a feature class.

grant

Grants access to a feature class to a user.

revoke

Revokes access to a feature class from a user.

describe

Lists feature class definitions (short form). If a feature class is not specified, lists all feature classes the user has access to.

describe_long

Lists feature class definitions (long form). If a feature class is not specified, lists all feature classes the user has access to.

list

Lists the fields of a feature including the point values for all points that define the shape of the feature.

delete

Deletes an entire feature class. All features and the feature class definition are permanently removed. The business table is not deleted.

truncate

Deletes all features in the feature class. The feature class definition remains.

stats

Reports feature class statistics.

si_stats

Reports spatial index statistics.

load_only_io

Sets the I/O mode of the feature class to load-only, allowing only store and replace I/O operations. Use load-only mode when performing large inserts to avoid the continuous update of the feature class' indexes.

normal_io

Sets the I/O mode of the feature class from load-only I/O mode to normal I/O mode.

register

Registers a feature class having a spatial column defined using Oracle Spatial Geometry Type, Informix Spatial DataBlade, or DB2 Spatial Extender.

Options

-A Type of access: SELECT, UPDATE, INSERT, or DELETE

-C specifies the name of the to registered row ID column of the layers business table and the optional minimum row ID value.

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

-e

Entity types allowed (npslaAc3+M).

 

n

Nil

 

p

Point features

 

s

Line (spaghetti) features

 

l

Simple line (line string) features

 

a

Area features

 

A

Annotation

 

c

CAD data

 

3

Three-dimensional features can be added to the entity type mask only with the `-o add' operation

 

+

Multipart features

 

M

Measures on coordinates. The [-m] option is required to store measure values on each coordinate. Measures can be added to the entity type mask only with the "-o add" operation.

Adding a new entity type allows users to store features of the added entity type. (Some applications, such as ArcGIS, do not recognize feature classes that contain a mixture of point, line, and polygon features.) Using sdelayer to remove a previously allowed entity type will permanently delete all features rows of that entity type.

-E

Layer envelope. There are three options:

 

empty

Sets the layer envelope to an empty envelope

 

calc

Calculates the layer envelope

 

xmin,ymin,xmax,ymax

Sets the envelope to the specified values

-f (ArcSDE for Oracle only) Initial number of features and the average number of points per feature.
These are used to calculate the initial and next extent of the layers's F and S tables. You cannot use this option with the -k option.

-g Spatial index type and parameters

<grid1,grid2,grid3> or
GRID,<grid_sz0>[,<grid_sz2>[,<grid_sz3>]]

Create multi-level grid index.
grid2, grid3 are optional.

DBTUNE

Use DBTUNE parameters to index.

NONE

No spatial index is created.

RTREE

Create Rtree index.

FIXED,<sdo_level>

Create fixed Quadtree index.

HYBRID,<sdo_level>,<sdo_numtiles>

Create hybrid Quadtree index.

-G Coordinate system specifier. When used with the "alter" operation, it changes the feature class' metadata, not the data itself. <projection_id>coordinate system ID (see the pedef.h file for the integer codes). file=<proj_file_name>file containing coordinate system description string.

-h Prints usage and options

-i ArcSDE service name

-I Inherit grant privilege. The "grant option" is included with the granted privilege. For example, if user A grants user B update privileges on a table, the -I option indicates that user A also wants to grant user B the ability to grant other users update privileges on a particular table.

-k Configuration keyword present in DBTUNE table. The storage parameters specific to the feature class will be found under the specified keyword. You cannot use this option with the -f option.

-l The business table and its spatial column. If you are not the owner of the table, you must qualify the table name as "owner.table".

-L Controls the layer's autolocking of features by area locks. Set to ON, layer autolocking is enabled; set to OFF, layer autolocking is disabled. When enabled, layer autolocking attempts to lock the area encompassed by a feature's envelope. If the area is not already locked by another session, the area is locked and the feature can be edited (inserted, updated or deleted). If the area is already locked by another session an error is returned. By default, layer autolocking is enabled. Even if a layer's autolocking property is enabled, the following conditions must be true before autolocking will occur.
1. The LAYERAUTOLOCKING server configuration parameter must be set to TRUE.
2. The layer must be in NORMAL_IO mode.
3. The layer's business table must not be multiversioned.

-m Measure offset and scale, separated by a comma

-M Minimum feature ID. New feature IDs are assigned the larger of the minimum ID or the maximum assigned ID + one.

-N No verification is performed; the operation begins immediately after being invoked

-o Operation

-O The owner of the layer

-p ArcSDE user DBMS password

-P Specifies whether the geometry of the feature class is to be stored with 32-bit or 64-bit precision. By default, geometry is stored with 32-bit precision. The precision cannot be altered after the layer is created.

-q Quiet; all titles and warnings are suppressed

-R Spatial reference ID (SRID)

-s ArcSDE server hostname (default: localhost)

-S Map layer description string (up to 63 characters)

-t storage type which if included during the add operation overrides the dbtune GEOMETRY_STORAGE parameter.
 valid values include: B - ESRI binary (Oracle Long Raw and Sql Server)
                               S - Oracle Spatial (Oracle)
                               Q - Spatial data type (DB2 and Informix)
                               W - Well Known Binary
                               L - LOB (Oracle BLOB)
                               N - Normalized (obsolete)

-u ArcSDE user DBMS username

-U ArcSDE user DBMS username the user to grant or revoke layer access to

-v Feature ID

-x The x and y offsets and scale values, separated by commas. The default is 0.0, 0.0, 1.0

-z The z offset and scale values, separated by a comma

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

Discussion

Before creating a new feature class (layer), make sure that there is enough space available on your DBMS.

Calculate the x-,y-, and z-scale values for the feature class (layer) by using the size of the service area and how much resolution is needed for the data. Coordinates are truncated if the scales are too small. For example, if the scale is set to 100 for coordinates in meters, then the unit of resolution is centimeters. To set the unit of resolution to millimeters, increase the scale to 1,000.

Given this feature class specification:

DBMS table name: victoria
DBMS column name: parcels
Feature types: multipart polygons and annotation
Location: victoria
Spatial index grid: Level 1 - 1000 meters
xy offset: 0,0
xy scale: 200
z offset: 0
z scale: 200
precision: 32-bit
autolocking: disabled
Coordinate system: 28355 (GDA1994 zone 55) Geographic extent

The following command will create a feature class (layer):

$ sdelayer -o add -l victoria,parcels -e aA3+ -g 1000,0,0 -x 0,0,200 -z 0,200 -P 32 -L off -G 28355 -u av -p mo -i esri_80

This command uses sdelayer to create a new layer with the above specifications. New empty layer tables are created.

The x,y offsets and scale are optional. If unspecified, they default to 0, 0, 1.

The register operation allows you to create a feature class (layer) from an DBMS table that contains a spatial column defined as a user-defined data type (UDT). To date, ArcSDE supports three different implementations of DBMS spatial data types: Oracle Spatial Geometry Type, Informix Spatial DataBlade, and DB2 Spatial Extender. Tables created with one of these spatial data types and populated using the DBMS SQL interface or some other third party interface can be added to the ArcSDE database by registering the existing tables as ArcSDE feature classes (layers).

$ sdelayer -o register -l victoria,parcels -C parcel_no -u av -p mo -i esri_80

The grant and revoke operations control access to feature classes (layers). The grant operation allows the owner of a feature class (layer) to provide either SELECT, INSERT, UPDATE, or DELETE privileges to other users or roles. The revoke operation allows the owner to rescind previously granted privileges.

The following two commands grant and then revoke select privileges from user "bob".

$ sdelayer -o grant -l victoria,parcels -U bob -A SELECT -u av -p mo -i esri_80

$ sdelayer -o revoke -l victoria,parcels -U bob -A SELECT -u av -p mo -i esri_80

Granting privileges to roles is easier to maintain than repetitively granting the privileges to each user. Whenever possible create roles representing privileges that can be granted to a group of users.

You can list a feature class (layer) definition by using the ArcSDE feature class administration utility. All fields that define a feature class (layer) are displayed on the screen. To list all available feature classes (layer) for the current server, use:

$ sdelayer -o describe -u av -p mo -i esri_80

The system responds with something like this:

ArcSDE 8.1 Build 625 Mon Oct 2 22:33:27 PDT 2000
Layer Administration Utility
-----------------------------------------------------

Table Owner : AV
Table Name : BORDERS
Spatial Column : FID
Layer id : 1
Entities : a
Layer Type : SDE
I/O Mode : NORMAL
User Privileges : SELECT, UPDATE
Layer Configuration : DEFAULTS

-----------------------------------------------------

Table Owner : AV
Table Name : BOUNDARIES
Spatial Column : BOUNDARY
Layer id : 2
Entities : a
Layer Type : SDE
I/O Mode : NORMAL
User Privileges : SELECT, UPDATE, INSERT
Layer Configuration : DEFAULTS

-----------------------------------------------------

Table Owner : AV
Table Name : MINOR_ROADS
Spatial Column : ROAD_LAYER
Layer id : 3
Entities : s
Layer Type : SDE
I/O Mode : NORMAL
User Privileges : SELECT
Layer Configuration : DEFAULTS

-----------------------------------------------------

To display the definition for a particular feature class (layer), specify the table and column name with the -l option.

$ sdelayer -o describe -l borders,fid -u av -p mo -i esri_80

The system responds with something like this:

ArcSDE 8.1 Build 625 Mon Oct 2 22:33:27 PDT 2000
Layer Administration Utility
-----------------------------------------------------

Table Owner : AV
Table Name : BORDERS
Spatial Column : FID
Layer id : 1
Entities : a
Layer Type : SDE
I/O Mode : NORMAL
User Privileges : SELECT, UPDATE
Layer Configuration : DEFAULTS

-----------------------------------------------------

You can list information about a feature's geometry by using its feature ID. Get the feature ID by using sdetable's "list" operation.

Specifying a feature ID returns the feature's fields and coordinates. Some features may have so many points that you can't view all the information as it's displayed. To control the display of the feature information, list the detailed feature information with a pagination program or redirect it to a file for later viewing or printing.

The following example displays a feature's detail and pipes the output through the "more" filter, allowing you to page through the information.

$ sdelayer -o list -l victoria,parcels -v 1012 -u av -p mo -i esri_40 | more

For feature classes (layers) that have been implemented using the binary schema (Oracle and SQL Server only; for more info see the ArcSDE Configuration and Tuning Guide for your DBMS), deleting an ArcSDE feature class (layer) drops the DBMS spatial tables (the F and S tables) and removes the definition of the feature class (layer) from the ArcSDE .data dictionary tables.

Under the spatial types (UDT) and functions implementation, the spatial column is nulled and the feature class (layer) definition is removed from the ArcSDE data dictionary tables. The business table still exists and is registered. To completely remove the business table, use sdetable -o delete.

If a user has the feature class (layer) locked, sdelayer will return an error. You can use the sdemon info operation to make sure the feature class (layer) is not locked. The sdemon kill operation can remove the process that locked the feature class (layer). This is an abrupt solution and should only be used when necessary. If circumstances permit, you should inform everyone that the feature class (layer) is going to be removed and provide application programmers with enough time to remove references to the feature class (layer) from their programs. The sdelayer command is not geodatabase aware. Therefore references to feature classes that participate in feature datasets, networks and topologies will not be removed. Such feature classes should be removed with ArcCatalog.

Use the sdelayer administration utility to delete the feature class (layer).

$ sdelayer -o delete -l victoria,parcels -u av -p mo -i esri_80

The "truncate" operation removes the records from the feature class (layer) but does not drop the tables. However, the records of the business table are not removed. To remove these and the feature class (layer) tables, use sdetable with the "truncate" operation.

$ sdelayer -o truncate -l victoria,parcels -u av -p mo -i esri_80 -N

Using the "alter" operation of sdelayer, you can modify the entity mask, spatial index grid cell sizes, coordinate system ID, description, envelope, or configuration keyword. The example below modifies the entity mask, configuration keyword, coordinate system ID, and description.

$ sdelayer -o alter -l victoria,parcels -e al+ -k vict2 -G 4326 -S "Victoria Parcels" -u av -p mo -i esri_40

This example changes the grid size.

$ sdelayer -o alter -l victoria,parcels -g 2000,0,0 -u av -p mo -i esri_40 -N

The "-N" option suppresses the prompt to verify the change in grid size.

The ArcSDE for Informix product implemented an rtree index as its spatial index. Changing the grid parameters with the "-g" option has no effect on an ArcSDE for Informix feature class (layer) since it does not have a grid index. The rtree index can be created and dropped but not altered.

You can change the grid sizes while the feature class (layer) is in normal or load-only I/O mode.

If the feature class (layer) is in normal I/O mode, the indexes on the spatial index table are dropped. While rebuilding the spatial index table, the feature class (layer) is set to load-only mode. The indexes are rebuilt when the feature class (layer) is reset to normal I/O mode.

If the grid fields are updated while the feature class (layer) is in load-only I/O mode, the spatial index is rebuilt with the new grid sizes when you reset the feature class (layer) to normal I/O mode.

The sdelayer's envelope option has three keywords: "empty", "calc", and "xmin,ymin,xmax,ymax".

Setting it to "empty" will force an ArcSDE client to calculate the feature class's (layer's) envelope on the fly. This can be time-consuming.

When the feature class (layer) is in normal I/O mode, the envelope is automatically updated whenever a feature that extends the current envelope is added. The envelope is not updated while the feature class (layer) is in load-only I/O mode but is recalculated to the full extent when the feature class (layer) is reset to normal I/O mode.

Use "xmin,ymin,xmax,ymax" to set the envelope explicitly (for example, a study area). However, since the envelope is dynamically maintained, it will be extended to include new features that are added outside the extent set by "xmin,ymin,xmax,ymax".

The sdelayer command always creates a feature class (layer) in normal I/O mode. The load-only I/O mode is provided to make the bulk data loading processes more efficient.

To modify the I/O mode, use the "load_only_io" or "normal_io" operations.

$ sdelayer -o load_only_io -l victoria,parcels -u av -p mo -i esri_40

or

$ sdelayer -o normal_io -l victoria,parcels -u av -p mo -i esri_40

When the feature class (layer) administration utility returns a feature class (layer) to normal I/O mode, the spatial index table and database indexes are rebuilt. If the operation does not complete successfully for any reason, the feature class (layer) is left in load-only mode.

When a feature class (layer) is in load-only I/O mode, the unique index is removed from the feature class's (layer's) spatial column. When the index is absent, it's possible to enter nonunique values into the spatial column with a non-ArcSDE application. No applications besides ArcSDE should ever update the spatial column. Database administrators should be aware of the increased vulnerability of the spatial column when the feature class (layer) is in load-only I/O mode.

You can use sdelayer to display statistics about a feature class (layer) including feature entity type counts, total number of features, minimum and maximum feature ID, the date of the last feature modification, the number of points in the largest feature, minimum and maximum linear feature lengths, minimum and maximum polygon areas, and the feature class (layer) envelope. The following command will display statistics for the parcels feature class (layer):

$ sdelayer -o stats -l victoria,parcels -u av -p mo -i esri_40

The sdelayer command's spatial index statistics operation, "si_stats", can help you determine optimum spatial index grid sizes. Optimum grid cell sizes depend on the spatial size of all features, the variation in spatial feature size, and the types of searches to be performed on the feature class (layer).

Below is a sample output generated by "si_stats":

$ sdelayer -o si_stats -l victoria,parcels -u av -p mo -i esri_40

ArcSDE 8.1 Sun Oct 1 22:32:06 PDT 2000
Layer Administration Utility
--------------------------------------------------------
Layer 1 Spatial Index Statistics:
Level 1, Grid Size 200 (Meters)
|------------------------------------------------------------------|
| Grid Records: 978341 |
| Shape Records: 627392 |
| Grids/Shape Ratio: 1.56 |
| Avg. Shapes per Grid: 18.26 |
| Max. Shapes per Grid: 166 |
| % of Shapes Wholly Inside 1 Grid: 59.71 |
|------------------------------------------------------------------|
| Spatial Index Record Count By Group |
|Grids: <=4 4 10 25 50 100 250 500 |
|--------- ------ ------ ------ ------ ------ ------ ------ ------ |
|Features: 627392 0 0 0 0 0 0 0 |
|% Total: 100% 0% 0% 0% 0% 0% 0% 0%|
|------------------------------------------------------------------|
| |
Level 2, Grid Size 1600 (Meters)
|------------------------------------------------------------------|
| Grid Records: 70532 |
| Shape Records: 36434 |
| Grids/Shape Ratio: 1.94 |
| Avg. Shapes per Grid: 18.21 |
| Max. Shapes per Grid: 82 |
| % of Shapes Wholly Inside 1 Grid: 45.35 |
|------------------------------------------------------------------|
| Spatial Index Record Count By Group |
|Grids: <=4 4 10 25 50 100 250 500 |
|--------- ------ ------ ------ ------ ------ ------ ------ ------ |
|Features: 35682 752 87 17 3 0 0 0 |
|% Total: 97% 2% 0% 0% 0% 0% 0% 0%|
|------------------------------------------------------------------|

As the output shows, for each defined spatial index level in the feature class definition, the following values and statistics are printed:

" Grid level and cell size.

" Total spatial index records for the current grid level.

" Total features (shapes) stored for the current grid level.

" Ratio of spatial index records per feature.

" Feature counts and percentages by group that indicate how features are grouped within the spatial index at this grid level. The column headings have the following meaning (where "N" is the number of grid cells):

<=N Number of features and percentage of total features that fall within <= N grid cells

N Number of features and percentage of total features that fall within N grid cells

Notice that the "" groupings include count values from the next group. For instance, the "4" group count represents the number of features that require more than four grid records as well as more than 10, and so on.

" Average number of features per grid.

" Maximum number of features per grid. This is the maximum number of features indexed into a single grid.

" Percentage of features wholly inside one grid. This is the percentage of all features wholly contained by one grid record.

The output sample shows spatial index statistics for a feature class that uses two grid levels: one that specifies a grid size of 200 meters, the other a grid size of 1,600 meters. When a feature requires more than four spatial index records, it is automatically promoted to the next grid level if one is defined. That is, in no case will a feature index generate more than four grid records if more than one grid level exists. If a higher grid level doesn't exist, then a feature can have more than four grid records.

In the example above, 627,392 features are indexed through grid level 1. Because the system automatically promotes features that need more than four spatial index records to the next defined grid level, all 627,392 features for grid level 1 are indexed with four grid records or less. Grid level 2 is the last defined grid level, so features indexed at this level are allowed to be indexed with more than four grid records.

At grid level 2, there are a total of 36,434 features and 70,532 spatial index records: 35,682 features are indexed with four grid records or fewer, 752 features are indexed with more than four grid records, 87 features are indexed with more than 10, 17 features with more than 25, and three features with more than 50 grid records. Percentage values below each column show how the features are dispersed through the eight groups.