Skip Headers

Oracle® Spatial User's Guide and Reference
10g Release 1 (10.1)

Part Number B10826-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

17 SDO_MIGRATE Procedure

The SDO_MIGRATE.TO_CURRENT procedure described in this chapter lets you upgrade spatial geometry tables from previous releases of Spatial.

SDO_MIGRATE.TO_CURRENT is the only procedure that you should use for upgrading. Do not use the SDO_MIGRATE.TO_81X, SDO_MIGRATE.FROM_815_TO_81X, or SDO_MIGRATE.TO_734 procedures, which were documented in previous Spatial releases but are no longer supported.


SDO_MIGRATE.TO_CURRENT

Format (Any Object-Relational Model Implementation to Current)

SDO_MIGRATE.TO_CURRENT(

     tabname IN VARCHAR2

     [, column_name IN VARCHAR2]);

or

SDO_MIGRATE.TO_CURRENT(

     tabname IN VARCHAR2,

     column_name IN VARCHAR2

     [, commit_int IN NUMBER]);

Format (Any Relational Model Implementation to Current)

SDO_MIGRATE.TO_CURRENT(

     layer IN VARCHAR2,

     newtabname IN VARCHAR2,

     gidcolumn IN VARCHAR2,

     geocolname IN VARCHAR2,

     layer_gtype IN VARCHAR2,

     updateflag IN VARCHAR2);

Description

Upgrades data from a previous Spatial release to the current release. The format depends on whether you are upgrading from the Spatial relational model (release 8.1.5 or lower) or object-relational model (release 8.1.6 or higher). See the Usage Notes for the model that applies to you.

You should use this procedure for any spatial data upgrade. Do not use the SDO_MIGRATE.TO_81X, SDO_MIGRATE.FROM_815_TO_81X, or SDO_MIGRATE.TO_734 procedures, which were documented in previous Spatial releases but are no longer supported.

Parameters

tabname

Table with geometry objects.

column_name

Column in tabname that contains geometry objects. If column_name is not specified or is specified as null, the column containing geometry objects is upgraded.

commit_int

Number of geometries to upgrade before Spatial performs an internal commit operation. If commit_int is not specified, no internal commit operations are performed during the upgrade.

If you specify a commit_int value, you can use a smaller rollback segment than would otherwise be needed.

layer

Name of the layer to be upgraded.

newtabname

Name of the new table to which you are upgrading the data.

gidcolumn

Name of the column in which to store the GID from the old table.

geocolname

Name of the column in the new table where the geometry objects will be inserted.

layer_gtype

One of the following values: POINT or NOTPOINT (default).

If the layer you are upgrading is composed solely of point data, set this parameter to POINT for optimal performance; otherwise, set this parameter to NOTPOINT. If you set the value to POINT and the layer contains any nonpoint geometries, the upgrade might produce invalid data.

updateflag

One of the following values: UPDATE or INSERT (default).

If you are upgrading the layer into an existing populated attribute table, set this parameter to UPDATE; otherwise, set this parameter to INSERT.

Usage Notes for Object-Relational Model Upgrade

All geometry objects in tabname will be upgraded so that their SDO_GTYPE and SDO_ETYPE values are in the format of the current release:

The procedure also orders geometries so that exterior rings are followed by their interior rings, and saves them in the correct rotation (counterclockwise for exterior rings, and clockwise for interior rings).

Usage Notes for Relational Model Upgrade

Consider the following when using this procedure:

Examples

The following example changes the definitions of geometry objects in the ROADS table from the release 8.1.5 or higher format to the format of the current release.

SQL> execute sdo_migrate.to_current('ROADS');