Oracle DBA Tips




ArcSDE Administration Commands - sdetable

The sdetable command administers business tables and the data stored in them, as well as their indexes and views.

1. add_uuid_column operation: Adds a universal unique ID column to the table.

$ sdetable -o add_uuid_column -t victoria -c parceluuid -u av -p mo

2. alter_column operation: Alters the definition of a column.

You can change the NULL constraint or the data type if the DBMS allows it. The data types are limited to INT16, INT32, FLOAT32, and FLOAT64.

You cannot alter the definition of a column that has been registered as maintained by ArcSDE.

The following example alters a column, nest_size, to allow null values and changes the data type to FLOAT64.

$ sdetable -o alter_column -t birds -c nest_size -x ALLOW_NULLS –z float64 -u av -p mo -N -q

3. alter_reg operation: Modifies a registration entry such as converting the table from single to multiversioned, single to hybrid, changing the row_id to be maintained by ArcSDE rather than by the user, or enabling/disabling archiving.

Note: You cannot alter the registration of the row_id column on a view

You can alter the registration of a table from and to one of three options for editing: single, multiversioned, or hybrid. If registered as multiversioned, you can enable or disable archiving.

In the example below, the registration of the table victoria is being changed to multiversioned (-V) and enabled for archiving (-y).

c:\> sdetable -o alter_reg -t victoria -c objectid -C sde -V multi -y h_victoria,h_rowID,h_from,h_to -u av -p mo -N

You can also alter the registration of a table to change how the row_id column is maintained. In the following example, the row_id column (object_id) is altered to be user-maintained.

c:\> sdetable -o alter_reg -t birds -c object_id -C user -u av

4. create operation: Creates a new table.

$ sdetable -o create -t victoria -d "name string(20), tot_pop integer(9)" -k vict -u av -p mo -s ultra -i esri_80

5. create_mv_view operation: Creates a multiversioned view.

c:\> sdetable -o create_mv_view -T world_imv_view -t world -u av –p morti26

6. create_index operation: Creates an index on a table.

$ sdetable -o create_index -t victoria -c parcel_no -n index1 -u av
-p morti26 -i esri_40

-- creates an aggregate index on the parcel_no and zone_no columns
$ sdetable -o create_index -t victoria -c parcel_no,zone_no -n
index2 -u av -p morti26

7. create_view operation: Creates a DBMS view.

$ sdetable -o create_view -T view_victoria -t victoria -c
victoria.parcel_no,province.address -w "province=10 and
victoria.zone_no = province.zone_no" -u av -p morti26

sdetable –o create_view registers the view with ArcSDE. This means that ArcSDE places an entry for the view in the ArcSDE system table TABLE_REGISTRY SDE_table_registry in SQL Server databases) and an entry for each of the view's columns in COLUMN_REGISTRY (SDE_column_registry in SQL Server databases). You could also create a view using SQL, then register it with ArcSDE using the sdetable -o register command.

You can also create spatial views. That means you include the spatial column (for example, the SHAPE column) in the view. These views can only reference one table that contains a spatial column. If you want to include attribute information from another table containing a spatial column in your spatial view, you must first create a nonspatial view of that second table. You can then create your spatial view using one table with a spatial column and attribute information from the nonspatial view. Spatial views should only be created on nonversioned tables.

8. delete operation: Deletes a table; can be used to completely delete a layer (including business table) and a view.

c:\> sdetable -o delete -t victoria -u av -p morti26 -s ultra -i esri_40

9. delete_mv_view operation: Deletes a multiversioned view.

$ sdetable -o delete_mv_view -t world -u av -p morti26

10. delete_index operation: Deletes an index on a table.

$ sdetable -o delete_index -n index1 -u har -p sugar

11. describe operation: Displays a table definition.

$ sdetable -o describe -t victoria -u av -p morti26 -i esri_40

12. describe_long operation: Displays the table definition in detail.

$ sdetable -o describe_long -t victoria -u sasha -p polarbear -i esri_40

13. describe_reg operation: Displays table registration entries.

c:\> sdetable –o describe_reg –t dbo.landmarks
Attribute Administration Utility
Table Database : SDE
Table Owner : DBO
Table Name : LANDMARKS
Registration Id : 47
Row ID Column : OID
Row ID Column Type : SDE Maintained
Row ID Allocation : Many
Row Lock : Not Enable
Minimum Row ID : 1
Dependent Objects : None
Dependent Object Names : 147
Registration Date : 01/24/06 09:41:00
Config. Keyword : DEFAULTS
Visibility : Visible

14. grant operation: Grants access to a table for a user.

c:\> sdetable -o grant -t sde.RJP.hydrants -U hp -A
Enter Database User password:
ArcSDE 9.2 for SQL Server Build 723 Wed Aug 3 16:02:07 2005
Attribute Administration Utility
Permissions successfully granted on table sde.RJP.hydrants

15. list operation: Lists column data for a given field value

c:\> sdetable -o list -t -c ACCTYPE -v 11 -u cat -p zoom
ArcSDE 9.2 for SQL Server Build 723 Wed Aug 3 16:02:07 2005
Attribute Administration Utility
MILE: 120
MILE: 1432

16. load_only_io operation: Puts table in load-only I/O mode, which drops the spatial index and makes the table unavailable to ArcSDE clients. Used primarily to improve performance when bulk loading data.

17. normal_io operationL: Puts table in normal I/O mode. This recreates the indexes and makes the table available to ArcSDE clients.

c:\> sdetable -o normal_io -t sde.RJP.hydrants -u RJP -p windowpane
ArcSDE 9.2 for SQL Server Build 723 Wed Aug 3 16:02:07 2005
Attribute Administration Utility
Successfully changed mode for sde.RJP.hydrants

18. populate_uuid_column operation: Populates the universal unique ID column.

$ sdetable -o populate_uuid_column -t victoria -c parceluuid -u
rocket -p bubby

19. rebuild_index operation: Rebuilds the indexes of the specified objects.

$ sdetable -o rebuild_index -t landmarks -u squeaky

$ sdetable -o rebuild_index -t vegetation -x RASTER -u vijay

20. register operation: Registers a table in the ArcSDE table registry (TABLE_REGISTRY or SDE_table_registry). Is also used to register a table as versioned and enable it for archiving.

$ sdetable -o register -t world -c ID -C SDE -u dart -p wolfy

21. rename operation: Renames a table. Do not use sdetable –o rename to rename a business table you created in ArcGIS Desktop.

c:\> sdetable -o rename -t world -T world2000 -u dart -p wolfy

22. revoke operation: Removes access to a table for a user.

$ sdetable -o revoke -t victoria -U doc -A UPDATE -u av

23. truncate operatin: Deletes all records from a table.

$ sdetable -o truncate -t victoria -u av -p mo -s ultra -i esri_40

24. unregister operation: Removes a table from the ArcSDE table registry. To unregister a table, it cannot have been registered as versioned, registered with the geodatabase, nor contain a spatial column.

$ sdetable -o unregister -t world -u av -p mo

25. update_dbms_stats operation: Updates RDBMS table and/or index statistics.

$ sdetable -o update_dbms_stats -t dist_centers -n ALL

Last updated on November 26, 2010