Ibm Data Server DB2 User Manual Page 241

  • Download
  • Add to my manuals
  • Print
  • Page
    / 298
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 240
Chapter 5. Deploying pre-configured databases 227
The complete Windows example
Example 5-9 shows the full script used to create our ITSO sample database. All
DB2 commands are logged in the file createdb.log.
Example 5-9 The complete windows script for generating the database
@REM -------------------------------------------
@REM Step 1
@REM -------------------------------------------
setlocal
set DB2CLP=**$$**
@REM -------------------------------------------
@REM Step 2
@REM -------------------------------------------
call createdb.cmd
if errorlevel == 4 exit /b %errorlevel%
@REM -------------------------------------------
@REM Step 3
@REM -------------------------------------------
db2 -o- -l createdb.log -s CONNECT TO ITSODB
if errorlevel == 4 goto error
@REM -------------------------------------------
@REM Step 4
@REM -------------------------------------------
db2 -o- -l createdb.log -s -c- -tf itsodb.ddl
if errorlevel == 4 goto error
@REM -------------------------------------------
@REM Step 5
@REM -------------------------------------------
db2 -o- -l createdb.log commit
if errorlevel == 4 goto error
goto success
@REM -------------------------------------------
@REM Step 6a
@REM -------------------------------------------
:error
db2 -o- -l createdb.log rollback
db2 -o- -l createdb.log connect reset
exit /b 4
@REM -------------------------------------------
@REM Step 6b
@REM -------------------------------------------
:success
Page view 240
1 2 ... 236 237 238 239 240 241 242 243 244 245 246 ... 297 298

Comments to this Manuals

No comments