I discovered that the test creation script for windows is somewhat 
brittle.  It assumes that no errors will occur, and that it has never 
been run before.  I modified the script so it was more robust, and 
more flexible.  Here it is, in case someone else should ever want to 
use it:


@echo off
@rem #################################################################
@rem #create a new SAPDB database with:
@rem # - 20 MB data volume and 8 MB log volume
@rem # - database name defaults to test
@rem # - user defaults to tst (with password tst)
@rem # Modified from the SAPDB 7.4 demo creation script
@rem # Mike Slinn Aug 5/03
@rem #################################################################

if not [%1] == [/h] goto nohelp
:help
   @echo Usage: create_sapdb_db [volumeRoot dbName uid pwd]
   @echo Before running, edit the script to change the location of 
SAPDB program files
   goto dend


:nohelp

@rem Set defaults

@rem Default location of SAPDB program files:
@set SAPDB_HOME=c:\program files\sapdb

@rem Default directory root for volumes (data and log):
@set DATA=C:\sapdb

@rem Default name of the new database:
@set SID=temp

@rem Default user name and password to access the new database:
@set uid=temp
@set pwd=temp

@rem PATH doesn't include webtools
@set PATH=%SAPDB_HOME%\indep_prog\bin;%SAPDB_HOME%\indep_prog\pgm;%
PATH%

@rem Specify the SAPDB version to use:
@set INSTPATH="%SAPDB_HOME%\depend"


if [%1] == [] goto continue
    if not [%4] == [] goto setValues
       echo Invalid arguments
       goto help

    :setValues
    @set DATA=%1
    @set SID=%2
    @set uid=%3
    @set pwd=%4


:continue

@rem start remote communication server
x_server stop
x_server start

@rem stop and drop probably existing zamples database
dbmcli -d %SID% -u dbm,dbm db_offline
dbmcli -d %SID% -u dbm,dbm db_drop

@rem create new demo database
dbmcli -R %INSTPATH% db_create %SID% dbm,dbm

@rem create directory for database files (make sure it doesn't exist 
first)
@rd /s/q %DATA% > NUL
@md %DATA% > NUL
@md %DATA%\%SID% > NUL

@rem setup database parameters
@echo param_rmfile > param.tmp
@echo param_startsession >> param.tmp
@echo param_init OLTP >> param.tmp
@echo param_put CAT_CACHE_SUPPLY 300 >> param.tmp
@echo param_put CACHE_SIZE 3000 >> param.tmp
@echo param_put MAXDATADEVSPACES 5 >> param.tmp
@echo param_put RESTART_SHUTDOWN AUTO >> param.tmp
@echo param_checkall >> param.tmp
@echo param_commitsession >> param.tmp
@echo param_addvolume 1 DATA %DATA%\%SID%\DISKD0001 F 2560 >> param.
tmp
@echo param_addvolume 1 LOG  %DATA%\%SID%\DISKL001  F 1024 >> param.
tmp
@echo *** dbmcli commands: ***
@type param.tmp
@type param.tmp | dbmcli -d %SID% -u dbm,dbm

@rem start database
dbmcli -d %SID% -u dbm,dbm db_start

@rem initialize database files
@echo util_connect dbm,dbm > param.tmp
@echo util_execute init config >> param.tmp
@echo util_activate dba,dba >> param.tmp
@type param.tmp
@type param.tmp | dbmcli -d %SID% -u dbm,dbm

@rem load database system tables
dbmcli -d %SID% -u dbm,dbm load_systab -u dba,dba -ud domain

@rem create database zamples user
@echo sql_connect dba,dba > param.tmp
@echo sql_execute CREATE USER %uid% PASSWORD %pwd% DBA NOT EXCLUSIVE 
>> param.tmp
@type param.tmp
@type param.tmp | dbmcli -d %SID% -u dbm,dbm

@echo medium_put data %DATA%\%SID%\datasave FILE DATA 0 8 YES > param.
tmp
@echo medium_put auto %DATA%\%SID%\autosave FILE AUTO >> param.tmp
@echo util_connect dbm,dbm >> param.tmp
@echo backup_save data >> param.tmp
@echo autosave_on >> param.tmp

@type param.tmp

@type param.tmp | dbmcli -d %SID% -u dbm,dbm

@del param.tmp

:dend


... has anyone worked over the Linux script in a similar fashion?

Mike

_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to