When required, BCHANGE automatically The tasks of BCHANGE when restructuring a database are comparable to the tasks of BCREATE when creating a database. BCHANGE prepares the compiler database to accept the new schema. It carries out the following preliminary functions prior to restructuring:
It saves the old SIA in the DBDIR and prepares the DBDIR to accept a new SIA, so that a new and an old SIA are stored in the DBDIR after the BGSIA run for the new schema. BALTER needs both SIAs when adapting the stored data to the new schema so that it can recognize differences between the old and the new schemas.
Make sure therefore that there are enough free pages available in the DBDIR before the BCHANGE run or that automatic realm extension is possible by means of secondary allocation > 0.It deletes all user SSIAs in the DBDIR.
It saves the old DBCOM in the file dbname.DBCOM.O and reformats the DBCOM.
BALTER needs the schema information of the old and the new DBCOMs in order to examine the planned modifications.
It saves the old COSSD in the file dbname.COSSD.O.
After restructuring the DDL compiler needs the old COSSD to accept the subschemas. You should therefore delete the dbname.COSSD.O file only after you have compiled or accepted all the other subschemas which are still required.
Figure 27: System environment when preparing the compiler database
BCHANGE automatically stores the copies of DBCOM and COSSD on public disks. It is not necessary to issue a CREATE-FILE command to set up the two files (before BCHANGE is started) unless the copies are to be stored on private disks.
Depending on the size of the files it is, however, advisable to set them up using a CREATE-FILE command with SPACE operand - even if they are to be stored on public disks (see section “Maximum size of UDS/SQL files” in chapter "Files and realms of a UDS/SQL database").
When required, BCHANGE automatically extends the realms of the processed database. For details, please refer to the “Database Operation” manual, Automatic realm extension by means of utility routines.
At startup BCHANGE takes into account any assigned UDS/SQL pubset declaration (see the “Database Operation” manual, Pubset declaration job variable). Faulty assignment leads to the program aborting.
Command sequence for starting BCHANGE
It is assumed for the command sequence described here that UDS/SQL was installed with IMON (see section "START commands for the UDS/SQL programs").
The BCHANGE utility routine is started by the following commands in the identification under which the database is cataloged:
|
01,02 04 | See section "Setting up the compiler database". The specified version of BCHANGE is selected. |
05 | The UDS/SQL utility routine can also be started with the alias BCHANGE. |
There are no BCHANGE statements.