HP 3000 Manuals

Methods of Using the DBAPLUS Program [ DBChange Plus User's Guide ] MPE/iX 5.0 Documentation


DBChange Plus User's Guide

Methods of Using the DBAPLUS Program 

The DBAPLUS program can be invoked independently in either interactive or
batch mode.  Because the DBAPLUS program requires exclusive access to the
database, the method you choose depends on the number and/or type of
changes to be made.  Because batch mode can be set to run at times when
the database is not being accessed, this method is desirable when user
access to the database is important and/or when lengthy changes are
stored in the change file.  Use the DBAPLUS program interactively only if
the changes stored in the change file do not take long to perform, or if
user access to the database is not critical.

To perform a restructure, the following three methods are available:

   *   Initiating the DBAPLUS program interactively from within the
       DBCPLUS program by using a PERFORM COMMANDS.

   *   Creating a job file from within the DBCPLUS program by using a
       PERFORM COMMANDS to execute the DBAPLUS program.  Then exit the
       DBCPLUS program and stream the job.

   *   Exiting the DBCPLUS program and running the DBAPLUS program
       independently.

Each of these methods is explained on the following pages.

Initiating the DBAPLUS Program Interactively 

The DBAPLUS program can be invoked interactively to perform a restructure
from within the DBCPLUS program.  To invoke the DBAPLUS program this way,
do the following:

   1.  Run the DBCPLUS program (DBCPLUS).

   2.  Issue the BASE command to specify the database to be restructured.

   3.  Issue one or more DBCPLUS restructure commands.  Issue a PERFORM
       COMMANDS to immediately invoke the DBAPLUS program.  When you are
       asked if changes should be performed online or if a job stream
       file should be created, enter Y for yes.  The example below shows
       how to do this:

            >perform commands 

             PERFORM COMMANDS now or create job file [job/y/N]? y 

             Please wait ...
            HP36386 (A.00.00) DBALTER (c) COPYRIGHT Hewlett-Packard Co. 1985
            THU, JAN 18, 1990  7:15 AM

            Database has been modified since last DBSTORE (DBA 220).
            Continue [y/N]? y 

            HP36386 (A.00.00) DBCHANGE (c) COPYRIGHT Hewlett-Packard Co. 1985

Creating a DBAPLUS Job File from within the DBChange Program 

The DBAPLUS program can be invoked by creating a job file from within the
DBCPLUS program.  To invoke the DBAPLUS program this way, do the
following:

   1.  Run the DBCPLUS program (DBCPLUS).

   2.  Issue the BASE command to specify the database to be restructured.

   3.  Issue one or more DBChange restructure commands.

   4.  Issue PERFORM COMMANDS from within the DBCPLUS program and create
       a job stream.  When you enter PERFORM COMMANDS, include the JOB
       and PARM parameters.  After the job stream file is created, exit
       the DBCPLUS program.  When you are ready to stream the job, enter
       the job ( DatabaseNameJJ) at the MPE XL system prompt (:).  For
       example:

            >perform commands job 1 
             Please wait.....change file is being verified.

             New job stream file ORDERSJJ created.

            >exit 

            HP36386 (A.00.00) DBCHANGE  (c) COPYRIGHT Hewlett-Packard Co. 1985

            ******************* DBCHANGE STATISTICS***************************

                       Number of databases prepared for rename:       0
                       Number of databases prepared for restructure:  1
                       Number of databases prepared for erase :       0
                       Number of databases prepared for repack:       0
                       Number of databases prepared for check :       0
                       Number of databases prepared for fix   :       0

            :stream ordersjj 

For more information about PARM values, refer to "Using PARM Values"
later in this chapter.

Modifying the Job File.     

When instructed to do so, DBChange creates a job stream file for each
existing change file.  The name of this job stream file is the database
name with JJ appended ( DatabaseNameJJ). Use this job stream file to
perform a restructure in batch mode.  This job stream file does the
following:

   *   Sets a file equation for the change file.

   *   Sets DBSLIST to $NULL to suppress the listing of the new schema.

   *   Contains commands to purge the old version of the schema and to
       save the temporary file containing the new schema.  Note that
       these commands have been "commented out." To use them, alter the
       job stream file with a text editor.

   *   Contains TELL commands that report the beginning and the
       completion of the restructure.

You may need to make the following alterations to a job stream file:

   *   Add any necessary user, group, and/or account passwords.

   *   Alter the run-time parameter of the RUN DBALTER command.  (This
       parameter provides answers to questions DBAPLUS may ask.  Refer to
       Table 9-1 later in this chapter.)

   *   Remove the :comment** portion of the commands that save the
       temporary file containing the new schema.

The example below shows the unedited job stream file before editing
created by DBChange for the database ORDERS:

     :job JDBALTER,KELLY.FINANCE,DATABASE
     :comment***********************************************
     :comment*     This job will perform the actual
     :comment*     restructuring of the database by
     :comment*     calling DBALTER.
     :comment***********************************************
     :
     :tell   KELLY.FINANCE;   /-->Start JDBALTER for ORDERS
     :
     :file DBCHGF = ORDERSCF
     :file DBSLIST = $NULL
     :
     :comment***********************************************
     :comment*     DBALTER creates the new schema file as a
     :comment*     job temporary file.  To save it, purge the
     :comment*     old schema file before running DBALTER and
     :comment*     save the new schema file after DBALTER
     :comment*     completes.
     :comment***********************************************
     :comment*     :purge ORDERSSC
     :comment***********************************************
     :
     :comment*     verify that DBALTER parmvalue is correct
     :
     :run dbaplus; parm = 1
     :
     :comment***********************************************
     :comment*     :save ORDERSSC
     :comment***********************************************
     :
     :tell   KELLY.FINANCE;   /-->End JDBALTER for ORDERS
     :
     :eoj

In the example below, the ORDERS job stream file, ORDERSJJ, has been
edited to add passwords, to change the parameter of the RUN DBALTER
command, and to remove the "commented out" portions that save the new
schema file.

     :job JDBALTER,KELLY/USER.FINANCE/MGR,DATABASE/ALL
     :comment***********************************************
     :comment*     This job will perform the actual
     :comment*     restructuring of the database by
     :comment*     calling DBALTER.
     :comment***********************************************
     :
     :tell   KELLY.FINANCE;   /-->Start JDBALTER for ORDERS
     :
     :file DBCHGF = ORDERSCF
     :file DBSLIST = $NULL
     :
     :comment***********************************************
     :comment*     DBALTER creates the new schema file as a
     :comment*     job temporary file.  To save it, purge the
     :comment*     old schema file before running DBALTER and
     :comment*     save the new schema file after DBALTER
     :comment*     completes.
     :comment***********************************************
     :
     :purge ORDERSSC
     :
     :comment*     verify that DBALTER parmvalue is correct
     :
     :run dbaplus; parm = 15
     :
     :save ORDERSSC
     :
     :tell   KELLY.FINANCE;   /-->End JDBALTER for ORDERS
     :
     :eoj

Running the DBAPLUS Program Independently 

You can invoke the DBAPLUS program independent of the DBCPLUS program in
two ways, as follows:

   *   Issue a file equation for DBCHGF, the formal file designator for
       the change file.  Next, run the DBAPLUS program providing a parm
       value.  For example:

            :hello kelly.finance,database 
            :file dbchgf=orderscf 
            :run dbaplus.pub.sys;parm=1 

       The DBAPLUS program determines the database name from the name of
       the change file in the file equation.  This file equation is reset
       by the DBAPLUS program upon completion of the restructure.  Note
       that a run-time parameter, PARM=1, is included.  Use this
       parameter if you want to keep the change file.  For more
       information about PARM values, refer to "Using PARM Values" later
       in this chapter.

   *   Run the DBAPLUS program, but allow it to prompt you for the
       database name.  For example:

     :hello kelly.finance,database 
     :run dbaplus.pub.sys 

     HP36386 (A.00.00) DBALTER (c) COPYRIGHT Hewlett-Packard Co. 1985
     THU, JAN 18, 1990,  9:11 AM

     Which database? orders 

The DBAPLUS program determines the correct change file by reading the
database name.  Because no parameter is specified, the change file is
automatically purged upon completion of the restructure.



MPE/iX 5.0 Documentation