A Installation, Compatibility, and Upgrade

If you are upgrading to Oracle Database 10g, Oracle Spatial is automatically upgraded as part of the operation. For information about the upgrade procedure, see Oracle Database Upgrade Guide.

If you need to downgrade Spatial to the previous Oracle Database release, follow the instructions for downgrading a database back to the previous Oracle Database release in Oracle Database Upgrade Guide.

If you have LRS data in release 8.1.5, 8.1.6, or 8.1.7 format, see Section A.1.

If you use Oracle Spatial GeoRaster, see Section A.2.

A.1 Upgrading LRS Data

If you have linear referencing data (that is, geometries with measure information) in release 8.1.5, 8.1.6, or 8.1.7 format, you must upgrade that data to the format for Spatial releases 9.0.1 and later, as follows:

  1. Drop any spatial indexes on the table with the linear referencing data.

  2. Find out which dimension of the object has the linear referencing information.

    This could be the third or the fourth dimension, depending on the dimensionality of the data. For example, if the data has three dimensions (such as X, Y, and height), the LRS geometry object is 4D, and the LRS dimension in this case is usually 4.

  3. Make sure that the data is in the format for release 8.1.6 or later (that is, it has 4-digit SDO_GTYPE values).

  4. Update the LRS geometry objects by setting the LRS dimension in the SDO_GTYPE field, as in the following examples.

    Example 1: The LRS dimension is 3 for the geometries in the GEOMETRY column of table LRS_DATA. Update the SDO_GTYPE as follows:

    UPDATE LRS_DATA a SET a.geometry.sdo_gtype = a.geometry.sdo_gtype + 300;
    
    

    Example 2: The LRS dimension is 4 for the geometries in the GEOMETRY column of table LRS_DATA. Update the SDO_GTYPE as follows:

    UPDATE LRS_DATA a SET a.geometry.sdo_gtype = a.geometry.sdo_gtype + 400;
    

A.2 Ensuring That GeoRaster Works Properly After an Upgrade

If you are upgrading to Oracle Database 10g and if you use the GeoRaster feature of Oracle Spatial, Oracle XML DB Repository must be installed, and the value of the COMPATIBILITY database initialization parameter must be 10.0 or greater. Before you use GeoRaster in the upgraded instance, ensure that both of these requirements are met, and if necessary reload the GeoRaster PL/SQL packages. Follow these steps:

  1. Check to see if Oracle XML DB Repository is installed by checking if a schema exists in the database for a user named XDB. If the schema for user XDB exists, Oracle XML DB Repository is installed.

  2. If Oracle XML DB Repository is not installed, install it with DBCA or by running the script catqm.sql, which is located in the $ORACLE_HOME/rdbms/admin directory.

    For more information about installing and uninstalling Oracle XML DB Repository, see Oracle XML DB Developer's Guide.

  3. Check the value of the Oracle initialization parameter COMPATIBLE.

  4. If the value of the COMPATIBLE initialization parameter is less than 10.0, change the value to 10.0.

    For more information about the COMPATIBLE initialization parameter, see Oracle Database Reference.

  5. If you did not install Oracle XML DB Repository or change the value of the COMPATIBLE initialization parameter, stop; do not perform the remaining steps.

    If you installed Oracle XML DB Repository or changed the value of the COMPATIBLE initialization parameter, or did both, go to the next step.

  6. Go to the $ORACLE_HOME/md/admin directory.

  7. Connect to the database as SYS AS SYSDBA.

  8. Enter the following SQL statements:

    ALTER SESSION SET CURRENT_SCHEMA=MDSYS;
    @prvtgrs.plb
    @sdogrxml.sql