Object Type | File Naming Convention | Default Location | Custom Code Location |
---|---|---|---|
User-defined package | ora_upkg_*.sql | n/a | $ucql |
User-defined procedure | dbms_up_*.sql | n/a | $ucql |
Load sequence file | dbms_load_seq.txt | n/a | $ucql |
NetSol procedure | dbms_mp_*.sql | $usql | n/a |
NetSol package | ora_mpkg_*.sql | $usql | n/a |
NetSol trigger | dbms_mt_*.sql | $usql | n/a |
Custom procedure | dbms_cp_*.sql | $usql | $ucql |
All NetSol-provided SQL code is delivered in each LeasePak build in the build's sql
directory. Each supported DBMS has its own subdirectory under sql
, such as sql/ora
and sql/syb
.
LeasePak database environments, when first created, point via symbolic links to a particular build. Typically this build is the one designated as "live" (
$live
). The $live
build may be replaced from time to time by the installation of maintenance builds; environments constructed to point to the $live
build will then point to whichever build is currently designated as $live
. Within the environment, various directories are acutally symbolic links to various components of the referenced build. In particular, there is always an sql
link that links to the build's sql
subdirectory for that environment's particular DBMS. Therefore, a Sybase environment's sql
link points to the build's sql/syb
directory, and an Oracle environment's sql
link points to the build's sql/ora
directory.
Regardless of the DBMS used by an environment's logical LeasePak database, the link is named sql
and may always be referred to by the shell environment variable $usql
from processes configured to point to that environment.
During the installation of LeasePak, the installing user is asked to provide a custom code directory. By default, this is /opt/msi/cst
, though the user may locate this directory anywhere outside of the LeasePak release directory ($TOPDIR
). This directory must already exist at installation time and must be writable by the $MSIADMIN
user. The location of this directory is stored in the environment variable $CSTDIR
.
Upon installation of each build, either through the initial installation or subsequent maintenance builds, the build will, upon being linked as the $live
build, be brought online—that is, will be installed in the system in a fully usable way. This process was introduced in LeasePak 6.0a, and is centered around the concept of user-customizable code. When the build is brought online, a subdirectory in $CSTDIR
is created using the build's build sequence (e.g., $CSTDIR/6.00.1234
) and a symbolic link in the build directory is created pointing to this directory. This link is named cst
. Therefore, every build will have a link cst
pointing to the directory $CSTDIR/buildseq
. Also at this time, further subdirectories in $CSTDIR/buildseq
are created, cql
and prg
; cql
will have a subdirectory for each installed DBMS in the release: cql/syb
and/or cql/ora
. These directories are owned by $MSIADMIN:$MSIGROUP
and have 750 (-rwxr-x---) permissions.
It is into the cql
subdirectories that the end user must place all customized custom SQL code objects and all user SQL code objects. The load order file described above is also located here, and must be named dbms_load_seq.txt
. All files located in the cql
subdirectories must be named using the above described naming conventions and must be owned by $MSIADMIN:$MSIGROUP
with 440 (-r--r-----) permissions.
The user should never customize the dbms_cp_*.sql
files found in the build's sql
subdirectories. Instead, the end user should make copies of these delivered custom SQL code object files in the appropriate cql
subdirectory and perform customizations there.
When a LeasePak environment is created or upgraded, an environment subdirectory (really a symbolic link) named cql
will be created, pointing to the appropriate DBMS subdirectory within the $CSTDIR/buildseq/cql
directory. This link may be referred to using the shell environment variable $ucql
from any process configured to point to that environment. Through a special option to the setup_new_env script, a environment's $ucql
may be made to point to $usql
, effectively preventing any code object customizations from affecting the LeasePak database (LLDB) referenced by that particular environment.
Likewise, each environment will have another link named prg
, pointing to the $CSTDIR/buildseq/prg directory
. This directory is intended for user-customizable and user-provided programs and scripts which LeasePak will deliver or specify from time to time.
When db_load_code runs, it will gather lists of the file names for each of the defined SQL code object types. Using the list of dbms_cp_*.sql
filenames, obtained exclusively from the NetSol-delivered $usql
directory, the loader will check for an instance of each such file in the $ucql
directory. If the loader finds such a file in the $ucql
directory, then it will replace the pathname in the list with the pathname of the $ucql
version, allowing the end user's customized code to override the standard NetSol-delivered versions of the same code objects.
If $ucql
is empty, no end user code will be loaded into the LeasePak database.