Database Setup
Reality provides various ways for you to automatically set up a database:
- You can create a Proc to be run when you create or update a database.
- You can create a Proc to be run whenever you start up a database (that is, when the database daemons or services are started).
- You can create a host script to be run when the system daemons or services are started.
Create/Update Proc
Whenever you create a new database or update an existing one, a Proc is run to configure the database. This runs a second Proc called CUSTOM-SETUP from the file SITE-PL in the SYSPROG account, into which you can place your own configuration commands.
Database Start-up Proc
The database configuration parameter DbStart allows you to specify that a system Proc should be run whenever you start up a database. This Proc resets any despooler records that have been left in an inconsistent state, clears the USER.LOG file and marks any 'active' PH-HISTORY items as 'killed'. The system Proc also runs second Proc called DBSTART from the file SITE-PL in the SYSPROG account, into which you can place your own configuration commands. A template containing typical commands can be found in the item DBSTART.TEMPLATE of the file SYSPROG-PL (SYSPROG account).
When your DBSTART Proc is called, the primary input buffer will contain the following information for you to make use of:
Input buffer parameter |
Description |
---|---|
%1 - %9 |
Scratch/work parameters. |
%10 |
R - restart of database daemon. |
%11 |
C - clean database start. |
%12 |
P - parallel execution with other processes. |
%13 |
Failsafe status:
|
%14 |
0/1 - User is/isn't the database owner. |
%15 |
0/1 - database type is file-store/partition. |
%16 |
Machine type is:
|
%17 |
Today's date in the default format. |
%18 |
Today's date yymmdd - useful with time for unique file/item-ids. |
%19 |
Time hh:mm. |
%20 |
Time hhmm. |
%21 |
Total number of real and pseudo ports. |