How can I list the databases of an instance from Unix prompt
Posted in 1999
Topics: General Discussion
Hi all, I tried 'dbnames' command from Informix FAQ but now I would like to do that without using this command. I can query sysdatabase table of sysmaster database but sometime I stuck if the sysmaster is not in the instance. Does someone have another the way to list the databases in an instance? Thank you in advance for any help.... H.V
Try :
onstat -g dic | fgrep @ | cut -c42- | cut -d@ -f1 | sort -u
Works on 7.22UC3.
*IF* you are using SE ( which I doubt - but the other attached replies imply
this may be possible ) then
you need to list any directories called *.dbs ( I think - it's been a long
time ) that are under the DBPATH environment variable.
Regards
Howard
Huy Vu <huyv@usa.net> wrote in message
news:gxXM2.60986$Mb.26259803@newscontent-02.sprint.ca...
> Hi all,
>
> I tried 'dbnames' command from Informix FAQ but now I would like to do
that
> without using this command. I can query sysdatabase table of sysmaster
> database but sometime I stuck if the sysmaster is not in the instance.
>
> Does someone have another the way to list the databases in an instance?
>
> Thank you in advance for any help....
>
> H.V
>
>
I have tried the onstat command and it did not work. It will only list the
active databases (three out of nine databases) on one of our IDS servers. I
thought that <onstat -g dic> command is used to print dictionary cache
information.
Regards,
Fred Lee
fredlee@acm.org
Howard wrote:
> Try :
> onstat -g dic | fgrep @ | cut -c42- | cut -d@ -f1 | sort -u>
> Works on 7.22UC3.
>
> Regards
> Howard
>
>
Try the following (IDS only - ANY version)
oncheck -pe|fgrep systables|sort|awk -F: '$1 != prev {print $1;prev =
$1}'
Meaning...
obtain a tablespace report (oncheck -pe)
catch only the 'systables' lines
order those lines
print the DB names getting rid of repetitions
Regards
Paulo
Fred Lee wrote:
>
> I have tried the onstat command and it did not work. It will only list the
> active databases (three out of nine databases) on one of our IDS servers. I
> thought that <onstat -g dic> command is used to print dictionary cache
> information.
>
> Regards,
> Fred Lee
> fredlee@acm.org
>
> Howard wrote:
>
> > Try :
> > onstat -g dic | fgrep @ | cut -c42- | cut -d@ -f1 | sort -u> >
> > Works on 7.22UC3.
> >
> > Regards
> > Howard
> >
> >
--
____________________________________________________________
Paulo Silva mailto:psilva@informix.com
Consultant/Trainer phone : +351 1 412 89 40
Informix Software Portugal fax : +351 1 410 84 37
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Paulo Silva wrote:
>
> Try the following (IDS only - ANY version)
>
> oncheck -pe|fgrep systables|sort|awk -F: '$1 != prev {print $1;prev =
> $1}'>
> Meaning...
>
> obtain a tablespace report (oncheck -pe)
> catch only the 'systables' lines
> order those lines
> print the DB names getting rid of repetitions
>
> Regards
>
> Paulo
>
> Fred Lee wrote:
> >
> > I have tried the onstat command and it did not work. It will only list the
> > active databases (three out of nine databases) on one of our IDS servers. I
> > thought that <onstat -g dic> command is used to print dictionary cache
> > information.
> >
> > Regards,
> > Fred Lee
> > fredlee@acm.org
Get my listdb7.ec program from the IIUG Software Repository.
Listdb7.ec, which is part of the package utils2_ak, lists the databases
and optionally lists tables and extended information about databases
and tables like logging status, dbspace, owner, create date, NLS/GLS
status. You can also request info about specific database(s) or
table(s).
Answers questions like:
o What tables are in the dbspace named dbspace_3?
o What databases have a table named "fred"?
o What dbspace contains the system tables for database "flintstones"?
And more.