  | 
»  | 
 | 
  
 | 
 | 
This task describes how to configure a DBEnvironment so you can
access your TurboIMAGE/XL database(s) with  ALLBASE/SQL. This is an optional task because the SET SQLDBE command can also create the DBEnvironment using defaults when the DBEnvironment does not exist.  
 Instead of using the commands as shown in the examples, you can use the IMAGE/SQL utility
to create your DBEnvironment.  When you run the IMAGE/SQL utility, it prompts you to
create the DBEnvironment. You should still
read through this section to see important information such as setting TIMEOUT
values. Getting Ready When all of the TurboIMAGE/XL databases to be attached to the DBEnvironment are created by the same
user in one group and account,
it is convenient to configure the DBEnvironment in this group and account. If this is not the case,
several other issues should be considered.
The following considerations apply if the TurboIMAGE/XL database to be attached exists
in a different group and/or account than the DBEnvironment: IMAGE/SQL supports standard MPE/iX security rules.
Make sure correct user, group, and account capabilities are in place when you
plan to access a TurboIMAGE/XL database from
a DBEnvironment in a different account than the database. Make sure maintenance words exist for
the DBEnvironment and all TurboIMAGE/XL databases
because IMAGE/SQL utility administrators often need to specify DBEnvironment and TurboIMAGE/XL
maintenance words if they are not the creator. Be sure to grant DBA authority to everyone who will be performing
IMAGE/SQL utility tasks
because IMAGE/SQL utility administrators need DBA authority to perform most IMAGE/SQL utility tasks. 
 Make sure the TurboIMAGE/XL database and the DBEnvironment have the same native language support
(NLS) defined for them. When a DBEnvironment is configured, two files are created: DBEFILE0 and DBELOG1.
IMAGE/SQL requires that these files be larger than the ALLBASE/SQL defaults.
Make sure these files are large enough to accommodate IMAGE/SQL, but
the maximum is 5000 pages for DBEFILE0 and 10000 pages for DBELOG1.
In the example below, a file size of 500 pages is used for each of these files, but you may
need to adjust these sizes depending on the size and number of TurboIMAGE/XL databases you plan
to attach. 
 Performing the Task Log on in the same group and account as the TurboIMAGE/XL database(s) and run ISQL to enter the statements interactively.   At the ISQL
prompt, enter the START DBE NEW statement.  For example, to configure a DBEnvironment named PartsDBE,
enter the following: 
   :RUN ISQL.PUB.SYS
   isql=> START DBE 'PartsDBE' MULTI NEW
   > MAXIMUM TIMEOUT = 2 MINUTES
   > DEFAULT TIMEOUT = MAXIMUM
   > DBEFILE0 DBEFILE DBEFILE0⇐ DBEFile0Definition
   > WITH PAGES = 500,         ⇐   .         .    
   > NAME = 'PartsF0',         ⇐   .         .    
   > LOG DBEFILE DBELOG1       ⇐DBELog0Definition
   > WITH PAGES = 500,         ⇐   .         .    
   > NAME = 'PartsLog';        ⇐   .         .    
   isql=> EXIT;
   :
  |  
 If you forget the semicolon, ISQL prompts you with a  right-angle
bracket (>).  At this prompt, enter a
semicolon and ISQL will execute the statement.
If you wish to terminate the command, enter //.
The MULTI parameter is necessary if you plan on a
multiuser IMAGE/SQL environment. The above command can also be done by the IMAGE/SQL utility. 
The difference is that
IMAGE/SQL utility automatically creates the DBEnvironment with a DBEFILE0 size of 5000 pages, log file size of 10000 pages, and other ALLBASE/SQL defaults. To avoid deadlock situations when there are more than two connections,
you should either set the MAXIMUM TIMEOUT and DEFAULT TIMEOUT options with the
START DBE NEW statement or change them with the SQLUtil ALTDBE command.
The ALTDBE command updates the parameters required for DBEnvironment startup.
The SQLUtil utility prompts you for necessary information.
Enter a carriage return to retain an old value. 
   :RUN SQLUTIL.PUB.SYS
   >>ALTDBE
   DBEnvironment Name: PartsDBE
   Maintenance Word:  MaintWd
   .
   .
   .  
   Maximum Timeout (opt): 10  SECONDS
   Default Timeout (opt): 5 SECONDS
   Authorize Once per Session (opt): ON
   Alter DBEnvironment Startup Parameters (y/n)? YES
   DBEnvironment startup parameters altered.
   >>EXIT
  |  
 To set a maintenance word for the newly configured DBEnvironment, use the
SETDBEMAINT command of SQLUtil, as
in the following example: 
   :RUN SQLUTIL.PUB.SYS
   >>SETDBEMAINT
   DBEnvironment Name: PartsDBE
   Current Maintenance Word:  Carriage Return
   New Maintenance Word:  usr
   Retype New Maintenance Word:  usr
   >>EXIT
  |  
 Once you have configured the
DBEnvironment, set a maintenance word for it, and set the timeout time, you are
ready to attach TurboIMAGE/XL databases to it.  This is explained in Task 2.
 
 Task Reference No information is given here about considerations that may be necessary when
configuring a DBEnvironment that contains  ALLBASE/SQL databases.   Consult the ALLBASE/SQL Database Administration Guide for
more guidance in this area.
 The following summaries of SQL statements will get you started.
You can use ISQL to invoke these statements interactively. The SQL START DBE NEW statement has the following syntax: START DBE    'DBEnvironmentName'   [MULTI]   NEW  [ DUAL LOG   BUFFER = (DataBuffPages,LogBuffPages)   LANG = LanguageName   TRANSACTION = MaxTransactions   MAXIMUM TIMEOUT = {  TimeoutValue  [ SECONDS 
                                                                     MINUTES ]  NONE  }   DEFAULT TIMEOUT = {  TimeoutValue  [ SECONDS   MINUTES ]  MAXIMUM  }   DBEFile0Definition   DBELogDefinition ]  |,...|  Refer to the example discussed earlier in this section for details of the syntax for
DBEFile0Definition and DBELogDefinition. When you issue the START DBE statement, a   fileset named IMAGESQL is
created. You can add up to 3000 pages to this fileset. These are the maximum pages for a DBEnvironment created by  IMAGE/SQL
as of version B.G2: - Log pages
 10000 pages
 - DBEFile
 5000 pages
 - SQL tables in fileset named IMAGESQL 
 3000 pages
 
 The SQL GRANT statement has the following syntax for granting DBA authority: GRANT  { CONNECT   DBA   RESOURCE }   TO   { DBEUserID   GroupName   ClassName }  [,...]  
 Use SQLUtil to set a DBEnvironment maintenance word. First access
SQLUtil, then use the SQLUtil SETDBEMAINT command to set a maintenance word.
The syntax for this command is as follows: 
   :RUN SQLUTIL.PUB.SYS
   >>SETDBEMAINT 
   DBEnvironment Name:  DBEnvironmentName
   Current Maintenance Word:  OldMaintenanceWord
   New Maintenance Word:  NewMaintenanceWord
   Retype New Maintenance Word:  NewMaintenanceWord
   >>EXIT
  |  
 When no current maintenance word
exists, enter a carriage return at the "Current Maintenance
Word:" prompt. 
  
 |