Is This Content Helpful?
We're glad to know this article was helpful.
How does autoregistration of Oracle Spatial tables work?
ArcSDE can automatically register some tables containing Oracle SDO_GEOMETRY columns that were not created using ArcSDE client software. Once registered, these tables can be accessed through ArcSDE as layers. This process is called autoregistration, or automatic discovery. This article explains the autoregistration process for Oracle tables with SDO_GEOMETRY columns.
What is autoregistration?
Registering a table with ArcSDE involves placing information about the table in a number of the ArcSDE system tables. An entry is placed in SDE.TABLE_REGISTRY, which contains information about all tables registered with ArcSDE. An entry is also made in SDE.LAYERS and SDE.GEOMETRY_COLUMNS, two tables that maintain lists of tables or views containing spatial columns. A new entry is also placed in SDE.SPATIAL_REFERENCES, which describes the spatial reference used by the layer’s spatial column. This process can be done manually with sdelayer -o register, or it can occur automatically.
Autoregistration of third party tables containing Oracle SDO_GEOMETRY columns occurs each time a connection to the ArcSDE server occurs and requests a list of layers on the server. For example, ArcCatalog requests a list of layers when connecting to an ArcSDE server. Users can display a list of layers available on the server using the administration commands 'sdelayer -o describe'. Other operations also request a list of layers.
Selecting tables to autoregister
ArcSDE determines which tables it should autoregister by performing queries on the SDE.LAYERS table and on the view ALL_SDO_GEOM_METADATA. SDE.LAYERS is an ArcSDE system table containing a list of all ArcSDE layers. ALL_SDO_GEOM_METADATA is an Oracle view containing entries for each SDO_GEOMETRY column in tables that you have SELECT access to and that have Oracle Spatial metadata. Entries in ALL_SDO_GEOM_METADATA may represent tables or views.
When a new layer list is requested, ArcSDE queries ALL_SDO_GEOM_METADATA for entries that are not already listed in SDE.LAYERS and that have only one entry in ALL_SDO_GEOM_METADATA, that is, that have only a single SDO_GEOMETRY column. If entries are found matching these criteria, ArcSDE considers them as candidates for autoregistration.
Finding the Registered Row ID Column
The registered row ID column is very important to ArcSDE. Not every table registered with ArcSDE has a row ID column, and some operations require this unique identifier for each row in the table or layer. Without a registered row ID column, operations that perform queries, such a panning, zooming, and identifying features will not work.
The registered row ID numbers must be stored as unique, NOT NULL integers. During autoregistration, ArcSDE attempts to find an existing column in the table to register as the row ID column. If it finds a suitable column, it will register this choice in SDE.TABLE_REGISTRY. Autoregistration searches for a pre-existing row ID column by looking for the first column in the table that is 'NUMBER(38) NOT NULL PRIMARY KEY'. If no such column is found, ArcSDE looks for the first column that is 'NUMBER(38) NOT NULL UNIQUE'.
If no column exists in the table matching either of these cases, the table is autoregistered as a layer but without a registered row ID column. If this happens, the layer is viewable at full extent but ArcSDE cannot perform spatial queries on it. To remedy this situation, alter the autoregistered layer to specify a registered row ID column. Either create a new row ID column, or use an existing non-NULL, unique integer column as the registered row ID column. Use ArcCatalog to register the layer with the geodatabase, or use 'sdetable -o alter_reg' to specify the registered row ID column.
Discovering the feature type
ArcSDE examines the first row in the table to determine what type of features the spatial column contains. Autoregistration assumes that the table contains the same type of features in all the rows of the table. If this is not the case, the entity type mask can be changed after autoregistration using 'sdelayer -o alter –e ...'. The entity type flags used to indicate the feature type are recorded in SDE.LAYERS.
SDO_GTYPE Feature Type Autoregistered as
--------- ------------ -----------------
nnn0 Unknown type (Not registered)
nnn1 Point pc
nnn2 Line sc+
nnn3 Polygon ac+
nnn4 Heterogeneous (Not registered)
nnn5 Multipoint pc+
nnn6 Multiline sc+
nnn7 Multipolygon ac+
If Z (elevation) ordinate is present, "3" is added.
If measure (LRS) ordinate is present, "M" is added.