Further hints to the use of Ingres.
If you want Ingres to start automatically whenever Linux boots and stop when you shutdown or reboot the system, do the following:
Log in as root.
Check if your Linux variant has System V or BSD style init
(init
's man
page will tell that).
If your system conforms to System V, the /etc/rc.d/init.d
directory must
exist. Create a file there (call it ingres
or any other name you wish). The
file should contain at least the following:
#!/bin/sh case "$1" in start) echo "Starting Ingres" su - ingres -c "ingstart" ;; stop) echo "Stopping Ingres" su - ingres -c "ingstop" ;; *) echo "Usage: ingres {start|stop}" exit 1 ;; esac exit 0
Link the file as K01ingres
to these directories:
/etc/rc.d/rc0.d
/etc/rc.d/rc1.d
/etc/rc.d/rc2.d
/etc/rc.d/rc6.d
Also link it as S99ingres
to these directories:
/etc/rc.d/rc3.d
/etc/rc.d/rc4.d
/etc/rc.d/rc5.d
It is not important to call its links K01ingres
and S99ingres
, the point
is that the name starting with K should contain a small number (so that Ingres
stops early when changing to a lower runlevel) and the name starting with S
should contain a large number (so that Ingres starts after everything else
has started). Naturally, the file names must not clash with names of existing
files.
If you have a BSD style init
, put the following lines into /etc/rc.d/rc.local
:
echo "Starting Ingres" su - ingres -c "ingstart"
This will start Ingres. (As a matter of fact, you can use /etc/rc.d/rc.local
even if you have a System V style init
.)
To stop Ingres automatically, create a file in /etc/shutdown.d
(call it,
say, ingres
) that contains the commands
echo "Stopping Ingres" su - ingres -c "ingstop"
No matter which type your system is, the files you create must be executable files, owned by root.
Naturally, if your system provides a utility for configuring programs to
start and stop automatically (such as chkconfig
in RedHat), use that if you
wish.
ingmenu
The easiest way to access an Ingres database (at least, for beginners)
is via the ingmenu
program. You can reach Ingres' forms-based utilities, by
which you can create, update and query tables, create, edit and run reports
and ABF or Vision applications, from ingmenu
. Its usage is:
ingmenu test
Test is the name of the database.
As the SDK doesn't include Ingres Net, in theory it is not possible for Ingres applications to access databases on different machines. However, there exists a method, not supported by CA, by which you can come around this problem.
Let us suppose your application runs on host ingdev and the database (called
test) you would like to update or query resides on host ingserv. Your first
task is to find out the port number of the appropriate DBMS server running
on ingserv. You can use ipm
for this purpose: start ipm
on ingserv and choose
option Server List. In the list of servers select one that is of type INGRES
and handles the test database (you have to see either test or ALL in column
Connecting to Databases). You find the port number of the DBMS server in the
first column. Let us suppose it is 1259.
On machine ingdev, set the shell variable II_DBMS_SERVER in the following way:
$ export II_DBMS_SERVER='ingserv::1259'
Run the command:
$ sql test
If it works, you have access to the test database on host ingserv.
This solution is applicable only if both machines are of the same architecture, the same operating system is running on both of them, the character set is the same in both Ingres installations and so on: I don't know the full list of necessary conditions. Therefore, I can't guarantee that this trick will work.
On the other hand, if you restart Ingres on host ingserv, the DBMS server
process will get a different TCP/IP port, therefore you probably have to automate
fetching the current port number to the application server. You can use the
show
command of the iinamu
utility for this purpose. The following line gives
the port number of the DBMS server if there is only one server running:
$ echo show | iinamu | grep INGRES | tr -s ' ' '\t' | cut -f4
The installation includes a sample application, created by ABF, the traditional
development tool of Ingres. You can load it with the abfdemo
command. Unfortunately,
the manuals of ABF and Vision can't be found either on the CD or on the CA
site.
An even greater problem is that under glibc 2.1 applications created by ABF or Vision can't be either compiled or run directly from the database. This problem will be solved in the next Ingres version. In the meantime, you can download the RedHat glibc 2.0 compatibility packages from the following URL's:
By default, these packages go to /usr/i386-glibc20-linux
. Change the first
line of $II_SYSTEM/ingres/files/abflnk.opt
to:
-L/usr/i386-glibc20-linux/lib -L/lib -L/usr/lib -L/usr/local/lib -L$II_SYSTEM/ingres/lib
In the users' shell change LD_LIBRARY_PATH:
LD_LIBRARY_PATH=/lib:/usr/lib:$II_SYSTEM/ingres/lib:/usr/i386-glibc20-linux/lib
The compatibility packages work perfectly in Caldera OpenLinux 2.2 as well. I haven't tested them in other distributions, though.
Previous Perl versions, version 4 included, made Ingres access possible via libraries known as ingperl. You can find information on ingperl at
http://www.contrib.andrew.cmu.edu/~lfm/ingperl.html
In Perl 5 a new, unified database interface, called Perl DBI, appeared. Its site is
http://www.symbolstone.org/technology/perl/DBI/index.html
You can download the Ingres module of DBI from that site.
I leave you with a few pointers to important Ingres sites:
Have fun!