There are various ways to create a new database.
The easiest way to create a new database is with Installation Manager.
You can, however, also use Database Manager CLI. With this program, you can create a new database by either using the system default for the database parameter file, or by importing the parameter file from another database.
This example describes how you can create a new database using the system default for the parameter file and subsequently adjust individual values to fit your requirements. In Database Manager CLI, you can either execute the DBM commands sequentially or use a script to do this.
The following section describes the DBM commands to be executed sequentially. If you want to use a script, proceed as described in Using a Script File.
You can create a database on the local computer or using the option -n on a remote computer.
To create a database on a remote computer, you must have permissions as an operating system user on that computer. On Microsoft Windows, this user must have the permission logon as batch job. To find out how you can assign this permission to a user, see your operating system documentation.
You want to create a new database with the name DEMODB on the local computer.
You define the first DBM operator for this database with the user name DBM and the password DBM.
You define the database system administrator with the name DBADMIN and the password SECRET.
You want to change the values for the database parameters SessionTimeout, CacheMemorySize, UseExtendedOracleSQLMode, MaxDataVolumes, and MaxUserTasks.
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
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
You can find the prerequisites under Database Manager CLI
Call Database Manager CLI, create the new database DEMODB, and define the first DBM operator with user name DBM and password DBM.
>dbmcli db_create DEMODB DBM,DBM
OK
Alternative command line:
If several versions of the database software are installed on your computer, you need to enter additional information. Use the option -R to specify the version for which you want to create the database:
>dbmcli -R "C:\Program Files\SDB\7.6.00" db_create DEMODB DBM,DBM
Call Database Manager CLI in session mode, log on as operator DBM with the password DBM, and connect to the database DEMODB:
>dbmcli -u DBM,DBM -d DEMODB
dbmcli on DEMODB>
Open a parameter session:
>param_startsession
OK
dbmcli on DEMODB>
Initialize the database parameters and define the database type MaxDB (default value):
>param_init
OK
dbmcli on DEMODB>
Change the database parameter CacheMemorySize to the value 1000:
dbmcli on DEMODB>param_put CacheMemorySize 1000
OK
Change the database parameter MaxDataVolumes to the value 64:
dbmcli on DEMODB>param_put MaxDataVolumes 64
OK
Change the database parameter MaxUserTasks to the value 10:
dbmcli on DEMODB>param_put MaxUserTasks 10
OK
Check all database parameters:
dbmcli on DEMODB>param_checkall
OK
Confirm the changes to the database parameter file:
dbmcli on DEMODB>param_commitsession
OK
Create data and log volumes:
Create data volume no. 1 with name DISKD0001, type FILE, size 32768 pages:
dbmcli on DEMODB>param_addvolume 1 DATA DISKD0001 F 32768
OK
Create log volume no. 1 with name DISKL0001, type FILE, size 6400 pages:
dbmcli on DEMODB>param_addvolume 1 LOG DISKL0001 F 6400
OK
Transfer the database to the ADMIN operational state:
dbmcli on DEMODB>db_admin
OK
Initialize the new database and create the database system administrator with user name DBADMIN and password SECRET:
dbmcli on DEMODB>db_activate DBADMIN,SECRET
OK
Load the system tables:
dbmcli on DEMODB>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
...
...
==================================
Installation successfully finished
==================================
Switch on the function to automatically update the optimizer statistics:
dbmcli on DEMODB>auto_update_statistics ON
OK
Switch on the function to automatically extend the data area:
dbmcli on DEMODB>auto_extend ON
OK
Load the demo data:
dbmcli on DEMODB>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
==================================
Switch on overwrite mode for the log area:
dbmcli on DEMODB>db_execute SET LOG AUTO OVERWRITE ON
OK
You have created the database DEMODB. It is now in the ONLINE operational state. Currently, only the first DBM operator with user name DBM and password DBM as well as the database system administrator with user name DBADMIN and password SECRET can administer this database.
We recommend that you now create an additional DBM operator with the name OLEG and password MONDAY, whose user data is used to create all the examples in this Database Manager CLI Tutorial (see Creating a DBM Operator).
Depending on what you want to test in the DEMODB database, proceed in one of the following ways:
If you want to create additional database users, schemas, and tables, fill these with data, and execute further SQL statements, proceed as described in the SQL Tutorial.
If you want to practice database administration using DEMODB, you can replicate the examples in this Database Manager CLI Tutorial on your own.
Using the Parameter File from Another Database
Database Manager CLI, Overview of all DBM Commands and DBM Options