Multiple Databases

Revised: April 2007

It is possible to have more than one ActionWare database on a single iSeries system. The database libraries are completely separate and may have the same layout or completely different layouts. They share the same authority code.

There are two ways to create additional databases.

1. A duplicate database library of an existing production database, complete with design and data.

2. A new database library from your distribution CD that initially contains our sample design and data. After creation you can create a brand new design, delete the sample data and load data of your own.

Once created, your new database library will be accessed by a separate command. You can update certain data areas within each database to have separate word processing folders and auxiliary libraries, if needed. The multiple databases can share the same subsystem and regeneration source library (if they are at the same version and level).

Our standard set of libraries are AW4 (the program library), AW4L (the database library) and AW4G (the regeneration library). A multiple database environment is defined as an environment having one AW4 library, multiple database libraries (AW4L and equivalents), and one AW4G for each set of database libraries on a particular version.

We use data areas to point (link) a database library to it's word processing folders, it's regeneration library, it's auxiliary libraries, the library which controls the subsystem running the monitor program (usually AW4), and other functions which normally do not require attention when creating an additional multiple database. It is important that these data areas be correctly defined. Instructions for setting up these data areas are detailed at the end of this document. Contact our Support Desk if you have questions regarding these values in your environment.


Multiple Database Instructions

Method A. CREATING AN EXACT DUPLICATE PRODUCTION LIBRARY

Overview

The principle of this operation is to create a new ActionWare database library that has the same files as the original database library. This means that you must have enough disk space in order to duplicate the entire library.

The instructions below will create the new library by saving the original database library and restoring it using a new library name. Our standard production library is AW4L and the new library name used in the example below is AW4D. You can choose any valid library name you like, but you must ensure that it is not the name of a library which already exists on your iSeries.

Instructions

Step 1. Create a save file: CRTSAVF FILE(QTEMP/xxx) TEXT('SAVE FILE FOR AW4L') (If you create the save file in QTEMP it will be deleted when you sign off your session.

Create it some other library if you do not want to delete it when you signoff.)

Step 2. Save library AW4L to the save file: SAVLIB LIB(AW4L) DEV(*SAVF) SAVF(QTEMP/xxx) <Enter>

Step 3. Restore the saved library using a new library name:
RSTLIB SAVLIB(AW4L) DEV(*SAVF) SAVF(QTEMP/xxx) RSTLIB(AW4D) <Enter> (runs for several minutes)

Confirm the above restore ended successfully (you should receive a message stating how many objects were restored and how many were not restored. You should have 0 objects not restored. Review the job log for further details.

Step 4. Add the libraries AW4D and AW4 to your library list: Enter commands:
ADDLIBLE AW4D <Enter>
ADDLIBLE LIB(AW4) POSITION(*AFTER AW4D) <Enter>

Step 5. Initialize the new database: Enter command:
INZDBL AW4D AW4L <Enter>

This step will create the commands used to access the new database and it's main menu.

Running this step also updates certain data areas vital to the new database. A prompt screen appears with 4 parameters containing defaults. Change the first two parameters to: AW4D and AW4Dm. Do not change the 3rd and 4th parameters. Press Enter. (runs for about 1 minute)

When finished a screen appears informing you the initialization is complete. Users can access this new database by keying command AW4D from any command line. This whole process can be repeated as many times as necessary.

Step 8. If this database was created for testing or training purposes you may wish to reduce the records to a reasonable count to save on disk space. To do this create a filter that leaves 150-500 records and use overlay to mass delete the rest.

NOTE: See the sections at the end of the document regarding DATA AREAS.

 

Method B. CREATING A NEW PRODUCTION LIBRARY

Overview

The principle of this operation is to create a new ActionWare database library by restoring library AW4L from the distribution CD to the new library on the iSeries. The new library name used in this example is AW4D. Once created this new database library will contain our sample design and sample records. Once created you should delete our sample records and create your own design.

Instructions

Step 1. Create the new database library by loading the ActionWare distribution CD into the drive and entering this command:
RSTLIB AW4L OPT01 RSTLIB(AW4D) <Enter> (runs for several minutes)


Step 2. Confirm the above restore ended successfully.
Then enter commands:
ADDLIBLE AW4D<Enter>
ADDLIBLE LIB(AW4) POSITION(*AFTER AW4D) <Enter>

Step 3. Enter command: INZDBL AW4D AW4L <Enter>

Step 4. A prompt screen appears with 4 parameters containing defaults. Change the first two parameters to: AW4D and AW4Dm. Do not change the 3rd and 4th parameters. Press Enter. (runs for about 1 minute)

Step 5. When finished a screen appears informing you the initialization is complete.

Step 6. The job is complete. Users can access this new database by keying command AW4D from any command line. This whole process can be repeated as many times as necessary. Step 7. You can delete our sample data by following the instructions located in this guide under deleting sample records.

 

Extended Instructions

 

COPY THE DATABASE LAYOUT

If you would like to copy the design layout from your current live database library, the instructions are as follows:

Step 1. Copy the design:
CPYF FROMFILE(AW4L/FIEL) TOFILE(AW4D/FIEL) MBROPT(*REPLACE) <ENTER>

Step 2. Perform a regeneration on your new database library using the Configuration Menu (from the ActionWare main menu) and Option 13 Full regeneration. Accept all prompts and Press Enter.

 

DATA AREAS

To update data areas go to the main ActionWare menu in your new database library.

Take Option 6 -Tools Menu, Press Enter.

Take Option 2 -Work with Data Areas, Press Enter.

 

WORD PROCESSING

If you have a requirement that your new database library, no matter how it was created, have separate OfficeVision/400 word processing folders:

The data areas to change are: CMPFLR and SHLFLR. CMPFLR is the base folder for documents created thru the word processing functions. Documents will be stored in a sub folder of the folder described here. The sub folder name will be the PID of the record from which word processing was accessed. SHLFLR is the folder where shell documents are stored. It is possible to share SHLFLR among databases without conflict since these documents are used to create the actual document that will be stored on line.

 

AUXILIARY LIBRARY

An auxiliary library is a library that is added to the library list above the database library. ActionWare supports up to ten auxillary libraries for each database library. These libraries are used to house your custom programs that run with ActionWare. If you have a requirement that your new database library, have separate auxiliary libraries, change data area LIBAUX. Update this data area with the name of the library housing your custom programs. This data area is 100 in length and allows entry of a library name starting in position 1, 11, 21 etc. You may enter up to ten library names.

 

REGENERATION LIBRARY

Multiple databases at the same version & level can share a regen library. The standard regen library is AW4G and the data area that points to it is LIBSRC. If you create a new database library from either above described method this data area will exist and have a value of AW4G. Should you decide to upgrade one of your multiple databases, it will need it's own regen library.

Prior to the upgrade you should:

Step 1. Create the new regen library by loading the ActionWare distribution CD into the drive and entering this command:

RSTLIB AW4G OPT01 RSTLIB(AW4Gxxx) <Enter> (runs for about 5 mins)

You could also create this new AW4G library by saving the installed AW4G to and restoring from a save file as outlined in method A above.

You can verify that your database library and it's regen library are at the same version level by displaying the data area AAVERSION. The version level is the value of this data area and each library contains the data area.

Step 2. From the Work with Data Areas menu, locate the data area LIBSRC and use option 2 to change the value from AW4G to AW4Gxxx. This will link the database and regen libraries.

You can now upgrade the new database and have regen capabilities.