123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- @echo off
- REM Allow opening of each database in it's locale
- set DBNLS=2
- REM Access system databases in English
- set DB_LOCALE=en_us.8859-1
- set CLIENT_LOCALE=en_us.8859-1
- set OUTFILE=%INFORMIXDIR%\etc\buildsmi.out
- set SYSEXTSPSQLFILE=%INFORMIXDIR%\etc\tempsysextsp.sql
- set SYSEXTSPOUTFILE=%INFORMIXDIR%\etc\tempsysextsp.out
- set SYSAUDITSQLFILE=%INFORMIXDIR%\etc\tempsysaudit.sql
- set SYSAUDITOUTFILE=%INFORMIXDIR%\etc\tempsysaudit.out
- cd %INFORMIXDIR%\etc
- if errorlevel 1 goto BADDIR
- %INFORMIXDIR%\bin\dbaccess sysmaster - < %INFORMIXDIR%\etc\smi_unld.in1 > %OUTFILE% 2>&1
- del /F %SYSAUDITOUTFILE%
- echo select ncols from systables where tabname = 'sysaudit';> %SYSAUDITSQLFILE% 2>&1
- dbaccess -e sysmaster - < %SYSAUDITSQLFILE% > %SYSAUDITOUTFILE% 2>&1
- del /F %SYSAUDITSQLFILE%
- del /F %INFORMIXDIR%\etc\sysextspaces.unl
- echo unload to '%INFORMIXDIR%\etc\sysextspaces.unl' select * from sysextspaces;> %SYSEXTSPSQLFILE%
- dbaccess -e sysmaster - < %SYSEXTSPSQLFILE% > %SYSEXTSPOUTFILE% 2>&1
- del /F %SYSEXTSPSQLFILE%
- findstr /I "206" %SYSEXTSPOUTFILE%
- if errorlevel 0 goto UNLSYSEXTSPSUCC
- findstr /I "error" %SYSEXTSPOUTFILE%
- if errorlevel 1 goto UNLSYSEXTSPSUCC
- echo The unload of sysmaster failed.
- echo Check the contents of %SYSEXTSPOUTFILE% for more information.
- findstr /I "error" %OUTFILE%
- if errorlevel 0 goto UNLFAILURE
- goto DONE
- :BADDIR
- echo error: Could not chdir to %INFORMIXDIR%\etc
- goto DONE
- :UNLSYSEXTSPSUCC
- del /F %SYSEXTSPOUTFILE%
- findstr /I "error" %OUTFILE%
- if errorlevel 1 goto UNLSUCC
- goto UNLFAILURE
- :UNLFAILURE
- echo The unload of sysmaster failed.
- echo Check the contents of %OUTFILE% for more information.
- goto DONE
- :UNLSUCC
- echo Unload files reside in %INFORMIXDIR%\etc. >> %OUTFILE%
- echo As user 'informix', run ... >> %OUTFILE%
- echo %INFORMIXDIR%\etc\smi_load.bat >> %OUTFILE%
- echo ... to reload the 'sysmaster' database. >> %OUTFILE%
- :DONE
|