Environments and Databases
LeasePak Documentation Suite NETSOL website
Environments and Databases

LeasePak Server Configuration and Maintenance

Environments and Databases

setup_new_env

Top Overview Setup_new_env Db_create Db_restore

Creating LeasePak Environments

Topics

  • Environments
    • production environment
    • test environment
    • visitor environment
    • non-volatile environment
    • setup_new_env
  • Hosts
    • dbms host
    • application host
  • LLDB
    • LLDB properties
      • database type
      • storage segments
    • database system
    • database server
  • Builds
    • build-descriptor
      • build ID
      • build ID alias
  • LeasePak
    • LeasePak instance
    • SETUP
  • General
    • shell
      • command prompt
  • Users and Roles
    • LeasePak administrative users
      • $NSTADMIN
        • LeasePak release administrator
  • Naming convention
    • Loose convention
    • Strict convention
Use setup_new_env to create new production, test, and visitor environments to access LLDBs.
setup_new_env may only be run by $NSTADMIN. Does not require the services of the Queue Manager or of any database server processes.

Common Usage

The following are the two most common examples of using setup_new_env:

Production Environments
setup_new_env env-name db-type db-server db-name

where

  • env-name is the environment the new LLDB will be associated with
  • db-type is the database type: either ora for Oracle or syb for Sybase
  • db-server is a database server associated with the selected DBMS when SETUP was run
  • db-name is the LLDB's name
Test Environments
setup_new_env -tl env-name db-type db-server db-name build-descriptor

where the parameters are the same as for Production Environments, plus:

  • -tl (minus-lowercase-T-L) signifies a test environment
  • build-descriptor determines where the environment will find its executable copies of LeasePak. For a test environment, it can be the build ID alias live or a build ID in the form bldn.nn.nnnn (for example bld7.70.1234)
Multiple concurrent versions: If there is more than one LeasePak instance accessing the same database server, note that LLDB names must be unique within the entire database system, not just within the individual LeasePak instances.

setup_new_env Worksheet

Note the following values for running setup_new_env
Name Description Your Value Notes
options commandline switches production: (none)
test: -tl
visitor: -vl
env-name environment name Must be unique for the specific LeasePak instance and comply with the selected type of naming convention
db-type database type ora for Oracle or syb for Sybase
db-server database server name Must be one of the database server names defined for the db-type when LeasePak was installed
db-name See About LLDBs LLDB names must be unique for the DBMS on this DBMS host and comply with the selected type of naming convention
build-descriptor LeasePak build ID or build id alias Must be live or the build ID (in the form bldn.nn.nnnn, for example (for example 7.70.1234) of a compatible installed LeasePak build. For test and visitor environments only

Running setup_new_env

Log on the application host as $NSTADMIN.

Either run setup_new_env with the common usage described above, and demonstrated below, or click here to see the complete syntax of setup_new_env.

[nsadm77a:~]  setup_new_env prod syb SEVILLE lpr_prod
The command will produce a display similar to this
	[nsadm77a:~]  setup_new_env prod syb SEVILLE lpr_prod
	2011-08-13 17:50:47 setup_new_env:  PRODUCTION prod syb SEVILLE lpr_prod live; Start
	2011-08-13 17:50:48 setup_new_env: Creating environment directory structure...
	2011-08-13 17:50:48 setup_new_env: Creating syb_use...
	2011-08-13 17:50:48 setup_new_env: Creating logdb.*...
	2011-08-13 17:50:51 setup_new_env: Creating envdb.msirc...
	2011-08-13 17:50:52 setup_new_env: Creating msidba placeholder ...
	2011-08-13 17:50:52 setup_new_env: Creating .lp*...
	2011-08-13 17:50:52 setup_new_env: Setting environment security...

	You will need the following for Leasepak PC Client setup:
	IP Address or name: seville
	Environment name:   prod
	Server Port:        7700
	2011-08-13 17:50:53 setup_new_env: End
						

Designate environment as non-volatile

Log on the application host as $NSTADMIN.

Change the current directory to the environment's etc directory:

% cd $top/env/<environment-name>/etc

Create hidden file .nonvolatile_environment:

% touch .nonvolatile_environment

Set permissions on the file to 440:

% chmod 440 .nonvolatile_environment

If you then attempt to run the db_restore or db_drop scripts on the environment, an error message will be displayed and the script will exit without running.

db_create

Top Overview Setup_new_env Db_create Db_restore

Creating LeasePak Logical Databases

Topics

  • Environments
    • Administrative environment
    • Production environment
    • test environment
    • visitor environment
    • host environment
    • non-volatile environment
    • setup_new_env
  • LLDB
    • LLDB properties
      • database type
      • database system
      • database server
    • NetSol utility script
      • db_create
  • Hosts
    • application host
  • LeasePak
    • NetSol Technologies North America
    • NetSol Help Desk
  • General
    • job
      • backups
    • shell
      • command prompt
    • SQL
  • Storage segment
    • common storage segment
    • dedicated storage segment
    • data storage segment
      • data segment
    • log storage segment
      • log segment
  • transaction log
  • tablespace
  • database device
    • data device
    • log device
  • Users and Roles
    • System Administrator
    • LeasePak administrative users
      • $NSTDBA
        • LeasePak database administrator
      • $SRVADM
        • Database server administrator
      • $DBOWNER
        • $SYB_AUTODBO SETUP option
  • password
  • Naming convention
    • Loose naming convention
    • Strict naming convention
Use db_create to create a new LLDB for a particular environment. If the operator approves it, db_create also will drop an existing LLDB and replace it with new fully provisioned LLDB.
db_create may only be run by $NSTDBA, LeasePak database administrator. It requires that the operator know the password for the database server administrator, $SRVADM; that the operator be prepared to assign a password to any DBO that may be created (see note below); it requires that the database server for the db_type selected when the environment was created using setup_new_env be up and running and capable of executing interactive SQL commands; it does not require the services of the Queue Manager.
db_create may require the operator to enter a password for the DBO, the owner of the LLDB about to be constructed. If the LLDB is being created under Oracle, or if under Sybase and the LeasePak $SYB_AUTODBO SETUP option, Automatically create Sybase database owner names, is set to Y (echo $SYB_AUTODBO at the command prompt to see), a separate database system user, with the same name as the LLDB, will be created as the DBO, and the operator will be required to provide a password for this new user. This user should not have a UNIX/Linux user account. If $SYB_AUTODBO is 'N', the operator will be required to provide an existing Sybase user's name, and a password for this role.
As with most LeasePak db_* commands that affect a particular LLDB, db_create determines the appropriate LLDB to use via the environment parameter. which references the settings created by setup_new_env.
The db_create command may only be run for production environments and test environments; visitor environments are not allowed to perform data-destroying tasks on the LLDBs they point to. The original, or host environment, given when the visitor environment was created, must be used for performing data-destroying tasks such as db_create.
Do not create an LLDB in the administrative environments, adm_ora or adm_syb.

Common Usage

The following is the most common example of using db_create:

db_create env-name

where

  • env-name is the environment in which the LLDB will be (re)created
  • Other inputs
    • The operator will be prompted for the $SRVADM's (the database server administrator's) password. For security, the characters of the password are not printed on the screen as the operator types them.
    • The operator may be prompted for the 's password. If creating a new LLDB, the operator may be prompted to reenter the DBO's password to confirm. For security, the characters of the passwords are not printed on the screen as the operator types them.
    • The ensuing discussion will refer to LeasePak Storage Segments; the reader is invited to study the article on storage segments, which is located in this System Administration Guide.
    • The operator will be prompted for the storage segments on which to construct the LLDB. The DBMS determined by the db-type that was indicated when the environment was constructed using setup_new_env is the DBMS under which the LLDB will be constructed; this in turn will determine how db_create prompts for storage segments.
      • Oracle
      • Under Oracle , the operator will be presented with a list of one or more s. Each storage segment is an Oracle tablespace. An Oracle LLDB can use only one storage segment, but an Oracle storage segment can contain multiple LLDBs. Only storage segments constructed for LeasePak may be used with db_create.
      • For small LLDBs under 300MB, when prompted, the operator enters a common storage segment and specifies the required size of the LLDB in megabytes when prompted.
      • For larger LLDBs over 300MB, the System Administrator must create a dedicated storage segment specifically for the particular LLDB under construction; this along with any common storage segments will be displayed. The operator enters the dedicated storage segment when prompted and when prompted for the size, enters UNLIMITED, which allows the LLDB to utilize the entire segment.
      • Each common storage segment can contain multiple LLDBs; each dedicated storage segment can contain only one LLDB.
      • If the Strict naming convention is in force, only common storage segments and a possible dedicated storage segment will be displayed. If the Loose naming convention is in force, then other system and/or non-LeasePak storage segments may be displayed as well.
      • The operator must be careful to not locate segments for any LLDB on any tablespace that was not specifically created for LeasePak.
      • Sybase
      • Under Sybase (db-type of syb), the operator will be presented with a list of two or more storage segments. Each storage segment is a Sybase database device. The System Administrator must create these storage segments before LLDB creation. Two kinds of storage segments must be created: data devices and log devices. Each Sybase LLDB requires space on both kinds of storage segments.
      • When prompted, the operator enters the name of a storage segment to use, then enters the number of megabytes of space available on that storage segment to allocate to the LLDB, and then enters D for data or L for log to indicate how the storage segment is to be used. The operator continues selecting storage segments until sufficient space has been allocated for the LLDB's needs for both data storage segments and log storage segments have been met.
      • Data storage segments must be used for only the LLDB's data segments, and log storage segments must be used for only the log segments of LLDBs. Mixing data and log from any LLDBs on the same storage segment is not allowed.
      • Each Sybase storage segment can hold parts of multiple LLDBs.
      • When setting up Sybase devices, it is strongly advised that the System Administrator choose a naming convention that will make the purpose of each device clear.
      • The operator must be careful to not locate sgements for any LLDB on any device that was not specifically created for LeasePak.
  • If the LLDB already exists, db_create will ask the operator whether or not to drop the LLDB. If the operator enters 'Y' or 'y', the existing LLDB will be destroyed, and all data in it will be permanently lost unless the System Administrator has made a suitable . If the operator enters anything else, the LLDB will not be affected, and db_create will abort.

db_create Worksheet

Note the following values for running db_create
Name Description Your Value Notes
env-name environment name Must have been previously created using setup_new_env
$NSTDBA's password LeasePak Database Administrator This user is the one who has permission to run db_create. The $SRVADM's password will also be required, as well as potentially the password for the DBO..
$SRVADM's password database server administrator This user is the one who actually runs the commands under the database server to provision and create the LLDB.
$SYB_AUTODBO obtain from environment:
echo $SYB_AUTODBO
Determines the way the DBO is set up in the next row
DBO-name The user to be assigned the DBO role Required if under Sybase and $SYB_AUTODBO is N; is created automatically otherwise
DBO's password The LLDB owner The DBO is the user-role who owns the objects within the LLDB and who grants regular users access to the LLDB
Data size # of megabytes of data space needed Under both Oracle and Sybase; if under Oracle and a dedicated storage segment is to be used, should be "UNLIMITED" Under Syabse, should be the total of required data space.
Storage segment if known Oracle: either a common storage segment or a dedicated storage segment (must be dedicated if size > 300MB);
Sybase: may not be known ahead of time
Log size # megabytes of log space needed Sybase only

CRITICAL NOTE

Sybase Only

db_create creates an LLDB with the truncate log on checkpoint option enabled. This will empty the database server-generated transaction logs each time an automatic checkpoint is performed by the database server. In production environments, the administrator MUST disable the Sybase truncate log on checkpoint option so that the entire transaction log is available for recovery in the event of a system failure between full backups. The transaction log is vital for recovery from system errors and crashes. It can be managed so that its disk space requirements are kept as low as possible. Refer to the Sybase Adaptive Server documentation for more information or contact the NetSol Help Desk.

Running db_create

Log on the application host as $NSTDBA, the LeasePak database administrator.

Either run db_create with the common usage shown below, or click here to see the complete syntax of db_create.
[nsdba77a:~]  db_create prod

The command will produce a display similar to the screen print below. For brevity we have deleted several lines (shown by "...") from this screen print; the full output of db_create for Sybase can be seen by clicking here, for Oracle by clicking here.

		[nsdba77a:~]  db_create prod
		2011-08-13 17:52:56 db_create: Create (prod)lpr_prod
		2011-08-13 17:52:56 db_create: Running commands as srvadm

		Server Administrator 'srvadm' password: srvadm's password

		Logical database owner 'OWNER' password: database owner's password
		2011-08-13 17:53:14 db_get_dbo: Start
		2011-08-13 17:53:14 db_get_dbo: Running commands as srvadm
		2011-08-13 17:53:17 db_setup_phys: Set up physical storage description for (prod)lpr_prod

		Storage segments with available space:
			   lpk_log01   160                        lpk_data05   388
			   lpk_log02   230                        lpk_data06   332
			   lpk_log03   173                        lpk_data07   380
			   lpk_log04   320                        lpk_data08   178
			   lpk_log05   581                        lpk_data09   368
			  lpk_data04   38                         lpk_data10   298

		[<RET>/Q/q]=quit  [R/r]=redisplay list  [V/v]=view physdb.msirc
		Enter Segment name from list above: lpk_data05
		Enter # MBs required from segment: 150
		Segment type: 'D[ATA]' or 'L[OG]': d

		[<RET>/Q/q]=quit  [R/r]=redisplay list  [V/v]=view physdb.msirc
		Enter Segment name from list above: lpk_log01
		Enter # MBs required from segment: 40
		Segment type: 'D[ATA]' or 'L[OG]': l

		[<RET>/Q/q]=quit  [R/r]=redisplay list  [V/v]=view physdb.msirc
		Enter Segment name from list above: q
		Current contents of physdb.msirc:
		setenv  MSIDB_SEG01     "lpk_data05,150,DATA"
		setenv  MSIDB_SEG02     "lpk_log01,40,LOG"

		2011-08-13 17:54:45 db_setup_phys: New physical configuration of (prod)lpr_prod stored in
		  $ENVDIR/etc/physdb.msirc
		2011-08-13 17:57:43 db_get_dbo: Start
		2011-08-13 17:57:43 db_get_dbo: Running commands as srvadm
		2011-08-13 17:57:46 db_build: Build (prod)lpr_prod
		2011-08-13 17:57:46 db_build: Running commands as srvadm
		2011-08-13 17:57:47 db_build: Constructing logical LeasePak database - SQL portion...
		2011-08-13 17:57:53 db_set_dbo: Start
		2011-08-13 17:57:56 db_set_dbo: Changing DBO of (prod)lpr_prod to lpr_prod ...
		2011-08-13 17:57:56 db_set_dbo: End
		2011-08-13 17:57:56 db_build: End
		2011-08-13 17:57:56 db_load_obj: Load logical database objects in (prod)lpr_prod
		2011-08-13 17:57:56 db_load_obj: Running commands as DBO, lpr_prod
		Xmap: tbl(mcml) tbl(mcmu) tbl(mja) tbl(mjc) tbl(mjl) tbl(mlt) tbl(msg)
		Xmap: tbl(msvb) tbl(msvc) tbl(msvh) tbl(msvi) tbl(msvl) tbl(msvr) tbl(msvs)
		Xmap: tbl(msvu) tbl(msvv)...
		...
		Xmap: idx(mja) idx(mjc) idx(mjl) idx(mlt) idx(msg) idx(msvb) idx(msvc)
		Xmap:  idx(msvh) idx(msvi) idx(msvl) idx(msvr) idx(msvs) idx(msvu) idx(msvv)
		Xmap: idx(mwa) idx(mwc)...
		...
		Xmap: idx(rzp) idx(rzq) idx(rzu)
		2011-08-13 18:01:24 db_load_obj: Loaded nnn object scripts into (prod)lpr_prod
		2011-08-13 18:01:24 db_load_obj: End
		2011-08-13 18:01:24 db_load_code: Load SQL code in lpr_prod for prod
		2011-08-13 18:01:24 db_load_code: Running commands as DBO, lpr_prod
		2011-08-13 18:01:24 db_load_code: Creating ordered list of files to load ...
		2011-08-13 18:01:25 db_load_code: Creating alphabetical list of up* code objects ...
		2011-08-13 18:01:25 db_load_code: Creating alphabetical list of authorized cp* code objects ...
		2011-08-13 18:01:25 db_load_code: Replacing authorized cp* objects with user-provided versions .
		2011-08-13 18:01:25 db_load_code: Creating alphabetical list of main procedures to be loaded ...
		2011-08-13 18:01:25 db_load_code: Creating final list(s) of procedures to be loaded ...
		2011-08-13 18:01:25 db_load_code: Rebuilding views ...
		2011-08-13 18:01:32 db_load_code: Loading SQL Code Objects ...
		Xproc: aacompare(dates) lessee(add_remove) alt(cussum) ar(dtl) chk(upd) mjc(convert) mp(davox)
		Xproc: rase(dbaconv_ras) dbaconv(rsc) related(del_app) upd(drawdown_clnt) ext(ela_asset)
		  ext(ela_codes) hist(ela)
		...
		Xproc: upd(allowed) update(passwd) xml(lsesum) mt(mcml) mt(mcmu) mt(mja) mt(mjc)
		Xproc: mt(mjl) mt(rad) mt(raf) mt(rag) mt(rai) mt(ral) mt(rap)
		Xproc: mt(rvd) mt(rxr) mt(rxu) mt(rzg) alt(lsesum) cp(altlsepayinfo) asset(dtl)
		Xproc: asset(sum) col(lsesum) cus(leases) cus(lsesum) mat(lsesum) rap(der) rec(lsesum)
		Xproc: rfw(notes) rgc(info) susp(info)
		2011-08-13 18:13:00 db_load_code: Loaded nnn source files into (prod)lpr_prod
		2011-08-13 18:13:01 db_load_code: End
		2011-08-13 18:13:01 db_set_security: Set db security in (prod)lpr_prod
		2011-08-13 18:13:01 db_set_security: Running commands as lpr_prod
		2011-08-13 18:13:01 db_set_security: Setting general db security in (prod)lpr_prod
		2011-08-13 18:13:16 db_set_security: End
		2011-08-13 18:13:16 db_create: End
						

Below is the initial part of a run of db_create under Oracle. It shows how db_create will prompt for the DBO's password a second time if the DBO is new, plus it shows how the selection of the storage segment appears under Oracle. In this case a dedicated storage segment has been provided. After the selection of the storage segment, the process continues in a manner similar to that of Sybase. The full output of db_create under Oracle can be seen by clicking here.

	[nsdba77a:~]  db_create prod
	2011-08-13 23:06:09 db_create: Create (prod)lpr_prod
	2011-08-13 23:06:09 db_create: Running commands as srvadm

	Server Administrator 'srvadm' password: srvadm's password

	Logical database owner 'OWNER' password: database owner's password
	2011-08-13 23:06:23 db_get_dbo: Start
	2011-08-13 23:06:23 db_get_dbo: Running commands as srvadm

	Retype password to confirm; leave blank to restart password selection ...
	Confirming Database Owner 'OWNER' password: database owner's password

	2011-08-13 23:06:34 db_setup_phys: Set up physical storage description for (prod)lpr_prod

	Storage segments with available space:
		  LPCOMMON                                LPT_PROD

	[<RET>/Q/q]=quit  [R/r]=redisplay list  [V/v]=view physdb.msirc
	Enter Segment name from list above: LPT_PROD
	Enter # MBs required from segment: UNLIMITED
	Current contents of physdb.msirc:
	setenv  MSIDB_SEG01     "LPT_PROD,UNLIMITED"

	2011-08-13 23:07:01 db_setup_phys: New physical configuration of (prod)lpr_prod stored in
	  $ENVDIR/etc/physdb.msirc
						

db_restore

Top Overview Setup_new_env Db_create Db_restore

Loading Data into a LeasePak Logical Database

Topics

  • Environments
    • Administrative environment
    • Production environment
    • test environment
    • visitor environment
    • host environment
    • setup_new_env
  • LLDB
    • LLDB properties
      • database type
      • database system
      • database server
    • NetSol utility script
      • db_create
  • Hosts
    • application host
  • Builds
  • LeasePak
    • NetSol Technologies North America
    • NetSol Help Desk
    • Release Directories
      • $datasets
      • $udsets
  • General
    • pathname
      • absolute pathname
    • shell
      • command prompt
    • SQL
  • Users and Roles
    • System Administrator
    • LeasePak administrative users
      • $NSTDBA
        • LeasePak database administrator
      • $SRVADM
        • Database server administrator
      • $DBOWNER
        • $SYB_AUTODBO SETUP option
  • password
Use db_restore to copy the LeasePak data stored in a dataset into an LLDB; it destroys any previous data contained in the LLDB.
db_restore may only be run by $NSTDBA, the LeasePak database administrator. It requires that the operator know the password for the DBO of the LLDB, which was assigned when the LLDB was created by db_create; it requires that the database server for the db-type selected when the environment was created using setup_new_env be up and running and capable of executing interactive SQL commands; it does not require the services of the Queue Manager.
As with most LeasePak db_* commands that affect a particular LLDB, db_restore determines the appropriate LLDB to use via the environment created by setup_new_env.
The db_restore command may only be run in production and test environments; visitor environments are not allowed to perform data-destroying tasks on the LLDBs they point to. The original, or host environment, given when the visitor environment was created, must be used for performing data-destroying tasks such as db_restore.

Common Usage

The following is the most common example of using db_restore:

db_restore [flags] env-name dataset-name [-p proc-count]

where

  • '[flags]' are optional;
    • '-a' causes the dataset data to be appended to the existing table data, rather than replacing it.
    • '-s' (Oracle only) causes the detailed Sql*Loader output for each table to be placed in the log.
  • env-name is the environment containing the LLDB that is to be (re)loaded with data from the dataset
  • dataset is the name of a directory containing a snapshot exported from an LLDB using the db_snapshot command; typically the entire LeasePak logical database (LLDB) content is present in the dataset, and must be one of:
    • a standard Netsol-provided dataset, seed or level7, found in the current build's dsets directory ($udsets).
    • a locally produced dataset found in the release $datasets directory.
    • dataset at an arbitrary location on the application host, provided that the dataset parameter is the absolute pathname of a directory containing the files of a compatible dataset.
    • dataset constructed by the site users, consisting of optionally actual table snapshots, partial table snapshots produced by db_snapshot '-q', and/or manufactured files compatible with the bcp format and with the intended LeasePak tables.
  • [-p proc-count], where proc-count is an integer from 1 to 15, which determines the number of concurrent processes that will be used to move the data from the dataset into the LLDB. This parameter is optional; if omitted, the number of concurrent processes defaults to 4, as if -p 4 had been typed on the command line. Values greater than 4 are intended for loading large or very large datasets.
  • [-t|-x "tables"], where "tables" is a space-separated list of LeasePak table names to be loaded (-t ooption) or excluded (-x option). These two options cannot be used together. If omitted, db_restore will load the entire dataset.
  • Other Inputs
    • db_restore will require that the operator enter the DBO's password when prompted. This password was assigned to the DBO when the LLDB was built using db_create.
    • See the full syntax of db_restore here.
ENHANCEMENT IN V65A+

In Leasepak Release version 6.5a, an enhancement to db_restore was made that allows db_restore to import multi-segmented snapshot files into a single table in the LLDB.

Oracle LLDBs

In Oracle, db_snapshot creates segmented bcp files if the size of the exported data exceeds 2,000,000,000 bytes. Each such bcp file is guaranteed to be less than 2GB in length; if the amount of data warrants it, multiple bcp files are created; each file name is suffixed with a period plus an incrementing sequence number. This behavior is historical.

When restoring using db_restore, the operator had to concatenate these nultiple segments into a single .bcp file, and remove the segmented files.

In Oracle, this enhancement now allows the files in the dataset to start off suffixed with their segment numbers, and db_restore will still load them all into the LLDB in order of their segment numbers, as if they had been concatenated.

In Oracle, when using the '-t' "table list" option, the dataset file sequence numbers, if any, must start counting at ".1". If not using the '-t' option, files for tables not being excluded will be restored regardless of the presence or absence of the segment number extension, or its value.

Sybase LLDBs

In Sybase, the db_snapshot utility never created segmented bcp files, and never anticipated them. However, it is sometimes useful to have data for a single table in multiple files.

When restoring using db_restore, the operator had to concatenate these nultiple segments into a single .bcp file, and remove the segmented files.

In Sybase, this enhancement now performs this concatenation of segmented snapshot files automatically, replacing the individual files with a single bcp file. If maintaining the distinct files is important, then the client is advised to make a back-up copy of the dataset before using it with db_restore.

CHANGE IN COMMAND USAGE

In v66a an enhancement to the LeasePak schema caused one input option flag of db_restore to become obsolete.

This option was '-i' (inhibit population of certain m-tables when empty, which was performed by updating the source r-tables to cause triggers to fire). Because these m-tables were replaced by equivalent views, the tables were removed from version 6.6a.

db_restore Worksheet

Note the following values for running db_restore
Name Description Your Value Notes
env-name environment name Must have been previously created using setup_new_env, and must contain a valid LLDB created using db_create.
'-a'
'-s'
append to tables
include Sql*Loader log
These flags are optional and not often used.
dataset dataset name Must be a dataset directory in $udsets or datasets or the absolute pathname of a directory on the application host that contains a compatible dataset.
'-p proc-count' # of concurrent processes optional parameter; if given must be '-p 1' to '-p 15', default is '-p 4'
'-t "tables"'
'-x "tables"'
list of tables to include
list of tables to exclude
optional parameters; they are mutually exclusive; with neither parameter, default is to include all tables.
DBO's password LLDB owner's password db_restore will prompt for this. This password was assigned when the LLDB was created using db_create

Running db_restore

Log on the application host as $NSTDBA, the LeasePak database administrator.

Either run db_restore with the common usage described above, or click here to view the full usage message.
[nsdba77a:~]  db_restore prod level7 -p 10

The command will produce a display similar to the screen print below. Enter the DBO's password when prompted. For brevity we have deleted several lines (shown by "...") from this screen print; the full output of db_restore can be seen by clicking here.

  [nsdba77a:~] db_restore prod level7 -p 10
2011-08-21 15:27:57 db_restore: Load dataset level7 into database (prod)lpr_prod
* * * Current contents of all tables in database (prod)lpr_prod will be deleted. * * *
2011-08-21 15:27:57 db_restore: Running DBMS commands as Database owner: lpr_prod
2011-08-21 15:27:57 db_restore: Running Unix commands as user: nsdba77a
Database owner 'lpr_prod' password: database owner's password
2011-08-21 15:28:02 db_restore: Truncating all tables in database (prod)lpr_prod...
2011-08-21 15:28:18 db_restore: Deleting data directory contents in environment prod...
2011-08-21 15:28:18 db_restore: Turning ON fast bcp option...
2011-08-21 15:28:22 db_restore: Distributing bcp files into 10 portions...
2011-08-21 15:28:26 db_restore: Loading bcp files into database (prod)lpr_prod...
2011-08-21 15:28:26 db_restore: Loading rcc in group #1 ...
2011-08-21 15:28:26 db_restore: Loading rtx in group #2 ...
2011-08-21 15:28:26 db_restore: Loading rzga in group #3 ...
2011-08-21 15:28:26 db_restore: Loading req in group #4 ...
2011-08-21 15:28:26 db_restore: Loading rglc in group #5 ...
2011-08-21 15:28:26 db_restore: Loading rtr in group #8 ...
2011-08-21 15:28:26 db_restore: Loading rls in group #7 ...
2011-08-21 15:28:26 db_restore: Loading rcr in group #6 ...
2011-08-21 15:28:26 db_restore: Loading rtd in group #9 ...
2011-08-21 15:28:26 db_restore: Loading msg in group #10 ...
2011-08-21 15:28:27 db_restore: Loading rlsa in group #3 ...
2011-08-21 15:28:27 db_restore: Loading rpr in group #10 ...
2011-08-21 15:28:27 db_restore: Loading rlo in group #6 ...
2011-08-21 15:28:27 db_restore: Loading res in group #9 ...
2011-08-21 15:28:27 db_restore: Loading rst in group #2 ...
2011-08-21 15:28:27 db_restore: Loading reqa in group #7 ...
2011-08-21 15:28:27 db_restore: Loading rtp in group #1 ...
2011-08-21 15:28:27 db_restore: Loading rha in group #5 ...
2011-08-21 15:28:27 db_restore: Loading rsc in group #4 ...
2011-08-21 15:28:27 db_restore: Loading rhab in group #10 ...
...
2011-08-21 15:28:33 db_restore: Loading rpf in group #8 ...
2011-08-21 15:28:33 db_restore: Loading rbl in group #7 ...
2011-08-21 15:28:33 db_restore: Loading msvs in group #6 ...
2011-08-21 15:28:34 db_restore: Loading raps in group #9 ...
2011-08-21 15:28:34 db_restore: Loading rapr in group #10 ...
2011-08-21 15:28:34 db_restore: Loading rcga in group #4 ...
Portion 6 done Fri Aug 21 15:28:34 PDT 2011
2011-08-21 15:28:34 db_restore: Loading rcgf in group #2 ...
2011-08-21 15:28:34 db_restore: Loading mwc in group #3 ...
2011-08-21 15:28:34 db_restore: Loading msvu in group #5 ...
2011-08-21 15:28:34 db_restore: Loading rep in group #8 ...
2011-08-21 15:28:34 db_restore: Loading msvi in group #9 ...
2011-08-21 15:28:34 db_restore: Loading msvh in group #10 ...
2011-08-21 15:28:34 db_restore: Loading rlss in group #1 ...
Portion 5 done Fri Aug 21 15:28:34 PDT 2011
2011-08-21 15:28:34 db_restore: Loading msvr in group #7 ...
Portion 9 done Fri Aug 21 15:28:34 PDT 2011
Portion 10 done Fri Aug 21 15:28:34 PDT 2011
2011-08-21 15:28:34 db_restore: Loading msvv in group #4 ...
2011-08-21 15:28:34 db_restore: Loading mjc in group #3 ...
2011-08-21 15:28:34 db_restore: Loading rac in group #2 ...
Portion 7 done Fri Aug 21 15:28:35 PDT 2011
2011-08-21 15:28:34 db_restore: Loading rcgg in group #1 ...
2011-08-21 15:28:34 db_restore: Loading rbk in group #8 ...
Portion 4 done Fri Aug 21 15:28:35 PDT 2011
Portion 3 done Fri Aug 21 15:28:35 PDT 2011
2011-08-21 15:28:35 db_restore: Loading msvb in group #2 ...
2011-08-21 15:28:35 db_restore: Loading msvl in group #8 ...
2011-08-21 15:28:35 db_restore: Loading rai in group #1 ...
Portion 8 done Fri Aug 21 15:28:35 PDT 2011
Portion 2 done Fri Aug 21 15:28:35 PDT 2011
2011-08-21 15:28:35 db_restore: Loading msvc in group #1 ...
Portion 1 done Fri Aug 21 15:28:35 PDT 2011
2011-08-21 15:28:39 db_restore: Fast bcp option has been turned off.
2011-08-21 15:28:39 db_restore: Initializing mxd table in database (prod)lpr_prod...
2011-08-21 15:28:40 db_update_statistics: Update statistics for all tables in database
  (prod)lpr_prod
2011-08-21 15:28:40 db_update_statistics: Running commands as database owner: lpr_prod
2011-08-21 15:29:03 db_update_statistics: End
2011-08-21 15:29:03 db_restore: End
Load complete; check /opt/nst/v62a/log/prod.log for any errors
						

Top Overview Setup_new_env Db_create Db_restore