![]() |
![]() |
ALLBASE/SQL Database Administration Guide: HP 9000 Computer Systems > Chapter 4 DBEnvironment Configuration and Security![]() Using START DBE NEW |
|
Configuring a DBEnvironment begins with using the START DBE NEW statement, whether in interactive mode through ISQL, using ISQL command files. Refer to the ALLBASE/ISQL Reference Manual for more information on command files. START DBE NEW may be used only once for a given DBEnvironment:
If you try to execute a START DBE NEW statement for an existing DBEnvironment, ALLBASE/SQL returns an error. You must purge the existing DBEnvironment and the log files associated with it using SQLUtil before you can use START DBE NEW to create a DBEnvironment with the same name. The START DBE NEW statement allows you to supply startup parameters, which are used to set operating limits, such as the user mode and the number of log buffers, each time the DBEnvironment is started. The startup parameters are stored in a file called the DBECon file. If no startup parameters are specified, ALLBASE/SQL provides default values. Table 4-1 “DBECon Default Startup Parameters” shows the startup parameters that are stored in the DBECon file and their default values. Table 4-1 DBECon Default Startup Parameters
You can override all these parameters except DBECreator, maintenance word, autostart, archive mode, DDL Enabled, and Authorize Once per Session by specifying other values in the START DBE NEW statement. After the DBEnvironment has been configured, you can change some startup values using SQLUtil. See Table 7-1 “DBECon Parameters” in the "Maintenance" chapter for a description of each parameter, including how it can be changed. Your DBEnvironment may require startup parameters different from the default values supplied by ALLBASE/SQL. For example, you may want to create a multiuser DBEnvironment, or assign a more descriptive name to DBEFile0. The sample DBEnvironment was configured with the following statement:
Note that the ALLBASE/SQL defaults were used for the number of buffer pages. Figure 4-1 “The Sample DBEnvironment Immediately After Configuration” is a diagram of the PartsDBE DBEnvironment immediately after configuration. The DBECon file is expanded to show startup parameters and the log file directory. A newly configured DBEnvironment has the following elements:
Refer to the "Maintenance" chapter for additional information about the DBECon file parameters and how to change them. ALLBASE/SQL creates a log file when the DBEnvironment is configured. A log file can be from 250 to 524,287 pages. Each page is 512 bytes. You can set the size and name of the log file(s) using the LOG DBEFile option of the START DBE NEW statement:
If you do not specify a file name or log size, ALLBASE/SQL creates a log file with the default size of 250 pages and the default name of DBELOG1. In the above example, the name PartsLg1 was chosen for the sample DBEnvironment. Refer to the "Physical Design" chapter of this guide for guidelines on determining the size of the log file. Successful recovery requires a good copy of each log record. Since a log file is critical to the recovery procedure, ALLBASE/SQL provides dual logging which improves the probability of successful recovery by maintaining two log files. You must specify two log file names when you specify dual logging:
The SQLUtil SHOWLOG command will display two log file names when dual logging is in use. A hard crash on a device containing a log file is potentially very serious, since it reduces the chances of being able to recover the DBEnvironment. Whenever you use dual logging, you can safeguard against both log files being damaged by a hard crash by locating the two logs on separate disks. Use the SQLUtil MOVELOG command to move log files to different disks. If you cannot afford the time to reissue transactions in case a media failure corrupts your log file, use dual logging. When you use dual logging, keep in mind that disk space use is doubled and performance may be affected because the number of I/O operations is also doubled. You can specify two archive log files or two nonarchive files, but you cannot specify one of each with dual logging. Once you have configured a DBEnvironment, you can convert to archive logging in one of the following ways:
After you enable archive logging, you should add additional log files to permit log switching, log backup, and reuse of logs. The next section shows how to add log files; for complete information about managing logs, refer to the "Backup and Recovery" chapter.
Use the SQLUtil ADDLOG command to add additional log files to the DBEnvironment for either nonarchive or archive logging. The following example adds a second log file with 350 pages to the sample DBEnvironment NewDBE:
You can specify a native language parameter in creating a DBEnvironment. Use the LANG = LanguageName option in the START DBE NEW statement to specify a native language other than n-computer, as in the following example:
If you want to specify the name of the DBEnvironment in a native language, then the native language you specify in the LANG = clause must be covered by the same character set as the current language. In other cases, your current language can be different from that of the DBEnvironment. All processing--including comparisons and sorting—will take place in accordance with the language of the DBEnvironment, but prompts and messages will appear in the current language if the appropriate message catalog is available. Also, scanning of user input will be in the current language. See "Native Language Support" in Chapter 1 for information about specifying a native language as the current language. You can look at each of the elements created by the START DBE NEW statement. Use the HP-UX ll command to list all the files in the directory where your DBEnvironment resides. The DBEFiles, log files, and DBECon file will appear as user files owned by the user hpdb, with file permissions of 600:
Run SQLUtil from HP-UX or from ISQL to look at the startup parameters in the DBECon file, as in the following example:
The parameters are displayed as they appear in the DBECon file illustration in Table 4-1 “DBECon Default Startup Parameters”. For more information on SQLUtil, refer to the "DBA Tasks and Tools" chapter and the "SQLUtil" appendix. The system catalog is a set of tables and views owned by special users CATALOG and SYSTEM that describe the contents of a DBEnvironment. You must be connected to a DBEnvironment and have SELECT authority or DBA authority in order to query the SYSTEM views. Users without DBA authority can examine the CATALOG views to see information about the objects they own. As DBA, you can also grant or revoke SELECT authority on SYSTEM views. You can query the system catalog views to look at the initial DBEFileSet, DBEFile, and system views created when a DBEnvironment is configured. You can also monitor space requirements, user access, and performance, and generally keep track of what is in the DBEnvironment. Some of the information contained in the system catalog can also be examined with SQLMON, an online monitoring tool. SQLMON is described in the ALLBASE/SQL Performance and Monitoring Guidelines. A simple SELECT statement shows you all the system catalog views:
To look at the DBEFile0 DBEFile created at configuration time, query the SYSTEM.DBEFILE view using the following statement:
Note that the DBEFile name stored in the system catalog is the name given in the DBEFILE DBEFILE0 clause, and the FILE ID is the HP-UX file name given in the NAME clause of the START DBE NEW statement. Refer to the "System Catalog" chapter for a complete description of each view in the system catalog. Use the SQLUtil SHOWLOG command to display the characteristics of a newly configured log. For example:
For an explanation of each parameter, refer to the description of the SHOWLOG command in the "SQLUtil" appendix. See the "Backup and Recovery" chapter for a complete explanation of how logging operates in ALLBASE/SQL. |