PROBLEM
If there are multiversioned views present in the geodatabase when upgrading, the upgrade fails.
Certain stored procedures need to be upgraded to a different format when upgrading to ArcSDE 9.3. Multiversioned views use some of these stored procedures. Therefore, if the multiversioned views are still present when the upgrade is run, the upgrade fails.
Code:
REM -------------------------------------------------------------
REM Windows mv_view_upgrade_db2 script
REM Change variables to match your implementation before running
REM -------------------------------------------------------------------
echo off
prompt [$T] $P$G
REM --------------------------------------------------------------------
REM Set SDE environment variables
REM --------------------------------------------------------------------
set SDEHOME=C:\arcgis93\arcsde\db2exe
set PATH=%SDEHOME%\bin;%PATH%
set SDESERVER=%COMPUTERNAME%
set SDEINSTANCE=sde93_db282
set SDEDATABASE=sde93
set SDEUSER=sde
set SDEPASSWORD=sde
REM --------------------------------------------------------------------
REM Execute commands
REM --------------------------------------------------------------------
echo on
db2 connect to %SDEDATABASE% user %SDEUSER% using %SDEPASSWORD%
db2 EXPORT TO mv_view_owners.txt OF DEL ^
MODIFIED BY chardel0x09^
SELECT DISTINCT owner ^
FROM table_registry ^
WHERE imv_view_name IS NOT NULL
for /F "tokens=1" %%O in (mv_view_owners.txt) do db2 ^
EXPORT TO mv_view_delete_%%O.bat OF DEL ^
MODIFIED BY chardel0x09^
SELECT 'sdetable -o delete_mv_view -t ' ^
CONCAT table_name ^
CONCAT ' -s %SDESERVER% ' ^
CONCAT ' -i %SDEINSTANCE% ' ^
CONCAT ' -D %SDEDATABASE% ' ^
CONCAT ' -N ' ^
FROM table_registry ^
WHERE imv_view_name IS NOT NULL ^
AND OWNER = UPPER('%%O')
for /F "tokens=1" %%O in (mv_view_owners.txt) do db2 ^
EXPORT TO mv_view_create_%%O.bat OF DEL ^
MODIFIED BY chardel0x09^
SELECT 'sdetable -o create_mv_view -T ' ^
CONCAT imv_view_name ^
CONCAT ' -t ' ^
CONCAT table_name ^
CONCAT ' -s %SDESERVER% ' ^
CONCAT ' -i %SDEINSTANCE% ' ^
CONCAT ' -D %SDEDATABASE% ' ^
FROM table_registry ^
WHERE imv_view_name IS NOT NULL ^
AND OWNER = UPPER('%%O')
prompt
Get help from ArcGIS experts
Download the Esri Support App