Environments and Databases
LeasePak Documentation Suite NETSOL website
Overviews

Overviews

About Environments and Databases

Contents

About LeasePak Logical Databases (LLDBs)

Click here to learn about LLDBs.

About LeasePak Database Environments

A LeasePak Database Environment is an Environment Tree, which is a directory tree located in the $TOPDIR/env directory within an instance of LeasePak. This tree contains links to software, plus configuration data for the environment and its LLDB, plus some database data that cannot be stored in the LLDB. It is the entry point to the LLDB for all LeasePak utility scripts, and contains files that specialize the execution environment of users connecting to the LLDB, so that, no matter where the connection originates (from a networked PC workstation, from a local or remote secure server login, or from a batch job executing on a batch queue), the user and the LeasePak drivers will see exactly the same database and execution environment as may be seen on any other user connection to the same environment.
There are 3 types of LeasePak environments:
Production Environment

A Production Environment is a live environment being used to support an actual, live instance of LeasePak being used to conduct a real-world leasing business. This means that there are some restrictions on accessing the LLDB and its software.

Production Environments are always linked to the live build. The drivers for a Production environment are always setup to connect via a link to an exe directory in the $live build. Production Environment configuration data is always read-only, owned by the $NSTADMIN or by the $NSTDBA roles (see LeasePak Server Roles).

Test Environment

A Test Environment is intended to connect to a test-type of database. The Test Environment has looser permissions on its directory tree than does a Production Environment. It provides access to the LeasePak drivers via a directory populated with individual links to the drivers in the associated build. This allows individual drivers in the Test Environment to be replaced with experimental or special drivers to perform testing on the database. The Test Environment's tree structure is illustrated at Environment Tree.

The Test Environment may be constructed to point to the $live build, or it may be constructed to point to the build currently marked as $live and to keep pointing to that build, even if it is no longer the $live build, or it may be constructed to point to a particular build identified by Build Id on the command line.

See Setting up a Test Database below.

Visitor Environment

The Visitor Environment is configured to "visit" a "host environment" and to use the host's LLDB, but with a different build. The Visitor Environment tree (see Visitor Tree) is outwardly the same as a Production or Test Environment tree. If examined carefully, though, it can be seen that most of the directories in the Visitor Environment tree are in fact just links to directories in its host environment or in its build. In fact, the $uetc and $uexe directories are the only two actual directories in the Visitor Environment.

The Visitor Environment links to directories in the designated build, or, notably, to directories in the host environment, such as the $ueop directories and the $udata directory. Because it is sharing the database of the host environment, it cannot have independent EOP or data directories, as these represent an intrinsic part of the LLDB, and must remain in synch with it.

The Visitor Environment is not allowed to do bulk write or configuration operations to the LLDB. This includes disallowing db_add_login, db_add_user, db_restore, db_trunc_rhr, db_create (and all of its sub-programs), and all conversion programs.

The Visitor Environment is useful for training new users, or for testing new builds against live data, as it limits the user's ability to make massive changes to the data.

Host Environment

No, the Host Environment is not the fourth of three types of LeasePak environments. Any environment created without the -c (closed) flag may be a host environment. Otherwise the host environment is a full-fledged Production or Test environment. A Visitor Environment cannot be a host to yet another Visitor Environment.

Control Files There are several configuration or control files in the environment tree. These are primarily located in the $uetc directory. Not all of these files occur in every environment.
  • $uetc/envdb.msirc — This file declares shell variables that explain how the environment fits in the release. Of particular interest are $MSIENV_TYPE which has one of TEST, PRODUCTION, or VISITOR; MSIENV_BUILD which indicates which build is supplying the software, and is "live" or an explicit build id; $MSIENV_EXEMODE which has a value of LINK or DIRECTORY.
  • $uetc/logdb.* — This file declares shell variables that describe how the environment and LLDB fit together. Of interest here is $MSIDB_TYPE with the value ORA or SYB; $MSIDB_DBNAME and $MSIDB_OWNER, plus the $MSIDB_SERVER, representing the DBMS, the name of the LLDB, the owner of the LLDB and the database server.

    Note that the logdb.* files are three in number in every environment. These three files, with the extensions .msirc, .com, and .lpkd, have substantially the same content, expressed in three different notations, and are compatible with, respectively, the shell, the batch queues, and the LeasePak daemon, leasepakd.

    In a visitor environment, the logdb.* files are all actually links to the files in the host environment with the same name.

  • Every Sybase environment must contain leasepak_syb_use in the root directory of the environement ($ENVDIR), which contains a Sybase "use" statement, which establishes the logical database context for the execution of SQL scripts.
  • Every environment that is not a visitor environment, has a configuration file named physdb.msirc. This file describes the physical database in terms of the hardware (disk) resources that it occupies. This is done by listing the DBMS-configured storage segments that the LLDB uses.

    It is strongly recommended that this file be maintained by the DBAs so that there is a record of the segments used to build a LLDB. The Oracle implementation only allows for a single tablespace per LLDB, though additional datafiles can be allocated to that tablespace. The Sybase implementation allows multiple $MSIDB_SEGnn entries in the physdb.msirc file, and will construct the LLDB using all of the entries, where each $MSIDB_SEGnn is a space allocation on some sybdevice.

    See also the discussion of storage segments.

Users and Environments

When the Administrator creates a new non-Administrative User Account, it can be configured for LeasePak without assigning it to an environment. However, of course, the user must be given access to an environment in order to use LeasePak, by a person wielding the credentials of the owner of the environment's LLDB to execute db_add_user (see also LeasePak Server Roles for more information about the $MSIDB_OWNER's role).

The LeasePak Supervisor must also give the user a Security Record using the [U0706]Security update.

The $MSIDB_OWNER (the DBO) is created or assigned to the LLDB when db_create is executed by the Administrator. The various commands that require the $MSIDB_OWNER's password always figure out who the owner is because the commands always access the LLDB via the environment. The user executing the commands thus only needs to know the password for the DBO, not the DBO's actual user name.

When a LeasePak user connects to LeasePak via a PC workstation running the LeasePak Client software, s/he passes along the environment name to connect to, and the LeasePak daemon, leasepakd, also consults the environment configuration files in $uetc to determine the particulars about the LLDB.

Setting up a Test Environment and Database
  • create a new test environment in the LeasePak release instance using setup_new_env
  • create the LLDB using db_create
  • load level7, or other suitable data, into the database using db_restore
  • configure the database to support the scenario to be tested
  • add security records for the persons to be performing the tests using db_add_login, db_add_user, U0706
  • use db_snapshot to back up the set-up
  • use db_restore to "wind" the database back to its starting state in order to perform repeat or added tests on the same scenario
  • the database can be left as-is after the tests, and can be refreshed from the snapshot, or it can be completely rebuilt with db_create. It and its environment also may be deleted by using db_drop.
See LeasePak Server Configuration and Maintenance for in depth information and procedures for creating and provisioning a LLDB.