Setting up PartsDBE [ Up and Running with ALLBASE/SQL ] MPE/iX 5.0 Documentation
Up and Running with ALLBASE/SQL
Setting up PartsDBE
Before beginning, change into the group and account or directory where
you want to create PartsDBE. Use an empty group or directory if possible.
Then choose one of the following two methods for setting up PartsDBE:
* Using SQLSetup.
* Using setup scripts.
SQLSetup is a sample database setup tool which simplifies the process of
installing PartsDBE in your work space. It is available on MPE XL 3.0
and later systems, and on HP-UX 7.08 and later systems. If you are using
a system prior to HP-UX 7.08 or MPE XL 3.0, use the setup procedure
described under "Using Setup Scripts."
Using SQLSetup
Run SQLSetup by issuing the proper command for your system:
HP-UX:
$ csh /usr/lib/allbase/hpsql/sqlsetup Return
MPE XL:
: SQLSETUP.SAMPLEDB.SYS Return
A menu like the one in Figure 3-1 appears on your screen (some details
may differ on your system).
________________________________________________________________________________
| |
| |
| Options for Setting Up ALLBASE/SQL Sample DBEnvironments |
| |
| =============================================================== |
| |
| Choose one: |
| |
| 1. Create PartsDBE without sample programs |
| 2. Create PartsDBE, copy, preprocess and compile sample programs |
| 3. Copy, preprocess and compile sample programs only |
| 4. Generate a schema for PartsDBE |
| 5. Display schema for PartsDBE |
| 6. Purge PartsDBE and sample programs |
| 7. Help |
| 0. Exit |
| |
| =============================================================== |
| |
| Enter your choice=> |
| |
________________________________________________________________________________
Figure 4-1. SQLSetup Menu
From this menu, you select an option to create a copy of PartsDBE in your
directory (HP-UX) or group and account (MPE XL). Before choosing an
option, examine each line on the menu. The first option simply creates a
copy of PartsDBE. The second option, in addition to creating PartsDBE,
copies a set of application programs into the current directory or group,
then preprocesses and compiles them. (This is time-consuming.)
Option 3 creates just the sample program set. Option 4 creates a schema
with SQLGEN. Option 5 displays the schema once it has been created.
Option 6 lets you purge the sample DBEnvironment and programs.
Choose the Help option to see more information about SQLSetup, or choose
0 to exit.
Creating PartsDBE.
Choose option 1 from the SQLSetup menu. This option runs a set of ISQL
command files that create the DBEnvironment, define all its tables,
views, indexes and security structure, and then load it with data.
As the system creates PartsDBE, you see several messages displayed. At
the end of the creation process, you see the following message:
Creation and Loading of PartsDBE is now complete!
When you return to the menu, choose 0 to exit.
Using Setup Scripts
The following paragraphs describe an alternate method for setting up
PartsDBE using setup scripts that are available on all systems.
HP-UX Systems.
Use the following command to set up PartsDBE:
$ /usr/lib/allbase/hpsql/setup 2 Return
You will see a display of messages showing the progress of the setup
script. A listing of setup appears in Appendix C of the ALLBASE/SQL
Reference Manual.
MPE XL Systems.
Use the command file CREASQL to stream a job that sets up PartsDBE.
First, copy the CREASQL stream file to your group and account with the
following command:
: FCOPY FROM=CREASQL.SAMPLEDB.SYS;TO=CREASQL;NEW Return
Using an editor, modify CREASQL to include your password(s), user name,
account name, and group name. Lines that need to be modified are shown
in inverse display. Keep the edited file, then type the following
command to create and load PartsDBE and copy the sample programs into
your group and account:
: STREAM CREASQL Return
You will see messages showing the progress of the setup script. A
listing of CREASQL appears in Appendix C of the ALLBASE/SQL Reference
Manual.
Looking at the Files Created for PartsDBE
HP-UX Systems.
Use the ls -l command to list the files in the current directory. You
should see the following (owner and group entries will be for your
system, and permissions will be those of your directories):
drwxrwxr-x 3 peter dbusers 1024 Dec 27 11:23 hpsql/
The setup script created this directory for you. Next change into the
hpsql directory, and do another listing:
-rw-rw-rw- 1 peter dbusers 19297 Dec 27 11:25 isqlout
drwxrwxrwx 2 peter dbusers 1024 Dec 27 11:24 sampledb/
The setup script also created the sampledb directory. The file isqlout
contains the messages generated when PartsDBE was created. Use the more
command to examine isqlout.
Finally, change into the sampledb directory, then examine the file
listing. You see some files with your user name as owner and others with
hpdb as owner. To see the database files alone, issue the following
command:
$ ls -l | grep hpdb Return
You should see the following list of files:
-rw------- 1 hpdb dbusers 204800 Dec 27 11:25 OrderDF1
-rw------- 1 hpdb dbusers 204800 Dec 27 11:25 OrderXF1
-rw------- 1 hpdb dbusers 512 Dec 27 11:25 PartsDBE
-rw------- 1 hpdb dbusers 614400 Dec 27 11:25 PartsF0
-rw------- 1 hpdb dbusers 131072 Dec 27 11:25 PartsLG1
-rw------- 1 hpdb dbusers 131072 Dec 27 11:25 PartsLG2
-rw------- 1 hpdb dbusers 204800 Dec 27 11:25 PurchDF1
-rw------- 1 hpdb dbusers 204800 Dec 27 11:25 PurchXF1
-rw------- 1 hpdb dbusers 204800 Dec 27 11:25 RecDF1
-rw------- 1 hpdb dbusers 204800 Dec 27 11:25 WarehDF1
-rw------- 1 hpdb dbusers 204800 Dec 27 11:25 WarehXF1
These files, all owned by hpdb, are the files for the PartsDBE
DBEnvironment. The other files in the directory are command files and
load files containing data that was loaded into PartsDBE.
For security reasons, database files are owned by hpdb, and the sampledb
directory also belongs to hpdb. This means that you cannot remove the
database files with the rm command unless you are the superuser. (You
can use SQLUtil, however, as shown later in this chapter.)
The programs directory is for use when you decide to copy, preprocess and
compile sample application programs.
MPE XL Systems.
List the files in the current group and account. You should see the
following:
ORDERDF1 PRIV 2048W FB 50 50 1 800 1 26
ORDERXF1 PRIV 2048W FB 50 50 1 800 1 26
PARTSDBE PRIV 256W FB 1161 1161 1 1920 30 *
PARTSF0 PRIV 2048W FB 150 150 1 2400 1 31
PARTSLG1 PRIV 256W FB 256 256 1 512 1 29
PARTSLG2 PRIV 256W FB 256 256 1 512 1 29
PURCHDF1 PRIV 2048W FB 50 50 1 800 1 26
PURCHXF1 PRIV 2048W FB 50 50 1 800 1 26
RECDF1 PRIV 2048W FB 50 50 1 800 1 26
WAREHDF1 PRIV 2048W FB 50 50 1 800 1 26
WAREHXF1 PRIV 2048W FB 50 50 1 800 1 26
These are all PRIV files, which means that you cannot purge them without
special system authority. (However, you can use SQLUtil, as shown later
in this chapter.)
Additional files used for loading the sample database tables are found in
SAMPLEDB.SYS.
MPE/iX 5.0 Documentation