set SYSMASTER=%INFORMIXDIR%\etc\sysmaster set OUTFILE=%INFORMIXDIR%\etc\buildsmi_out.%INFORMIXSERVER% set SMIOPDB=C:\TEMP\smiopdb.sql set INFORMIXSTACKSIZE=32 rem Allow opening of each database in it's locale set DBNLS=2 rem Create smi in English set DB_LOCALE=en_us.8859-1 set CLIENT_LOCALE=en_us.8859-1 cd %INFORMIXDIR%\bin call %INFORMIXDIR%\etc\conv\strmaps.bat REM If IDS is killed (when running as a service or a process) when REM the sysmaster database is being built, dbaccess continues to execute REM the remaining statements in the sysmaster.sql file. Since IDS REM is not running, ASF has a time out of 15 seconds for each each REM connection try. This massive time and the large number of statements REM in the sysmaster.sql file, causes dbaccess processes to hang in there. REM Setting DBACCNOIGN environment variable will cause dbaccess to exit when REM the first error occurs. REM # Drop/Create smi in the current server instance. set DBPATH_PREV=%DBPATH% set DBPATH= REM Redirect the output of dropping sysmaster database dbaccess sysmaster - < %INFORMIXDIR%\etc\buildsmi.1in > %OUTFILE%.drop 2>&1 REM Redirect the output of drop database except 111 and 329 errors. REM 111 and 329 errors occur when engine tries to drop the database and REM the database does not exist. findstr /v "111" %OUTFILE%.drop | findstr /v "329" > %OUTFILE% REM Reset DBPATH set DBPATH=%DBPATH_PREV% type %INFORMIXDIR%\etc\buildsmi.2in >> %OUTFILE% REM THIS ENVIRONMENT VARIABLE IS SET HERE BECAUSE, WE WANT TO REM IGNORE THE ERRORS FROM THE ABOVE DBACCESS CALL. set DBACCNOIGN=1 dbaccess - %SYSMASTER% >> %OUTFILE% 2>&1 REM Check to see that there were no errors REM Use findstr instead of find because it is unique for NT. findstr /I "error" %OUTFILE% if errorlevel 1 goto SUCCESS if errorlevel 0 goto FAILURE :SUCCESS dbaccess sysmaster - < %INFORMIXDIR%\etc\buildsmi.3in >> %OUTFILE% 2>&1 REM check dbaccess exit code if errorlevel 0 goto SELECTDB goto exit :SELECTDB dbaccess sysmaster - < %INFORMIXDIR%\etc\buildsmi.4in >> %OUTFILE% 2>&1 dbaccess - %SMIOPDB% > nul 2>&1 del %OUTFILE% del %OUTFILE%.drop del %SMIOPDB% REM Checkpoint between each system database build, so a subsequent REM bounce won't have to roll forward all this work again. onmode -c REM build the OnBAR administrative catalogs call %INFORMIXDIR%\etc\bldutil.bat onmode -c call %INFORMIXDIR%\etc\blduser.bat onmode -c REM build the scheduler administration API and query drill down database REM call %INFORMIXDIR%\etc\bldadmin.bat onmode -c goto exit :FAILURE echo Cleaning up whatever was successfully created >> %OUTFILE% dbaccess sysmaster - < %INFORMIXDIR%\etc\buildsmi.1in >> %OUTFILE% 2>&1 onmode -c :exit