## Using a Script File

### Use

You create a script file containing all DBM commands you want to execute and save it.

Then you call the Database Manager, specifying this script file.

See also:

Creating and Configuring a Database Instance

Database Manager CLI, -i, -ic, -is, -ics: Name of the Input Script

### Scenario

You want to create a new database instance using a script file.

The new database instance is to have the name DEMODB and be created on the local computer.

As the first DBM operator for this database instance, define user DBM with password DBM.

As the database system administrator, define user DBADMIN with password SECRET.

You want to change the values for the database parameters SESSION_TIMEOUT, _UNICODE, CACHE_SIZE, _SERVERDB_FOR_SAP, MAXDATAVOLUMES and MAXUSERTASKS. (Note: You cannot change the database parameter _UNICODE after creating the database instance; see Unicode.)

You want to create a data volume named DISKD0001 of type File with 32768 pages and a log volume named DISKL0001 of type File with 6400 pages.

You also want the system to

● automatically update the statistics of the database instance

● automatically expand the data area when the fill level reaches 90% (default value)

● load the system tables

● load the demo data

● switch on overwrite mode for the log area

### Procedure

...

1. Create the script file demoscript.txt and save it here:

C:\test\DBM

2. Copy the following template to the script file and save your entries:

db_create DEMODB DBM,DBM

param_startsession

param_init OLTP

param_put SESSION_TIMEOUT 0

param_put _UNICODE YES

param_put CACHE_SIZE 2500

param_put _SERVERDB_FOR_SAP NO

param_put MAXDATAVOLUMES 64

param_put MAXUSERTASKS 10

param_checkall

param_commitsession

param_addvolume 1 DATA DISKD0001 F 32768

param_addvolume 1 LOG DISKL0001 F 6400

db_admin

db_activate DBADMIN,SECRET

load_systab

auto_update_statistics ON

auto_extend ON

load_tutorial

db_execute SET LOG AUTO OVERWRITE ON

3. Call the Database Manager CLI with the option for executing the script file:

...

>dbmcli -i "C:\test\DBM\demoscript.txt"

>db_create DEMODB DBM,DBM

OK

---

>param_startsession

OK

---

>param_init OLTP

OK

---

>param_put SESSION_TIMEOUT 0

OK

---

>param_put _UNICODE YES

OK

---

>param_put CACHE_SIZE 2500

OK

---

>param_put _SERVERDB_FOR_SAP NO

OK

---

>param_put MAXDATAVOLUMES 64

OK

---

>param_put MAXUSERTASKS 10

OK

---

>param_checkall

OK

---

>param_commitsession

OK

---

>param_addvolume 1 DATA DISKD0001 F 32768

OK

---

>param_addvolume 1 LOG DISKL0001 F 6400

OK

---

>db_admin

OK

---

>db_activate DBADMIN,SECRET

OK

---

>auto_update_statistics ON

OK

---

>auto_extend ON

OK

---

>load_systab

OK

0,OK: everything works fine

0,""c:\program files\sdb\maxdb1\bin\x_python" "c:\program files\sdb\maxdb1\env\lsystab.py" -R "c:\program files\sdb\maxdb1" -d DEMODB -u DBADMIN,*"

Removing obsolete objects

Installing Loader tables

Installing messages and help

Installing SYSDBA tables

Installing comments for SYSDBA tables

Installing precompiler tables

Installing system tables for R3 backup information

Installing ODBC tables

Installing system tables for ORACLE (V7) mode

Installing data dictionary tables and views

Installing synonyms for oracle system tables

Installing comments on oracle system tables

Installing tables for WebAgent

Installing tables for Repository

Installing DOMAIN tables

Installing comments for DOMAIN tables

Installing Views as replacement for SHOWs

Installing Database Manager tables

Installing SYSINFO tables

Installing comments for SYSINFO tables

Installing support for UDE (User Defined Extensions)

Installing tables for JDBC Database Metadata

Installing tables for SQLDBC Database Metadata

Installing additional triggers

==================================

Installation successfully finished

==================================

---

>load_tutorial

OK

0,OK: everything works fine

0,""c:\program files\sdb\maxdb1\bin\x_python" "c:\program files\sdb\maxdb1\env\../demo/ltutorial.py" -R "c:\program files\sdb\maxdb1" -d DEMODB -u DBADMIN,*

"

HOTEL

==================================

Installation successfully finished

==================================

---

>db_execute SET LOG AUTO OVERWRITE ON

OK

---