123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- REM ###
- REM #inherit the message constants
- REM ###
- call %INFORMIXDIR%\etc\conv\strmaps.bat
- REM ###
- REM # setup the WINROOT path
- REM ###
- set WINROOT=%SystemRoot%
- if "x%WINROOT%" == "x" set WINROOT=C:\WINDOWS
- REM ###
- REM # remove emergency boot file since it's data is now obsolete
- REM ###
- copyboot
- REM ###
- REM # where to put output
- REM ###
- set OUTFILE=%INFORMIXDIR%\etc\bldadmin_out.%INFORMIXSERVER%
- set BLDADMIN_STATFILE=%INFORMIXDIR%\etc\bldadmin.%INFORMIXSERVER%.sql
- REM # Put something in output file, so user knows something happened
- type %INFORMIXDIR%\etc\bldadmin.1in > %OUTFILE% 2>&1
- set DBPATH_PREV=%DBPATH%
- set DBPATH=
- set INFDIR=%INFORMIXDIR%
- set ADMINDB="sysadmin"
- set ADMINDIR=%INFORMIXDIR%\etc\sysadmin
- REM Create sysadmin in English
- set DB_LOCALE=en_us.8859-1
- set CLIENT_LOCALE=en_us.8859-1
- REM Create print_msg.sql and call it through dbaccess from print_msg.bat
- REM to print message to online.log
- echo echo set lock mode to wait 60; ^> print_msg.sql > print_msg.bat
- echo echo database sysmaster; ^>^> print_msg.sql >> print_msg.bat
- echo echo insert into logmessage values (%%1%%); ^>^> print_msg.sql >> print_msg.bat
- echo %INFDIR%\bin\dbaccess - print_msg.sql >> print_msg.bat
- :bldsysadmin
- REM ###
- REM # build the sysadmin database
- REM ###
- echo "About to run sysadmin database SQL setup scripts" >> %OUTFILE% 2>&1
- REM create the sysadmin database
- dbaccess - %ADMINDIR%\db_install >> %OUTFILE% 2>&1
- REM Check to see if there were no errors
- REM Make sure find.exe runs from system32 and not from a DOS directory
- %WINROOT%\System32\find /V "%INFORMIXDIR%" %OUTFILE% | %WINROOT%\System32\find /I "error"
- REM "0" means found and error so db_install.sql failed
- IF ERRORLEVEL 1 goto setupsysadmin
- IF ERRORLEVEL 0 goto failure
- :setupsysadmin
- REM ###
- REM # setup the default set of tasks in the sysadmin database
- REM ###
- REM create tasks
- echo " " > %ADMINDIR%\stop
- dbaccess - %ADMINDIR%\sch_tasks >> %OUTFILE% 2>&1
- REM Check to see if there were no errors
- REM Make sure find.exe runs from system32 and not from a DOS directory
- %WINROOT%\System32\find /V "%INFORMIXDIR%" %OUTFILE% | %WINROOT%\System32\find /I "error"
- REM "0" means found and error so sch_tasks.sql failed
- IF ERRORLEVEL 1 goto starttasks
- IF ERRORLEVEL 0 goto failure
- :starttasks
- echo "Inserting success msg into logmessage table" >> %OUTFILE% 2>&1
- echo insert into logmessage(message_num) values (%S_BLD_SYSADMIN_SUCC%); > %BLDADMIN_STATFILE%
- dbaccess sysmaster %BLDADMIN_STATFILE% >> %OUTFILE% 2>&1
- REM ###
- REM # start the remote database administration and scheduler
- REM ###
- del %ADMINDIR%\stop
- dbaccess - %ADMINDIR%\start >> %OUTFILE% 2>&1
- del %OUTFILE%
- goto exit
- :failure
- call print_msg.bat %S_BLD_SYSADMIN_FAIL%
- del print_msg.bat print_msg.sql
- goto exit
- :exit
- del %BLDADMIN_STATFILE%
|