Overview
Data Access Language Server 1.4 supports connections to two databases: Oracle, and Informix, using one of three connection protocols: asynchronous via a serial connection, TCP/IP and ADSP. This document gives an overview of DAL under A/UX, describing what the server files are, how they relate to each other, and how each function is accomplished.
Installing DAL
Installation of DAL is straightforward. These examples use Oracle 7.0, but Informix is essentially the same process. First, it is important to install the database first and make sure it's running correctly before installing DAL. It is a common error for someone to try to install both the database and DAL at the same time and try to debug getting them running simultaneously, which is very difficult. By installing them a piece at a time, you make your life much easier.
This is a sample installation. To begin, insert the Oracle server floppy into the server and log on as root. Then create the directory to hold the server software (by default, /users/dal), then use tar to extract the files:
# cd /users (data the user types)
# mkdir dal (data the user types)
# cd dal (data the user types)
# tar xfv /dev/rfloppy0 (data the user types)
Once the files are copied over, you need to run DALinstall to complete the installation (Note in this case the user dalsys already exists in /etc/passwd. If it doesn't, it's created for you):
# DALinstall (data the user types)
- DAL Host Software Installation Script -
- dalsys user already exists -
- Setting file permissions -
- DAL adsp listener already configured -
===
- Configuring ORACLE -
| To install DAL demo data tables for ORACLE (after this install completes):
V Invoke sqlplus/sqldba as scott/tiger and enter the following command:
SQLprompt> @/users/dal/data/oracle_script;
ORACLE_HOME specifies where ORACLE is installed
Old setting: ORACLE_HOME=unknown
New setting: ORACLE_HOME=/users/oracle in oracle.cfg
ORACLE_SID selects the default ORACLE Instance to use
Old setting: ORACLE_SID=unknown
New setting: ORACLE_SID=SAMP in oracle.cfg
===
- Checking DAL environment settings -
New setting: DALDEFAULTDBMS=oracle in /etc/dalrc
DAL specifies where DAL is installed
Old setting: DAL=/users/dal
Set DALLOGGING to YES to enable logging to /tmp/dalXXXXXX.log
Old setting: DALLOGGING=NO
Set DALDEBUG to YES to send debug info to stderr(idal) or logfile
Old setting: DALDEBUG=NO
DALTEMPDIR specifies where DAL creates temporary work files
Old setting: DALTEMPDIR=/tmp
DALMESSAGES selects the default host message language to use
Old setting: DALMESSAGES=unknown
! Choose DALMESSAGES from the following: french italian us_english
>>Please supply a new value for DALMESSAGES (us_english): <return>
New setting: DALMESSAGES=us_english in /etc/dalrc
DALDEFAULTDBMS selects the default DBMS server to run
Old setting: DALDEFAULTDBMS=oracle
Set DALSERVERLOG to YES to enable ADSP listener logging
Old setting: DALSERVERLOG=NO
Set DALRESTARTADSP to YES to enable autorestart of DAL adsp listener at
boot
Old setting: DALRESTARTADSP=unknown
! Choose DALRESTARTADSP from the following: NO YES
>>Please supply a new value for DALRESTARTADSP (YES): <return>
New setting: DALRESTARTADSP=YES in /etc/dalrc
- Shutting down DAL adsp listener -
- Starting up DAL adsp listener -
DAL Server Version DBMS Version Networks
------------------ ------------------ ---------------------------
A/UX 1.4 ORACLE7 ORACLE 7.0.12.2.0 PktAsync, AppleTalk, TCP/IP
- Successful installation -
DAL Server files and their purpose
This is a listing of the files installed by DALinstall and their use. Most of the files DAL installs are in the /users/dal directory, but one file is created in /etc and three files are created in /usr/bin.
The file in /etc is:
# ls -l /etc | grep dal
-rw-r--r-- 1 dalsys dalsys 221 Oct 26 11:29 dalrc
This file sets up the standard configuration for DAL, and can be modified with the DAL command as will be seen below. A typical Oracle configuration would look like this:
DAL=/users/dal (location of the DAL files)
DALFILE="$DAL/dalprocs" (location of the host procedures)
DALLOGGING=NO (session logging, YES or NO)
DALDEBUG=NO (debugging, YES or NO)
DALTEMPDIR=/tmp (where temporary files go)
DALMESSAGES=us_english (which message file to use)
DALDEFAULTDBMS=oracle (default DBMS, oracle or
informix)
DALSERVERLOG=NO (server logging, YES or NO)
DALRESTARTADSP=YES (restart ADSP server on reboot)
DALDBMSLIST="oracle" (known DBMSes)
DALMSGLIST="french italian us_english" (known language files for errors)
The three files in /usr/bin are actually links to one another:
# cd /usr/bin
# dir | grep dalsys
-rwxr-xr-x 3 dalsys dalsys 216 Oct 26 11:29 DAL*
-rwxr-xr-x 3 dalsys dalsys 216 Oct 26 11:29 dalsvr*
-rwxr-xr-x 3 dalsys dalsys 216 Oct 26 11:29 idal*
DAL, dalsvr and idal all execute the same shell script:
#!/bin/sh
set -a
. /etc/dalrc
if [ X$1 = X-v -o X$1 = Xversions -o `basename $0` = DAL ] ; then
cd $DAL
. ./.dal.config
exit
fi
case `basename $0` in
idal) EXE=idal ;;
*) EXE="" ;;
esac
. $DAL/.dalsvr.run
What this script does is the following: it loads in the values in /etc/dalrc and then checks the parameters. If the dalsvr entry point was used, or if it was given the parameter -v or 'versions', then it responds by executing the file $DAL/.dal.config, a shell script which will output a listing of what is available for use with DAL:
medraut# dalsvr
DAL Server Version DBMS Version Networks
------------------ ------------------- ---------------------------
A/UX 1.4 ORACLE7 ORACLE 7.0.12.2.0 PktAsync, AppleTalk, TCP/IP
If it doesn't do that, it sets the environment variable EXE to either a null string (if the DAL command are executed) or 'idal' (if idal is executed), and then executes the file $DAL/.dalsvr.run. This starts either the DAL configuration program or the DAL server, depending on which entry point is used.
In /users/dal, we have these files:
medraut# ls -lRa
total 2454
-rwxr-xr-x 1 dalsys dalsys 216 Jun 18 01:41 .dal.cfg*
This is the shell script installed in /usr/bin.
-rwxr-xr-x 1 dalsys dalsys 9439 Sep 28 19:02 .dal.config*
This is the shell script executed as /usr/bin/DAL to do configuration.
-rwxr-xr-x 1 dalsys dalsys 10980 Sep 30 17:16 .dal.install*
This is the shell script executed by /users/dal/DALinstall or the "DAL install" command.
-rw-r--r-- 1 dalsys dalsys 1195 Jun 22 16:13 .dal.usage
A text file listing the commands for the DAL program. Listed by "DAL help".
-rwxr-xr-x 1 dalsys dalsys 6832 Jun 12 20:30 .dalprocs.cfg*
A text file storing the template for the /users/dal/dalprocs file. This is modified during installation for proper configuration..
-rwxr-xr-x 1 dalsys dalsys 203 Sep 30 13:53 .dalrc.cfg*
A text file storing the template for the /etc/dalrc file. This is modified during installation for proper configuration.
-rwxr-xr-x 1 dalsys dalsys 255 Jun 12 20:52 .dalsvr.cfg*
A text file storing the template for the /users/dal/.dalsvr.run file. This is modified during installation for proper configuration.
-rw-r--r-- 1 dalsys dalsys 253 Oct 26 11:29 .dalsvr.run
This is the shell script executed by idal to start the dal server.
-rwxr-xr-x 1 dalsys dalsys 495 Sep 22 17:39 .informix.cfg*
A text file storing the template for the /users/dal/informix.cfg file. This is modified during installation for proper configuration. (note: this is installed by the Oracle install floppy, but not used).
-rwxr-xr-x 1 dalsys dalsys 364 Jun 2 11:32 .oracle.cfg*
A text file storing the template for the /users/dal/oracle.cfg file. This is modified during installation for proper configuration.
-rwxr-xr-x 1 dalsys dalsys 27 Jun 9 18:41 DALinstall*
This shell script executes /users/dal/.dal.install.
-rw-r--r-- 1 dalsys dalsys 0 Oct 4 15:15 DiskCreationDate
A time stamp that documents what date/time the files on the install floppy were created.
-rw-r--r-- 1 dalsys dalsys 8394 Oct 5 11:30 README
The latest information on the release.
-rwxr-xr-x 1 dalsys dalsys 88476 Oct 1 17:07 dal_adsp*
The DAL 1.4 ADSP listener. This is restarted when the system boots from /etc/inittab using the line "dall:2:once:/usr/bin/DAL boot adsp", which should be added from the DALinstall command. Whether it is turned on or not is controlled by the DAL command.
-rwxr-xr-x 1 dalsys dalsys 220 Sep 22 18:08 dalbrd.sqlexec*
-rwxr-xr-x 1 dalsys dalsys 220 Sep 22 18:06 dalbrd.sqlturbo*
These two files are installed by the Oracle install floppy, which is a cosmetic bug in DAL 1.4. They are used to configure the Informix server for the different versions of Informix. They are not used with Oracle.
-rwxr-xr-x 1 dalsys dalsys 7369 Jun 24 01:12 dalprocs*
This is a text file containing the host-based DAL procedures. The commonly used ones are documented later.
-rw-r--r-- 1 dalsys dalsys 8318 Apr 16 1993 msg.french
-rw-r--r-- 1 dalsys dalsys 7980 Apr 16 1993 msg.italian
-rw-r--r-- 1 dalsys dalsys 6121 Apr 16 1993 msg.us_english
These files contain the error messages for the server and are set up for easy internationalization. Note that in DAL 1.4, neither the French or Italian files are actually internationalized, so using them won't give you any advantage. They are place holders so they can be modified as appropriate by the international subsidiaries.
-rwxr-xr-x 1 dalsys dalsys 367 Oct 26 11:29 oracle.cfg*
This file configures DAL so it can access the oracle DBMS without requiring the user's account to be configured for it.
-rwxr-xr-x 1 dalsys dalsys 1073072 Oct 5 16:06 oracle.dal*
The DAL database adapter for Oracle.
-rw-r--r-- 1 dalsys dalsys 919 Sep 27 16:10 usage
A short text file that explains installation for people who hate reading manuals.
The data/ sub directory holds the demo tables for Informix (which would be accessed with the "USE LOCATION /users/dal/data" clause), and the script needed to create the demo tables in Oracle. Since Oracle stores all data internal to it's database structures, there are no files stored here for that DBMS.
drwxr-xr-x 2 dalsys dalsys 512 Oct 26 11:28 data/
./data:
total 60
drwxr-xr-x 2 dalsys dalsys 512 Oct 26 11:28 ./
drwxr-xr-x 3 dalsys dalsys 1024 Oct 26 11:29 ../
-rw-r--r-- 1 dalsys dalsys 140 May 25 00:37 README.oracle
-rw-r--r-- 1 dalsys dalsys 27435 Aug 15 1991 oracle_script.sql
This is the end of the overview of DAL server files. The informix server is almost identical, the only changes being the added configuration scripts for the Online vs. SE database versions and the need for the separate demo tables (listed below).
Installing Oracle demo tables
This is an example of how to install Oracle demo tables. To install the demo table in Oracle, you need to log on to Oracle via the program sqldba (this assumes you are in an account configured to use Oracle. The easiest way to do this is log on to the system as user oracle).
% cd /users/dal/data
% sqldba
SQL*DBA: Release 7.0.12.2.0 - Production on Fri Oct 29 11:35:44 1993
Copyright (c) Oracle Corporation 1979, 1993. All rights reserved.
ORACLE7 Server Release 7.0.12.2.0 - Production
With the procedural and distributed options
PL/SQL Release 2.0.14.0.1 - Production
SQLDBA> connect
Username: scott
Password: tiger (note: not echoed!)
Connected.
SQLDBA> @oracle_script
set scan off
*
DBA-00110: illegal SET option
drop table orders
*
ORA-00942: table or view does not exist
Statement processed.
Statement processed.
1 row processed.
1 row processed.
[[many lines of output supressed]]
1 row processed.
1 row processed.
1 row processed.
Statement processed.
drop table ware_inv
*
ORA-00942: table or view does not exist
Statement processed.
Statement processed.
1 row processed.
1 row processed.
1 row processed.
1 row processed.
1 row processed.
1 row processed.
Statement processed.SQLDBA> exit
SQL*DBA complete.
Informix demo tables
When installing Informix, the following directory is installed, which contains the demo tables.
drwxrwxrwx 2 dalsys dalsys 1024 Oct 11 10:14 daldemo.dbs/
./data/daldemo.dbs:
-rw-rw-rw- 1 dalsys dalsys 8192 Apr 20 1993 custome100.dat
-rw-rw-rw- 1 dalsys dalsys 2048 Apr 20 1993 custome100.idx
-rw-rw-rw- 1 dalsys dalsys 1024 Apr 20 1993 offices103.dat
-rw-rw-rw- 1 dalsys dalsys 2048 Apr 20 1993 offices103.idx
-rw-rw-rw- 1 dalsys dalsys 3072 Apr 20 1993 orders_101.dat
-rw-rw-rw- 1 dalsys dalsys 2048 Apr 20 1993 orders_101.idx
-rw-rw-rw- 1 dalsys dalsys 2048 Apr 20 1993 staff__102.dat
-rw-rw-rw- 1 dalsys dalsys 2048 Apr 20 1993 staff__102.idx
-rw-rw-rw- 1 dalsys dalsys 2048 Apr 20 1993 store_i104.dat
-rw-rw-rw- 1 dalsys dalsys 2048 Apr 20 1993 store_i104.idx
-rw-rw-rw- 1 dalsys dalsys 3072 Apr 20 1993 stores_105.dat
-rw-rw-rw- 1 dalsys dalsys 2048 Apr 20 1993 stores_105.idx
-rw-rw-rw- 1 dalsys dalsys 0 Apr 20 1993 syscolauth.dat
-rw-rw-rw- 1 dalsys dalsys 4096 Apr 20 1993 syscolauth.idx
-rw-rw-rw- 1 dalsys dalsys 4096 Apr 20 1993 syscolumns.dat
-rw-rw-rw- 1 dalsys dalsys 6144 Apr 20 1993 syscolumns.idx
-rw-rw-rw- 1 dalsys dalsys 0 Apr 20 1993 sysconstra.dat
-rw-rw-rw- 1 dalsys dalsys 5120 Apr 20 1993 sysconstra.idx
-rw-rw-rw- 1 dalsys dalsys 0 Apr 20 1993 sysdepend.dat
-rw-rw-rw- 1 dalsys dalsys 4096 Apr 20 1993 sysdepend.idx
-rw-rw-rw- 1 dalsys dalsys 1024 Apr 20 1993 sysindexes.dat
-rw-rw-rw- 1 dalsys dalsys 4096 Apr 20 1993 sysindexes.idx
-rw-rw-rw- 1 dalsys dalsys 0 Apr 20 1993 syssynonym.dat
-rw-rw-rw- 1 dalsys dalsys 4096 Apr 20 1993 syssynonym.idx
-rw-rw-rw- 1 dalsys dalsys 0 Apr 20 1993 syssyntabl.dat
-rw-rw-rw- 1 dalsys dalsys 4096 Apr 20 1993 syssyntabl.idx
-rw-rw-rw- 1 dalsys dalsys 1024 Apr 20 1993 systabauth.dat
-rw-rw-rw- 1 dalsys dalsys 4096 Apr 20 1993 systabauth.idx
-rw-rw-rw- 1 dalsys dalsys 4096 Apr 20 1993 systables.dat
-rw-rw-rw- 1 dalsys dalsys 4096 Apr 20 1993 systables.idx
-rw-rw-rw- 1 dalsys dalsys 1024 Apr 20 1993 sysusers.dat
-rw-rw-rw- 1 dalsys dalsys 3072 Apr 20 1993 sysusers.idx
-rw-rw-rw- 1 dalsys dalsys 0 Apr 20 1993 sysviews.dat
-rw-rw-rw- 1 dalsys dalsys 3072 Apr 20 1993 sysviews.idx
-rw-rw-rw- 1 dalsys dalsys 1024 Apr 20 1993 ware_in106.dat
-rw-rw-rw- 1 dalsys dalsys 2048 Apr 20 1993 ware_in106.idx
-rw-rw-rw- 1 dalsys dalsys 1024 Apr 20 1993 warehou107.dat
-rw-rw-rw- 1 dalsys dalsys 2048 Apr 20 1993 warehou107.idx
Using DAL
The DAL command is used to configure the server and to look at its current status. A list of the commands supported by DAL are below, and can be printed with the "DAL ?" or "DAL help" commands:
medraut# DAL help
DAL utility usage:
DAL start [ adsp ] ( start the adsp listener)
DAL stop [ adsp ] ( stop the adsp listener)
DAL boot [ adsp ] ( only start the lstnr if DALRESTARTADSP=YES )
These three commands control the ADSP listener. Boot is equivalent to tart, but will only start the listener if it is configured to start on system reboot.
DAL sessions ( list the active DAL sessions )
Describes the current state of the server. This is an example of the output when the server is idle:
medraut# DAL sessions
- DAL adsp listener is running -
- No DAL sessions currently running -
This is an example of a server with one active session:
medraut# DAL
- DAL adsp listener is running -
- DAL sessions currently running:
chuq 6087 289 1 13:52:37 C1 0:00 /users/dal/oracle.dal idal
DAL config ( show all DAL config parameters )
This lists the contents of /etc/dalrc
DAL config dalrc ( edit all parameters in /etc/dalrc )
This command lets you change the contents of /etc/dalrc by prompting you for a new entry for each line (carriage return implies no change).
DAL config <informix|oracle|ingres> ( edit all parms for that dbms)
This command lets you change the contents of the appropriate configuration file for supported databases (/users/dal/oracle.cfg for oracle, /users/dal/informix.cfg for informix). Note that Ingres is not supported in DAL 1.4.
DAL config all ( edit all DAL parms in DBMSs and dalrc )
Allows you to configure everything about the server, prompting you as appropriate.
DAL versions ( show the versions of available DAL servers )
Lists the currently supported databases and their versions and configured network adapters. Equivalent to the "dalsvr" command.
DAL <log|lsn> ( run more on latest /tmp/dalxxx.log or .lsn )
( you must press 'q' to exit, space for more )
DAL purge <log|lsn> ( remove all but the latest log/lsn tmp files)
Prints and purges the .log (logging), .lsn (adsp listener logs) and .dbg (DAl debugging) logs. Note that "DAL dbg" and "DAL purge dbg" are also legal options.
DAL show <dal env. variable> ( show the current setting for that var )
Shows a specific variable in /etc/dalrc.
DAL DEFAULTDBMS=<dbms-name> ( make that dbms the default )
Allows you to change the default DBMS name.
DAL DALMESSAGES=<language-name>( make that msg language the default )
Allows you to change the language used for server error messages.
DAL <var>=<value> ( change any DAL environment variable )
DAL -e <var>=<value> ( explain each variable before prompting )
DAL -p <var>=<value> ( force a prompt even if value is already valid)
Allows you to change any specific variable in /etc/dalrc. The -e option outputs a description of what you're changing. The -p option forces DAL to prompt you for the changed value.
DAL install ... ( run the full DAL installer for reconfig )
The same as the DALinstall command.
Common Dalproc procedures
The file /users/dal/dalprocs contains host-based DAL procedures. It can be used to store commonly used and shared DAL functions. DAL 1.4 ships with a set of procedures in the dalprocs file. Some of them are of interest primarily as examples, but some have more general use. The ones you might want to use include:
dal_config: prints the DAL environment from inside idal, so you can see how
the server thinks it's configured.
op: opens the default DBMS and then opens the appropriate database so that
the demo tables are available.
oo: opens the Oracle DBMS and database as user scott (for demo table
access).
oinf: opens the Informix DBMS
closeall: closes all open databases and DBMSes.
tables: prints the name of all available tables.
columns(tablename): prints the columns for a given table.
exp: a quick validity test for the default database.
TCP/IP and Asynchronous connections
Under TCP/IP and Asynchronous connections, the DAL client logs onto the A/UX system like a normal user, and once it is connected to a shell, executes the command idal. TCP/IP makes the connection through the rexec daemon (the rsh function under BSD, the remsh function under System V), which does password checking. This assumes that the user has a valid account on the system and knows the password, and that idal is in the account's default $PATH.
A sample DAL Preferences entry for this is:
medraut:MacTCP:AUX:17.190.12.52
medraut:login::::3000:::
Medraut is the entry name (in this case, also the name of the machine), and 17.190.12.52 is the IP address for the machine. The client must have MacTCP installed for it to work.
ADSP
When connecting via ADSP, operation is very similar to TCP/IP. The ADSP listener replaces the rexec daemon and shell, doing the password validation and spawning the idal process. All server operations are handled by idal. When the user disconnects, idal exits and the network connection is closed.
A sample DAL Preferences entry for ADSP is:
medraut.a:atalk:Chuq's AUX box.De Anza 3/1st Floor