Click or drag to resize
Database Management using Scripts

[This is preliminary documentation and is subject to change.]

Introduction to managing databases for TOPICA applications - using command scripts

Note Note

If the version of the framework is 4.25 or later, it is recommended to use the Administration Module to manage databases. This is much easier than using command line scripts.

This topic contains the following sections.

Location of scripts

The instructions for using command scripts to manage databases use the phrase "navigate to the folder containing the command scripts". Where to find this folder depends on the framework version:

  • Release 4.25 and newer:

    • The command scripts (and associated SQL scripts) are distributed as part of the framework. The framework is installed in the <webhome> folder. The command scripts are located within this folder. The folder structure is as follows (subset):

      <webhome>
          Database
              CommandScripts
              SQLScripts
                  4.23
                  4.24
                  4.25
    • "The folder containing the command scripts" = CommandScripts

  • Release 4.24 and older:

    • The files used to create databases are distributed separately from the framework as one ZIP-file (typically named Database.zip) containing SQL scripts and command files.

      Move the ZIP-file to the computer where you want to run the scripts. This could be the database server (running SQL Server) - or a computer that has network connection to the database server.

      Unpack the files (it is not important where you place the files). After unpacking, you see the following folder structure (only a subset of the full structure is shown here):

      Database
          SQLScripts
              4.21
              4.22
              4.23
              4.24
          SQLServer2005
          SQLServer2008
    • "The folder containing the command scripts" = SQLServer2008

    • Caution note Caution

      The command files in SQLServer2005 are meant for SQL Server 2005 only - these scripts are now obsolete. Do not use!

SQL scripts

The folders named 4.xx in the SQLScripts folder contain SQL scripts to create database objects (tables, views, functions, stored procedures etc.) for different versions of the data model.

Hints

An easy way to open a command prompt with a requested folder as the working folder (works in Windows 7 and Windows Server 2008):

  • Open a Windows Explorer window.

  • Navigate to the requested folder.

  • Press and hold the Shift key, right-click the requested folder, and select "Open command window here".

All the command scripts generate output in the command prompt window. Some scripts generate A LOT of output. This output may contain error messages. It is important to check this output for any error messages.

  • The command prompt window has a default size of width=80 characters and height=25 characters, and default buffer of width=80 characters and height=300 characters. This buffer size is not enough for the scripts to create and update databases. You should change these sizes before running the scripts - otherwise some output will be lost.

  • As an alternative, you may "pipe" the output of the scripts into text files, e.g.

    commandscript param param param ... > output.txt

    The resulting text file (in this example output.txt) may be opened in any text editor, e.g. Notepad.

See Also