Function documentationOperating Modes in Database Manager CLI Locate this document in the navigation structure

 

In the Database Manager CLI program, you have the option of executing the DBM commands individually, one after the other in the sequence specified. To do this, Database Manager CLI is called for each command and is then closed again after the command has been executed (command mode).

It is also possible to call Database Manager CLI in session mode and to execute the DBM commands one after the other without having to log on to Database Manager more than once (session mode).

A third option is to create a script, which can be called and processed in Database Manager CLI (script mode). If you work in script mode, you can transmit a series of DBM commands stored in a script file to Database Manager and execute them. To do this, you call Database Manager CLI with the DBM option -i <file_name>.

If you want to execute DBM commands, which require a database session or a service session, use Database Manager in session mode or script mode.

We recommend that you also work in script mode if you want a succession of DBM commands to be executed in the background.

Example

Using Command Mode to Activate the Automatic Log Backup Function

Call Database Manager CLI, log on as the operator OLEG with the password MONDAY, connect to the database DEMODB, and display the operational state of the database:

>dbmcli –u OLEG,MONDAY –d DEMODB db_online

OK

or:

Log on to Database Manager CLI as the operator OLEG with the password MONDAY, connect to the database DEMODB, and activate the automatic log backup function:

>dbmcli –u OLEG,MONDAY –d DEMODB autolog_on

OK

Using Session Mode to Backu Up the DEMODB Database

  1. Call Database Manager CLI in session mode, log on as the operator OLEG with the password MONDAY, and connect to the database DEMODB:

    >dbmcli -u OLEG,MONDAY -d DEMODB

    dbmcli on DEMODB>

  2. Open a database session:

    dbmcli on DEMODB>db_connect

    OK

  3. Start a data backup using the backup template DemoDataCompl:

    dbmcli on DEMODB>backup_start DemoDataCompl

    OK

    Returncode 0

    Date 20051229

    Time 00104810

    Server GENUA

    Database DEMODB

    Kernel Version Kernel 7.6.00 Build 016-123-109-428

    Pages Transferred 384

    Pages Left 0

    Volumes 1

    Medianame DemoDataCompl

    Location Backups 2005\Data\completeDataJan

    Errortext

    Label DAT_000000003

    Is Consistent true

    First LOG Page 15939

    Last LOG Page

    DB Stamp 1 Date 20051229

    DB Stamp 1 Time 00104809

    DB Stamp 2 Date

    DB Stamp 2 Time

    Page Count 365

    Devices Used 1

    Database ID GENUA:DEMODB_20051201_111620

    Max Used Data Page 0

    ---

    dbmcli on DEMODB>

Using Script Mode to Create a New Database

  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 SessionTimeout 0

    param_put CacheMemorySize 1000

    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 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 SessionTimeout 0

    OK

    ---

    >param_put CacheMemorySize 2500

    OK

    ---

    >param_put UseExtendedOracleSQLMode 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

    ---