Oracle Spatial User's Guide and Reference
Release 8.1.7

Part Number A85337-01

Library

Product

Contents

Index

Go to previous page Go to next page

15
Administrative Functions and Procedures for Relational Model

The SDO_ADMIN procedures create and maintain spatial structures in the database, and they are used to perform the following tasks:

This chapter contains descriptions of the administrative functions and procedures used for working with spatially indexed geometric data. This chapter refers to the relational Spatial model only.

Table 15-1 lists the administrative functions and procedures for working with spatially indexed geometry-based data.

Table 15-1 Administrative Procedures for Spatially Indexed Data  
Procedure or Function  Description 

SDO_ADMIN.POPULATE_INDEX 

Generates a spatial index for the geometry table using either a set number of tiles or a fixed-size tile. 

SDO_ADMIN.POPULATE_INDEX_FIXED 

Generates a spatial index using fixed-size tiles. This is a deprecated procedure. 

SDO_ADMIN.POPULATE_INDEX_FIXED_POINTS 

Generates a spatial index using fixed-size tiles for a layer composed solely of point data. 

SDO_ADMIN.SDO_CODE_SIZE 

Determines the required sizes for SDO_CODE and SDO_MAXCODE. 

SDO_ADMIN.SDO_VERSION 

Returns the release number of the installed version of Spatial. 

SDO_ADMIN.UPDATE_INDEX  

Updates the spatial index based on changes to the geometry table. 

SDO_ADMIN.UPDATE_INDEX_FIXED 

Updates a spatial index with fixed-size tiles. This is a deprecated procedure. 

SDO_ADMIN.VERIFY_LAYER 

Checks for the existence of geometry and spatial index tables.  


SDO_ADMIN.POPULATE_INDEX

Format

SDO_ADMIN.POPULATE_INDEX (layername)

Description

Tessellates a list of geometric objects created by selecting all the entries in the geometry table that do not have corresponding entries in the spatial index table.

This procedure can generate either fixed-size or variable-sized tiles depending on values stored in the <layername>_SDOLAYER table.

Keywords and Parameters

layername 

Specifies the name of the data set layer. The layer name is used to construct the names of the geometry and spatial index tables.
Data type is VARCHAR2. 

Usage Notes

Consider the following when using this procedure:

Example 15-1 tessellates all the geometric objects in the LAYER1_SDOGEOM table and adds the generated tiles to the LAYER1_SDOINDEX table.

Example 15-1 Populate an Index

SQL> EXECUTE SDO_ADMIN.POPULATE_INDEX('layer1');
SQL> COMMIT;

Related Topics


SDO_ADMIN.POPULATE_INDEX_FIXED

Format

SDO_ADMIN.POPULATE_INDEX_FIXED (layername, tile_size, [synch_flag,] [sdo_tile_flag,]
[sdo_maxcode_flag])

Description

Provided for compatibility with Spatial Cartridge release 8.0.3 tables, but it has been replaced by enhanced features in the SDO_ADMIN.POPULATE_INDEX procedure, in order to support schema changes as shown in Section 12.1.

This procedure tessellates a list of geometric objects created by selecting all the entries in the geometry table that do not have corresponding entries in the spatial index table. This procedure can also tessellate all the geometric objects in a geometry table or view and add the tiles to the spatial index table.

Use this procedure to tessellate the geometries into fixed-size tiles.

Keywords and Parameters

layername 

Specifies the name of the data set layer. The layer name is used to construct the name of the geometry and spatial index tables.
Data type is VARCHAR2. 

tile_size 

Specifies the number of tessellations required to achieve the desired tile size (see the Usage Notes).
Data type is INTEGER. 

synch_flag 

Specifies whether to tessellate every geometric object in the geometry table, or only those that do not have corresponding entries in the spatial index table. If TRUE, only those geometric objects in the geometry table that do not have any corresponding tiles in the spatial index table are tessellated. If FALSE, all the geometric objects in the geometry table are tessellated, and new tiles are added to the spatial index table.
Data type is BOOLEAN. Default = TRUE. 

sdo_tile_flag 

For internal use only. Not supported in this release.
Default = FALSE. 

sdo_maxcode_flag 

Specifies whether or not the SDO_MAXCODE column is populated. If TRUE, SDO_MAXCODE is populated. If FALSE, the column is not populated. Set this flag to FALSE for the recommended fixed-size tiling.
Data type is BOOLEAN. Default = TRUE. 

Usage Notes


Note:

This procedure is likely to be removed in a future release of Spatial. 


Consider the following when using this procedure:

Example 15-2 tessellates all the geometric objects in the LAYER1_SDOGEOM table using fixed-size tiles, and adds the generated tiles to the LAYER1_SDOINDEX table.

Example 15-2 Populate an Index with Fixed-Size Tiles

SQL> EXECUTE SDO_ADMIN.POPULATE_INDEX_FIXED('layer1',4,FALSE,FALSE,FALSE);

Related Topics


SDO_ADMIN.POPULATE_INDEX_FIXED_POINTS

Format

SDO_ADMIN.POPULATE_INDEX_FIXED_POINTS (layername, sdo_tile_flag, commit_count)

Description

Builds an index with fixed-size tiles for a geometry layer consisting solely of point data. Because a point is indexed using a single tile, special optimizations are possible.

Keywords and Parameters

layername 

Specifies the name of the data set layer.
Data type is VARCHAR2. 

sdo_tile_flag 

Specifies whether or not to generate the SDO_TILE column.
Data type is BOOLEAN. Default = FALSE. 

commit_count 

Specifies how many points to index before updating and committing the data.
Data type is NUMBER. Default = 50. 

Usage Notes

Consider the following when using this procedure:

Example 15-3 tessellates all the points in the LAYER1_SDOGEOM table and adds the generated tiles to the LAYER1_SDOINDEX table. This example commits after every 100 points.

Example 15-3 Populate an Index with Fixed-Size Tiles Based on Point Data

SQL> EXECUTE SDO_ADMIN.POPULATE_INDEX_FIXED_POINTS('layer1', FALSE, 100 );

Related Topics


SDO_ADMIN.SDO_CODE_SIZE

Format

SDO_ADMIN.SDO_CODE_SIZE (layername)

Description

Determines the size that the SDO_MAXCODE column should be in the <layername>_SDOINDEX table.

Keywords and Parameters

layername 

Specifies the name of the data set layer.
Data type is VARCHAR2. 

Returns

This function returns the required size in bytes for the SDO_MAXCODE column.
Data type is INTEGER.

Usage Notes

The SDO_CODE column is used to store the bit-interleaved cell ID of a tile that covers a geometry. The SDO_MAXCODE column is SDO_CODE padded out one place farther than the longest allowable code name for the index. Both columns are defined as RAW data types, with a maximum of 255 bytes. Use the SDO_ADMIN.
SDO_CODE_SIZE function to fine-tune the size of the column.

Always declare the SDO_CODE column to raw(255).

Related Topics

None.


SDO_ADMIN.SDO_VERSION

Format

SDO_ADMIN.SDO_VERSION

Description

Returns the current installed version of Spatial.

Keywords and Parameters

None.

Returns

This function returns a string describing the version of Spatial installed on the local system.
Data type is VARCHAR2.

Usage Notes

The following version strings can be returned:

8.0.5.0.0
8.1.0.0.0
8.1.3.0.0
8.1.5.0.0
8.1.6.0.0

This information is useful when migrating data between systems, or when upgrading. See Appendix B for more information about migration.

Related Topics

None.


SDO_ADMIN.UPDATE_INDEX

Format

SDO_ADMIN.UPDATE_INDEX (layername, GID)

Description

Tessellates a single geometric object in a geometry table or view and adds the tiles to the spatial index table. If the object already exists and has index entries, those entries are deleted and replaced by the newly generated tiles.

Keywords and Parameters

layername 

Specifies the name of the data set layer. The layer name is used to construct the name of the geometry table.
Data type is VARCHAR2. 

GID 

Specifies the geometric object identifier.
Data type is NUMBER. 

Usage Notes

Consider the following when using this procedure:

Example 15-4 tessellates the polygon for geometry 25 and adds the generated tiles to the LAYER1_SDOINDEX table.

Example 15-4 Update an Index

SQL> EXECUTE SDO_ADMIN.UPDATE_INDEX('layer1', 25);
SQL> COMMIT;

Related Topics


SDO_ADMIN.UPDATE_INDEX_FIXED

Format

SDO_ADMIN.UPDATE_INDEX_FIXED (layername, GID, tile_size, [replace_flag,] [sdo_tile_flag] [sdo_maxcode_flag])

Description

Provided for compatibility with Spatial Cartridge release 8.0.3 tables, but it has been replaced by enhanced features in the SDO_ADMIN.UPDATE_INDEX procedure to support schema changes as shown in Section 12.1.

This procedure tessellates a single geometric object in a geometry table or view and adds the fixed-sized tiles to the spatial index table. By default, these tiles will replace existing ones for the same geometry; or optionally, existing tiles can be left alone.

Keywords and Parameters

layername 

Specifies the name of the data set layer. The layer name is used to construct the name of the geometry table.
Data type is VARCHAR2. 

GID 

Specifies the geometric object identifier.
Data type is NUMBER. 

tile_size 

Specifies the number of tessellations required to achieve the desired fixed-size tiles. Each tessellation subdivides the tiles from the previous level into four smaller tiles.
Data type is INTEGER. 

replace_flag 

Specifies whether or not to delete tiles for the GID before adding new ones. If TRUE, tiles are deleted before new entries are inserted into the spatial index table. If FALSE, new tiles are added to the spatial index table.
Data type is BOOLEAN. Default = TRUE. 

sdo_tile_flag 

For internal use only. Not supported in this release.
Data type is BOOLEAN. Default = FALSE. 

sdo_maxcode_flag 

Specifies whether or not the SDO_MAXCODE column is populated. If TRUE, SDO_MAXCODE is populated. If FALSE, the column is not populated. Set this flag to FALSE for the recommended indexing with fixed-size tiles.
Data type is BOOLEAN. Default = TRUE. 

Usage Notes


Note:

This procedure is likely to be removed in a future release of Spatial. 


Consider the following when using this procedure:

Example 15-5 tessellates the polygon for geometry 25 and adds the generated tiles to the LAYER1_SDOINDEX table.

Example 15-5 Update an Index with Fixed-Size Tiles

SQL> EXECUTE SDO_ADMIN.UPDATE_INDEX_FIXED ('layer1',25,4,FALSE,FALSE,FALSE);

Related Topics


SDO_ADMIN.VERIFY_LAYER

Format

SDO_ADMIN.VERIFY_LAYER (layername,[maxtiles])

Description

Checks for the existence of the geometry and spatial index tables.

Keywords and Parameters

layername 

Specifies the name of the data set layer. The layer name is used to construct the name of the geometry and spatial index tables.
Data type is VARCHAR2. 

maxtiles 

For internal use only. Not supported in this release. 

Usage Notes

If this procedure does not find the geometry and spatial index tables, it generates the following error: SDO 13113 (Oracle table does not exist.)

Example 15-6 verifies the LAYER1 data set layer.

Example 15-6 Verify a Layer

SQL> EXECUTE SDO_ADMIN.VERIFY_LAYER('layer1');

Related Topics

None.


Go to previous page Go to next page
Oracle
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index