|
|
Up and Running with ALLBASE/SQL: HP 3000 and HP 9000 Computer Systems > Chapter 6 Practice with ALLBASE/SQL Using PartsDBESetting 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:
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." Run SQLSetup by issuing the proper command for your system:
A menu like the one in Figure 3-1 appears on your screen (some details may differ on your system). Figure 6-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/iX). 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. 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:
When you return to the menu, choose 0 to exit. The following paragraphs describe an alternate method for setting up PartsDBE using setup scripts that are available on all systems. Use the following command to set up PartsDBE:
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. 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:
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:
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. 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):
The setup script created this directory for you. Next change into the hpsql directory, and do another listing:
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:
You should see the following list of files:
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. List the files in the current group and account. You should see the following:
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. |
|