Hi Sheran
You will find the example script create_demo_db.sh in:
Depend/misc folder.
Otherwise take the scripts (Windows/Linux) I have attached.
Cheers
Edo
> -----Original Message-----
> From: Zavier Sheran [mailto:[EMAIL PROTECTED]
> Sent: Donnerstag, 22. April 2004 23:25
> To: maxdb
> Subject: Script to create instance with dbmcli
>
> I'm running into problems using DB Manager trying to setup and
instance on
> a
> remote Linux server.
>
> Either I can't go through the setup because of an error or the
instance
> that
> I create causes Apache to segfault when accessed via PHP.
>
> I had it working once, the problem with segfaulting turned out to be a
> faulty instance (creating a new one solved the problem), but then the
> server
> had to be reinstalled and I can't make it work anymore.
>
> Is there a sample script that has all the necessary parameters to
create
> an
> instance via dbmcli?
>
>
> Thanks a lot
>
> -Zavier
>
>
>
> --
> MaxDB Discussion Mailing List
> For list archives: http://lists.mysql.com/maxdb
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
@echo off
rem -----------------------------------------------------------------------
rem Trivadis AG, Baden/Basel/Bern/Freiburg i. Br./Lausanne/Mellingen/
rem M�nchen/Stuttgart/Z�rich
rem Switzerland/Germany Internet: http://www.trivadis.com
rem -----------------------------------------------------------------------
rem level............: DBA
rem name.............: Create_MAXDB_750.cmd
rem developer........: Edo Bezemer
rem date.............: March 2004
rem version..........: 1.0
rem usage............: Installs ONLY a MAXDB Database Version 7.5.0.2
rem input parameter..: --
rem output.......... : --
rem remarks..........: Restriction MAXDB must be Version 7.5!!!!!
rem -----------------------------------------------------------------------
rem changes
rem DD.MM.YYYY developer change
rem
rem -----------------------------------------------------------------------
rem
rem -----------------------------------------------------------------------
rem # IND -> independent program path
rem # DEP -> dependent path
REM #=====================================================================
REM # Environment variables used by MAXDB
REM #=====================================================================
set SID=
set LOG_MIRRORED=
set IND_PROG=
set DEP_PROG=
set IND_DATA=
set DATASIZE=
set LOGSIZE=
set createDEMO_user=
REM #=====================================================================
REM # You can enter in this part the name and the size of your Database.
REM # Now the predefined sizes are:
REM # datasize=50MByte (=6400 pages x 8K)
REM # logsize=8MByte (=2560 pages x 8K)
REM #=====================================================================
echo -
echo -
echo -
echo - __________________________________________________
echo -
echo - MAXDB Database installer
echo -
echo - __________________________________________________
echo -
echo - Version 7.5.0.8
echo -
echo - __________________________________________________
echo -
echo -
echo -
echo -
echo -
set /P SID=- Please enter the Name of the Database:
echo -
echo -
set /P IND_PROG=- Please enter the INDEPEND PROGRAM Path [C:\MAXDB]:
if "%IND_PROG%" == "" set IND_PROG=C:\MAXDB
echo -
echo -
set /P IND_PROG=- Please enter the INDEPEND DATA Path [D:\MAXDB]:
if "%IND_DATA%" == "" set IND_DATA=D:\MAXDB
set PATH=%IND_PROG%\bin;%IND_PROG%\pgm;%PATH%
echo -
echo -
set /P DEP_PROG=- Please enter the DEPEND PROGRAM Path to be used [C:\MAXDB\7500]:
if "%DEP_PROG%" == "" set DEP_PROG=C:\MAXDB\7500
echo -
echo -
set /P DATASIZE=- Please enter the size in MByte of the Datasize [50]:
if "%DATASIZE%" == "" set DATASIZE=6400
echo -
echo -
set /P LOGSIZE=- Please enter the size in MByte of the Logsize [16]:
if "%LOGSIZE%" == "" set LOGSIZE=2048
echo -
echo -
set /P LOG_MIRRORED=- Do you want to activating Log Mirroring ([YES]/NO):
if "%LOG_MIRRORED%" == "" set LOG_MIRRORED=YES
echo -
echo -
set /P createDEMO_user=- Creating a demo user ([Y]/N):
if "%createDEMO_user%" == "" set createDEMO_user=Y
set INSTPATH="%DEP_PROG%"
REM *
REM * Check the values given by the user.
REM *
REM *
rem param_directput LOG_MIRRORED YES
rem param_addvolume 1 DATA DEVSPDAT01 F %SIZE%
rem param_addvolume 1 LOG %DATA%\DEVSPLOG1a F %LOGSIZE%
rem param_addvolume 1 MLOG %DATA%\DEVSPLOG1b F %LOGSIZE%
if "%SID%" == "" goto ERROR
if not exist %DEP_PROG% goto CHECK_DEPPATH
if not "%LOG_MIRRORED%" == "YES" goto CHECK2
goto CONTINUE
:CHECK2
if not "%LOG_MIRRORED%" == "NO" goto ERROR
goto CONTINUE
if not "%createDEMO_user%" == "Y" goto CHECK3
goto CONTINUE
:CHECK3
if not "%createDEMO_user%" == "N" goto ERROR
goto CONTINUE
:CHECK_DEPPATH
set create_dep=Y
echo -
echo -
echo -
echo - You entered Dependend Path as %DEP_PROG%!
echo -
echo - This folder does not exist
goto ERROR
goto CONTINUE
:CONTINUE
set DATA=D:\MAXDB\data\%SID%
set DATA_M=D:\MAXDB\data\%SID%
set pfile=C:\MAXDB\admin\%SID%\pfile\parameter_%SID%.tmp
set initfile=C:\MAXDB\admin\%SID%\pfile\init_%SID%.tmp
set create_userfile=C:\MAXDB\admin\%SID%\create\create_userDEMO.tmp
REM #=====================================================================
REM # Check the directory of the datafiles (data,log)
REM # The corresponding directories will eventuelly be created.
REM #=====================================================================
echo -
echo -
echo - Creating the database structure......
echo -
echo -
if not exist %IND_DATA%\wrk\%SID% md %IND_DATA%\wrk\%SID%
if not exist D:\MAXDB md D:\MAXDB
if not exist D:\MAXDB\data md D:\MAXDB\data
if not exist D:\MAXDB\data\%SID% md D:\MAXDB\data\%SID%
if not exist D:\MAXDB\backup md D:\MAXDB\backup
if not exist D:\MAXDB\backup\%SID% md D:\MAXDB\backup\%SID%
if not exist C:\MAXDB md C:\MAXDB
if not exist C:\MAXDB\data md C:\MAXDB\data
if not exist C:\MAXDB\data\%SID% md C:\MAXDB\data\%SID%
if not exist C:\MAXDB\admin md C:\MAXDB\admin
if not exist C:\MAXDB\admin\%SID% md C:\MAXDB\admin\%SID%
if not exist C:\MAXDB\admin\%SID%\create md C:\MAXDB\admin\%SID%\create
if not exist C:\MAXDB\admin\%SID%\log md C:\MAXDB\admin\%SID%\log
if not exist C:\MAXDB\admin\%SID%\pfile md C:\MAXDB\admin\%SID%\pfile
REM #=====================================================================
REM # start remote communication server
REM #=====================================================================
echo -
echo -
echo - (Re-)Starting remote communication server......
echo -
echo -
%IND_PROG%\bin\x_server stop
%IND_PROG%\bin\x_server start
REM #=====================================================================
REM # Registering the new database with the Database Manager Operator dbm.
REM #=====================================================================
echo -
echo -
echo - Registering the new database with the Database Manager Operator dbm.
echo -
echo -
rem
rem Drop the database if it already exists
rem
dbmcli -d %SID% -u dbm,dbm db_offline > NUL
dbmcli -d %SID% -u dbm,dbm db_drop > NUL
dbmcli -R %INSTPATH% db_create %SID% dbm,dbm
REM #=====================================================================
REM # Creating the parameterfile of the database.
REM #=====================================================================
echo -
echo -
echo - Creating the parameterfile of the database.
echo -
echo -
echo param_rmfile
> %pfile%
echo param_startsession
>> %pfile%
echo param_init
>> %pfile%
echo param_put MAXUSERTASKS 5
>> %pfile%
echo param_put LOG_MIRRORED %LOG_MIRRORED%
>> %pfile%
echo param_checkall
>> %pfile%
echo param_commitsession
>> %pfile%
echo param_addvolume 1 DATA %DATA%\DATA_%SID%_01 F %datasize%
>> %pfile%
echo param_addvolume 1 LOG %DATA%\LOG_%SID%_01 F %logsize%
>> %pfile%
if "%LOG_MIRRORED%" == "YES" echo param_addvolume 1 MLOG %DATA_M%\MLOG_%SID%_01 F
%logsize% >> %pfile%
REM #=====================================================================
REM # Accessing the the Database Kernel with the DB_ADMIN to
REM # build the physical structure on the harddrive
REM #=====================================================================
rem echo db_admin -f
>> %pfile%
echo db_start
>> %pfile%
echo util_connect
>> %pfile%
echo db_activate dba,dba
>> %pfile%
echo util_release
>> %pfile%
REM #=====================================================================
REM # Loading the database system tables (The Database catalog).
REM # Required are the Database Manager Oparator and the Password (-ud) of
REM # the user Domain, who owns the metadata.
REM #=====================================================================
echo load_systab -ud domain
>> %pfile%
pause
echo -
echo -
echo - Building the physical memory structure on disk and
echo - Loading the database system tables......
echo -
echo -
dbmcli -d %SID% -u dbm,dbm -i %pfile%
REM #=====================================================================
REM # Starting up the database with the kernelparameter from above.
REM #=====================================================================
echo -
echo -
echo - Change the database mode to online......
echo -
echo -
rem dbmcli -d %SID% -u dbm,dbm db_online
rem pause
REM #=====================================================================
REM # Creating the user demo
REM #=====================================================================
if "%createDEMO_user%" == "Y" goto create_DEMO_user
goto EXIT
:create_DEMO_user
echo -
echo -
echo - Creating the user demo......
echo -
echo -
echo sql_connect dba,dba > %create_userfile%
echo sql_execute CREATE USER test PASSWORD test DBA NOT EXCLUSIVE >> %create_userfile%
type %create_userfile% | dbmcli -d %SID% -u dbm,dbm
goto EXIT
:ABORT
echo -
echo -
echo -
echo -
echo -
echo - Your database system "%SID%" couldn't be created!
echo - The MAXDB version isn't 7.4.3
echo -
echo -
echo -
echo -
goto END
:ERROR
echo -
echo -
echo -
echo -
echo -
echo - An Error occured by entering a wrong value. Restart the program.
echo -
echo -
goto END
:ERROR_DEP
echo -
echo -
echo -
echo -
echo -
echo - A Depended Path must exist. Restart the program.
echo -
echo -
goto END
:EXIT
echo -
echo -
echo -
echo -
echo -
echo - Have fun with your open source database system "%SID%"!
echo -
echo -
goto END
:END
echo -
echo - Goodbye.....
echo -
echo -
echo -
pause
rem exit--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]