Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to list databases....

240 views
Skip to first unread message

Karl & Betty Schendel

unread,
Sep 1, 2003, 4:19:00 PM9/1/03
to info-...@ams.org
At 4:58 AM -0400 9/1/03, Ingres, yeah baby!! wrote:
>OK, suppose you need a list of databases on your Solaris
>host at system initialisation time (before Ingres startup).
>What is a neat (scripted?) way to do this, assuming that
>the list of databases is liable to change, and there are
>quite possibly multiple locations?

*Before* Ingres starts up?

You pretty much have to know the root locations. ingprenv II_DATABASE
will give you the default root location. If you've created databases
elsewhere with createdb -dlocation, you're just going to have to wire
them into your script.
ls $dataLocation/ingres/data/default should give you all of the
database names if you know all the data locations, and assuming that there
are no garbage directories that aren't databases.

(Actually, this is not quite true; you can define a relative location and
then I don't think it uses the data/default construct. I'm too lazy to
check at the moment. The old relative location thing is deprecated and
I'm not even sure you can do it any more.)

Depending on how dynamic the situation is, I might be tempted to put wrappers
around createdb and destroydb and track the database names via the
wrappers.

--
Karl R. Schendel, Jr.
K/B Computer Associates sche...@kbcomputer.com
Ingres, Unix, VMS

Michael Leo

unread,
Sep 1, 2003, 5:44:37 PM9/1/03
to Karl & Betty Schendel, info-...@ams.org

Karl,

It's Labor Day. Get a life.

Mikey

;-)

Karl & Betty Schendel

unread,
Sep 1, 2003, 7:18:15 PM9/1/03
to info-...@ams.org
At 4:08 PM -0500 9/1/03, Michael Leo wrote:
>At 03:54 PM 9/1/2003 -0400, Karl & Betty Schendel wrote:
>[snip]

>
>Karl,
>
>It's Labor Day. Get a life.
>
>Mikey
>
>;-)

I'm laboring. Isn't that what I'm supposed to be doing? :-)

Besides, it's raining and nasty, and even the dog refuses to go outside.
I think I'll go back to bed now.

Karl

Saurabh Bhatnagar

unread,
Sep 2, 2003, 1:48:45 AM9/2/03
to info-...@ams.org
I don't know why you would want to do this when Ingres is down (except
maybe in recovery situations) but you can almost always find a way.
In this case that would be -
strings $II_SYSTEM/ingres/data/default/iidbdb/aaaaaacj.t00
This also gives you the default data location that is normally
II_DATABASE but can be something else if specified during createdb.
Why this filename? Well I found that out using -
select file_name from iifile_info where table_name='iidatabase'\g
I hope this helps in whatever you are trying to do.
Take care,
Saurabh.

Mason, Paul

unread,
Sep 2, 2003, 4:24:18 AM9/2/03
to info-...@ams.org
> OK, suppose you need a list of databases on your Solaris
> host at system initialisation time (before Ingres startup).
> What is a neat (scripted?) way to do this, assuming that the
> list of databases is liable to change, and there are quite
> possibly multiple locations?
>

If ingres is down then I'd suggest

find / -name aaaaaaaa.cnf -print

Karl & Betty Schendel

unread,
Sep 2, 2003, 1:07:31 PM9/2/03
to info-...@ams.org
At 11:24 AM -0400 9/2/03, Ingres, yeah baby!! wrote:
>
>Let me explain a little. The Cunning Plan is to set up, on
>suitable Solaris systems with large memory, Ingres work locations
>on a tmpfs structure.
...

Ah.

Depending on how quickly users might get in, and how vocal they are,
and how "ok" it is to just error them out if they get in too fast, here
are my ideas:

1. The "oh well" way: prior to starting Ingres, you create work directories
for iidbdb. As soon as you get Ingres up, you select from iidatabase and
create the rest. Most of the time you'll do this faster than users can
get in, especially if you jigger the iirundbms shellscript to do it for
you.

2. The "mostly good enough" way: at convenient intervals (say via cron
job), you query iidatabase and write a file. You use the file to initialize
the work area prior to Ingres startup. You then finish up with #1, ie
as soon as you get Ingres up you check your work and fix anything you did
wrong. (and update your little file of database names.) For added
spice, you wrap ingstop in something that refreshes your list; thus the
list can only be wrong after a createdb/destroydb followed by a crash.

3. The "always works" way: you set your normal DBMS configuration startup
count(s) to zero in CBF. You also arrange for the name_service and
define_address parameters to both be OFF. (Or you have another dbms config
that is this way.)
At Ingres startup, you first create a work directory for iidbdb, then do an
ingstart which doesn't start any dbms's. You then do an ingstart -iidbms
or ingstart -iidbms=nonames (however you have cbf set up), and read the
II_DBMS_SERVER poop that comes out. You use it to define your local
II_DBMS_SERVER, query iidatabase, and create the remaining work dirs.
You then either a) register that server with the Name Server, or b)
stop that server and start up normal one(s) by hand.

No, I don't know any way to start up a DBMS in closed state. I've often
wanted such a thing.

If it were me doing it, I would probably go with #1 or #2. #3 sounds
way too much like work.

By the way, I am curious to learn how work areas on tmpfs
performs in the real world. Have you tried it yet in any sort of
limited environment?

--
Karl R. Schendel, Jr. sche...@kbcomputer.com
K/B Computer Associates www.kbcomputer.com
Ingres, Unix, VMS Consulting and Training

Saurabh Bhatnagar

unread,
Sep 4, 2003, 3:01:29 AM9/4/03
to info-...@ams.org
sche...@kbcomputer.com (Karl & Betty Schendel) wrote in message news:<p05210600bb7a721e1860@[192.168.1.8]>...

> At 11:24 AM -0400 9/2/03, Ingres, yeah baby!! wrote:
> No, I don't know any way to start up a DBMS in closed state. I've often
> wanted such a thing.
>

In addition to Karl's excellent comments, there may be a way to start
a DBMS server in closed state.
First you have to define what that means - that only the DBA can get
in and no other clients can. On most sites, the connections come in
through iigcc (NET server) so unless you start that you cannot
connect. This is one rudimentary way.
For a better solution, start the DBMS server and then deregister it
from IINAMU.
Use "show" to show what the INGRES dbms server is (for each class)
then delete that. Also, ingstart shows you the ids as it comes up.
Now only the DBA can connect by specifying the DBMS server in the SQL
command or using II_DBMS_SERVER. People will have to know that ID
before they can connect.
To open this to the clients, just re-register it.

- Saurabh

John Young

unread,
Sep 4, 2003, 3:29:54 AM9/4/03
to info-...@ams.org
Hi,

Ampther possible way to do this is to start the DBMS , then use iimonitor to
set the server's listent state to shut. Once finished just set the server's
listen state to open.

John
"Saurabh Bhatnagar" <Saurabh....@ca.com> wrote in message
news:6dad5e97.03090...@posting.google.com...

0 new messages