Workflow: Migrating a registered raster catalog from binary to SQL types

Complexity: Intermediate Data Requirement: Use your own data Goal: Learn how to migrate raster data in Oracle, PostgreSQL, or SQL Server to use ST_Raster storage.

Your existing raster datasets that have been created with the ArcSDE binary type can be converted to the ST_Raster type using the geoprocessing Migrate Storage tool or the sdetable migrate operation.

During migration, a new ST_Raster column is added to the business table, and the raster band metadata stored in the SDE_BND_<N> ArcSDE raster band table is extracted and written in the ST_Raster column. The original integer raster column is then dropped, and the new ST_Raster column is given the original raster column name. The raster band table is also dropped.

In most cases, the conversion from binary to ST_Raster will be fast with a relatively low impact on the system. This will be true for all but two cases: converting raster data stored as Oracle LONG RAW and converting raster data stored in a SQL Server image type column.

For the Oracle case, the LONG RAW BLOCK_DATA column in the ArcSDE raster blocks table (SDE_BLK_<N>) must be converted from LONG RAW to BLOB before the conversion to ST_Raster can be completed. For the SQL Server case, the image BLOCK_DATA column in the ArcSDE raster blocks table (SDE_BLK_<N>) must be converted to a varbinary column.

TipTip:

If you are migrating a versioned table or feature class that contains a raster field, compress the geodatabase before you migrate data. Though not required, if you have few or no unused states in your delta tables, the migration will take less time.

Always make a backup of the geodatabase before you migrate data.

Compressing the geodatabase

The geodatabase administrator can compress the geodatabase using the Compress command in ArcGIS for Desktop. See Compressing an enterprise geodatabase for instructions.

Creating a backup of the database

The database administrator should create a backup of the geodatabase before you migrate any data. That way, if migration fails or you decide you don't want to use the new data, you can go back to the original data.

The migration process is designed to be recoverable. If it fails for any reason, correct the problem that caused the failure and rerun the migration. If for some reason you are unable to complete the migration at that point, you can restore the data from the backup.

Create database backups by using the tools of the database management system (DBMS). See your DBMS documentation for instructions.

Installing the ST_Raster type

Before you can migrate your raster columns to the ST_Raster type, you must configure your geodatabase to store ST_Raster by running the sdesetup command with the install_st_raster operation. See the topic that is appropriate to your installation:

Migrating data

Migrate one raster catalog, raster dataset, mosaic dataset, or table or feature class containing a raster field at a time.

You must be the owner of the dataset to migrate it to a different storage type.

Setting the DBTUNE parameter

You must have the RASTER_STORAGE parameter set to ST_Raster in one of your configuration keywords. That keyword is then specified when you run the Migrate Storage tool or the sdetable command with the migrate operation.

Steps:
  1. Do one of the following to add the RASTER_STORAGE parameter and set it to ST_RASTER:

Now run the Migrate Storage geoprocessing tool or sdetable command to migrate raster catalogs or datasets.

Using the Migrate Storage geoprocessing tool

You can run the Migrate Storage geoprocessing tool on a group of raster catalogs, raster datasets, mosaic datasets, or tables or feature classes containing raster fields. Or you can script the migration in Python to serially migrate a group of files.

Steps:
  1. In ArcCatalog or the Catalog window in ArcMap, search for the Migrate Storage geoprocessing tool, which is in the Data Management toolbox.
  2. Provide the information required by the tool. This includes the path to and name of each raster catalog or dataset and the configuration keyword to use for the migration.

Using the sdetable command with the migrate operation

You can run the sdetable command to migrate raster columns in individual raster catalogs, raster datasets, mosaic datasets, or tables or feature classes containing raster fields, or put multiple sdetable commands into a .bat file. Run the command from the computer on which ArcSDE is installed, preferably from the bin directory in SDEHOME.

Steps:
  1. Open a DOS command prompt (Windows) or shell (UNIX or Linux).
  2. Execute the sdetable command with the migrate operation.

    For example:

    sdetable –o migrate –l watershed,raster –k ST_RASTER 
    –i sde:sqlserver:mainserver\ssdb –s mainserver –D mydb –u bjar –p mine.all.mine
    

    Be sure to specify a configuration keyword that contains the RASTER_STORAGE value to which you want to convert your data.

Related Topics

6/19/2015