| Oracle8 Spatial Cartridge Oracle8 Spatial Cartridge User's Guide and Reference Release 8.0.5 A53264-03 |
|
The SDO_ADMIN procedures create and maintain spatial structures in the database, and are used to perform the following tasks:
This chapter contains descriptions of the administrative procedures used for working with either spatially indexed geometric data or partitioned point data. These data structures are mutually exclusive and the procedures only work with the structure for which they are designed.
Table 5-1 lists the administrative procedures for working with spatially indexed geometry-based data. Table 5-2 later in this chapter lists procedures for working with partitioned point data.
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 generate either fixed or variable-sized tiles depending on values stored in the <layername>_SDOLAYER table.
SDO_ADMIN.POPULATE_INDEX (layername)
|
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. |
Consider the following when using this procedure:
Example 5-1 tessellates all the geometric objects in the LAYER1_SDOGEOM table and adds the generated tiles to the LAYER1_SDOINDEX table.
SQL> EXECUTE SDO_ADMIN.POPULATE_INDEX('layer1'); SQL> COMMIT;
This procedure is provided for compatibility with Spatial Cartridge release 8.0.3 tables. This procedure has been replaced by enhanced features in the SDO_ADMIN.POPULATE_INDEX() procedure, and by supporting schema changes as shown in Section 1.4.
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.
SDO_ADMIN.POPULATE_INDEX_FIXED (layername, tile_size, [synch_flag,] [sdo_tile_flag,] [sdo_maxcode_flag])
| Note:
This procedure is likely to be removed in a future release of Spatial Cartridge. |
Consider the following when using this procedure:
SDO_ADMIN.UPDATE_INDEX_FIXED() repeatedly. See Section A.1.1.1, "cr_spatial_index.sql Script" for more information.
Example 5-2 tessellates all the geometric objects in the LAYER1_SDOGEOM table using up to 256 (44) fixed-size tiles and adds the generated tiles to the LAYER1_SDOINDEX table.
SQL> EXECUTE SDO_ADMIN.POPULATE_INDEX_FIXED('layer1',4,FALSE,FALSE,FALSE);
This function determines the size that the SDO_CODE column should be in the <layername>_SDOINDEX table.
SDO_ADMIN.SDO_CODE_SIZE (layername)
|
layername |
Specifies the name of the data set layer. |
This function returns the required size in bytes for the SDO_CODE column.
Data type is INTEGER.
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 columns.
You should always set the SDO_MAXCODE column to one greater than the SDO_CODE column.
None
This procedure 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.
SDO_ADMIN.UPDATE_INDEX (layername, GID)
Considert the following when using this procedure:
Example 5-3 tessellates the polygon for geometry 25 and adds the generated tiles to the LAYER1_SDOINDEX table.
SQL> EXECUTE SDO_ADMIN.UPDATE_INDEX('layer1', 25); SQL> COMMIT;
This procedure is provided for compatibility with Spatial Cartridge release 8.0.3 tables. This procedure has been replaced by enhanced features in the SDO_ADMIN.UPDATE_INDEX() procedure, and by supporting schema changes as shown in Section 1.4.
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.
SDO_ADMIN.UPDATE_INDEX_FIXED (layername, GID, tile_size, [replace_flag,] [sdo_tile_flag] [sdo_maxcode_flag])
| Note:
This procedure is likely to be removed in a future release of Spatial Cartridge. |
Consider the following when using this procedure:
Example 5-4 tessellates the polygon for geometry 25 and adds the generated tiles to the LAYER1_SDOINDEX table.
SQL> EXECUTE SDO_ADMIN.UPDATE_INDEX_FIXED ('layer1',25,4,FALSE,FALSE,FALSE);
This procedure checks for the existence of the geometry and spatial index tables.
SDO_ADMIN.VERIFY_LAYER (layername,[maxtiles])
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 5-5 verifies the LAYER1 data set layer:
SQL> EXECUTE SDO_ADMIN.VERIFY_LAYER('layer1');
None
Table 5-2 lists the procedures that can be used with partitioned point data. These procedures are neither required nor compatible with the geometry-based data format.
Also see Appendix A, "Sample SQL Scripts and Tuning Tips" for additional administrative tools useful for working with partitioned point data.
This procedure alters the high-water mark of a partitioned spatial table. The high-water mark defines how many records can be stored in a partition before it subdivides. The table must exist and be registered in the Spatial Cartridge data dictionary.
This procedure is for use only with partitioned point data.
SDO_ADMIN.ALTER_HIGH_WATER_MARK (tablename, high_water_mark)
|
tablename |
Specifies the name of the partitioned table. |
|
high_water_mark |
Specifies the new high-water mark for the table. |
None
Example 5-6 changes the high-water mark to 5000 records for the TABLE1 partitioned spatial table.
SQL> EXECUTE SDO_ADMIN.ALTER_HIGH_WATER_MARK('table1', 5000);
This procedure removes a partitioned spatial table from the Spatial Cartridge data dictionary. The table must exist and must be registered in the Spatial Cartridge data dictionary.
This procedure is used only with partitioned point data.
SDO_ADMIN.DROP_PARTITION_INFO (tablename)
|
tablename |
Specifies the name of the partitioned table. |
This procedure does not remove the spatial table and its associated partition tables from the user's schema. For a description of how to remove a partitioned spatial table from the user's schema, see the drppart.sql sample SQL script file described in Section A.1.2.2.
Example 5-7 removes the table1 table from the Spatial Cartridge data dictionary.
SQL> EXECUTE SDO_ADMIN.DROP_PARTITION_INFO('table1');
This procedure places data into partition tables based on the sorted order of encoded dimensional values.
This procedure is used only with partitioned point data.
SDO_ADMIN.PARTITION (owner.source_table, tablename, parallel, guess , plummet_flag [,tablespace] )
Consider the following when using this procedure:
Example 5-8 partitions the table1 partitioned spatial table with data contained in the source1 table.
SQL> EXECUTE SDO_ADMIN.PARTITION('source1','table1',1,10,FALSE);
This procedure is used to propagate the grants on the underlying table to the partitions.
This procedure is used only with partitioned point data.
SDO_ADMIN.PROPAGATE_GRANTS (tablename)
|
tablename |
Specifies the name of the partitioned table. |
This procedure is used after calls to SDO_ADMIN.PARTITION() or SDO_ADMIN.REPARTITION(). It must be called by the owner of the partition.
This procedure must be compiled prior to use. See Section A.1.2.3, "sdogrant.sql Script".
Example 5-9 propagates grants from the TABLE1 partitioned spatial table.
SQL> EXECUTE SDO_ADMIN.PROPAGATE_GRANTS('TABLE1');
This procedure creates a partitioned spatial table entry in the Spatial Cartridge data dictionary, and defines the partition key column and the high-water mark for the table.
This procedure is used only with partitioned point data.
SDO_ADMIN.REGISTER_PARTITION_INFO (tablename, column, high_water_mark)
The SQL CREATE TABLE statement is used to create the partitioned spatial table, with the partition key column defined as RAW(255), prior to calling this procedure.
Example 5-10 registers the TABLE1 partitioned spatial table.
SQL> EXECUTE SDO_ADMIN.REGISTER_PARTITION_INFO('table1',
2> 'hhcolumn', 1000);
This procedure reorganizes a partitioned spatial table based on the sorted order of encoded dimensional values already contained in it. The table must exist and must be registered in the Spatial Cartridge data dictionary.
This procedure is used only with partitioned point data.
SDO_ADMIN.REPARTITION (tablename, parallel, [tablespace])
Consider the following when using this procedure:
Example 5-11 repartitions the table1 partitioned spatial table.
SQL> EXECUTE SDO_ADMIN.REPARTITION('table1', 1);
This procedure checks if the partitioned spatial table exists, if it is registered in the Spatial Cartridge data dictionary, and if the partition key column exists as defined in the Spatial Cartridge data dictionary.
This procedure is used only with partitioned point data.
SDO_ADMIN.VERIFY_PARTITIONS (tablename)
|
tablename |
Specifies the name of the table. |
This procedure can generate the following errors depending on the results of the verification:
Example 5-12 verifies the TABLE1 partitioned spatial table:
SQL> EXECUTE SDO_ADMIN.VERIFY_PARTITIONS('table1');