Constraints script
Posted in 2004
The poster wanted a dbschema-like tool that emits ALL constraints and indexes (including primary keys) as separate ALTER TABLE / CREATE INDEX statements rather than inline in CREATE TABLE. Suggestions included BMC's DB-Basics and, chiefly, Art Kagel's 'myschema' from the utils2_ak package in the IIUG Software Repository, which writes CREATE DDL to one file and index/constraint DDL to a second. After compiling it he hit a runtime 'libifsql.so: open failed' error; replies explained this was a shared-library path issue (set LD_LIBRARY_PATH/SHLIB_PATH to include $INFORMIXDIR/lib and $INFORMIXDIR/lib/esql, use symlinks, esql -static, or -R flags). He later reported myschema compiled and worked well.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Server Administration
Hi there, I want to know if it's possible to use something like DBSCHEMA or some other program to generate me a schema (like the one DBSCHEMA does), that will give me ALL the constraints as separate commands. The schema file that DBSCHEMA creates only have certain ALTER TABLE ..... or CREATE INDEX ....... constraints at the bottom of the schema file, and most of the primary key constraints are part of the table declarations. I need ALL the constraints and indexes (including PRIMARY KEYS) as a separate ALTER TABLE / CREATE INDEX ....... command. Does someone know of any tool/script that can generate me something like this. Thanx, Marius Erasmus DBA / UNIX Admin * (012) 470-1306 * 082 5522 848 * 082 131 5522 848 " Never interrupt your enemy when he is making a mistake!! "
Marius, Yes, there is a very good tool from BMC software called DB-basics. Get that tool and you will love it ! Hope this helps. Ravi Thero. "Erasmus, Marius" <MErasmus@ejustice.pwv.gov.za> wrote: Hi there, I want to know if it's possible to use something like DBSCHEMA or some other program to generate me a schema (like the one DBSCHEMA does), that will give me ALL the constraints as separate commands. The schema file that DBSCHEMA creates only have certain ALTER TABLE ..... or CREATE INDEX ....... constraints at the bottom of the schema file, and most of the primary key constraints are part of the table declarations. I need ALL the constraints and indexes (including PRIMARY KEYS) as a separate ALTER TABLE / CREATE INDEX ....... command. Does someone know of any tool/script that can generate me something like this. Thanx, Marius Erasmus DBA / UNIX Admin * (012) 470-1306 * 082 5522 848 * 082 131 5522 848 " Never interrupt your enemy when he is making a mistake!! " --------------------------------- Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
No, but I'll write one for you. cheers j. ----- Original Message ----- From: "Ravi T " <ravit29@yahoo.com> To: <ids@iiug.org> Sent: Wednesday, January 21, 2004 5:55 AM Subject: Re: Constraints script [2467] > Marius, > > Yes, there is a very good tool from BMC software called DB-basics. Get that tool and you will love it ! > > Hope this helps. > > Ravi Thero. > > "Erasmus, Marius" <MErasmus@ejustice.pwv.gov.za> wrote: > Hi there, > > I want to know if it's possible to use something like DBSCHEMA or some other > program to generate me a schema (like the one DBSCHEMA does), that will give > me ALL the constraints as separate commands. > The schema file that DBSCHEMA creates only have certain ALTER TABLE ..... or > CREATE INDEX ....... constraints at the bottom of the schema file, and most > of the primary key constraints are part of the table declarations. > > I need ALL the constraints and indexes (including PRIMARY KEYS) as a > separate ALTER TABLE / CREATE INDEX ....... command. > > Does someone know of any tool/script that can generate me something like > this. > > Thanx, > > > Marius Erasmus > DBA / UNIX Admin > > * (012) 470-1306 > * 082 5522 848 > * 082 131 5522 848 > > > " Never interrupt your enemy when he is making a mistake!! " > > > > > --------------------------------- > Do you Yahoo!? > Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes > >
Hi,
Thanx for the reply....
After struggling very much to compile, and eventually succeeding, I got the
following message when executing myschema from the command line.
The PATH is set to include the directory where libifsql.so resides.
ld.so.1: myschema: fatal: libifsql.so: open failed: No such file or
directory
Killed
What can be wrong
Marius.
-----Original Message-----
From: ART KAGEL, BLOOMBERG/ 65E 55TH [mailto:KAGEL@bloomberg.net]
Sent: 21 January 2004 03:55 PM
To: Erasmus, Marius
Subject: Re: Constraints script [2465]
Yes. My dbschema replacement utility, myschema, works in just this way, and
if
you present two filename on the commandline myschema will write the CREATE
DDL
to the first file and all CREATE INDEX and ALTER TABLE ADD CONSTRAINT DDL
commands to the second file. Myschema is a complete replacement for
dbschemawith the sole exception of the -hd option and also contains many
enhancements
and improvements to dbschema and avoids several of dbschema's problems.
Myschema supports all Informix database engines (though support for 8.xx
features has not been completely tested). Myschema is included in the
package
utils2_ak available for download from the IIUG Software Repository. (If you
decide to use myschema look for an update soon containing enhanced schema
support for the SMI pseudo-tables in sysmaster.)
Art S. Kagel
----- Original Message -----
From: Marius Erasmus <MErasmus@ejustice.pwv.gov.za>
At: 1/21 4:44
> Hi there,
>
> I want to know if it's possible to use something like DBSCHEMA or some
other
> program to generate me a schema (like the one DBSCHEMA does), that will
give
> me ALL the constraints as separate commands.
> The schema file that DBSCHEMA creates only have certain ALTER TABLE .....
or
> CREATE INDEX ....... constraints at the bottom of the schema file, and
most
> of the primary key constraints are part of the table declarations.
>
> I need ALL the constraints and indexes (including PRIMARY KEYS) as a
> separate ALTER TABLE / CREATE INDEX ....... command.
>
> Does someone know of any tool/script that can generate me something like
> this.
>
> Thanx,
>
>
> Marius Erasmus
> DBA / UNIX Admin
>
> * (012) 470-1306
> * 082 5522 848
> * 082 131 5522 848
>
>
> " Never interrupt your enemy when he is making a mistake!! "
you may define the variable LD_LIBRARY_PATH
this variable must be set whit the path where the library exists
or
create a link in th directory /usr/lib/libifsql.so to point
to$INFORMIXDIR/lib/libifsql.so
the best options is define the variable (
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INFORMIXDIR/lib;)
example of link: ln -s /usr/lib/libifsql.so
/export/home/informix/lib/libifsql.so
this is for unix
I hope this help you, and excuse mi english
wrote: Jorge Garcia
Quintana Roo, Mexico
----- Original Message -----
From: "Erasmus, Marius" <MErasmus@ejustice.pwv.gov.za>
To: <ids@iiug.org>
Sent: Thursday, January 22, 2004 1:35 AM
Subject: RE: Constraints script [2470]
> Hi,
>
> Thanx for the reply....
>
> After struggling very much to compile, and eventually succeeding, I got
the
> following message when executing myschema from the command line.
> The PATH is set to include the directory where libifsql.so resides.
>
> ld.so.1: myschema: fatal: libifsql.so: open failed: No such file or
> directory
> Killed
>
> What can be wrong
>
> Marius.
>
> -----Original Message-----
> From: ART KAGEL, BLOOMBERG/ 65E 55TH [mailto:KAGEL@bloomberg.net]
> Sent: 21 January 2004 03:55 PM
> To: Erasmus, Marius
> Subject: Re: Constraints script [2465]
>
> Yes. My dbschema replacement utility, myschema, works in just this way,
and
> if
> you present two filename on the commandline myschema will write the CREATE
> DDL
> to the first file and all CREATE INDEX and ALTER TABLE ADD CONSTRAINT DDL
> commands to the second file. Myschema is a complete replacement for
> dbschema> with the sole exception of the -hd option and also contains many
> enhancements
> and improvements to dbschema and avoids several of dbschema's problems.
> Myschema supports all Informix database engines (though support for 8.xx
> features has not been completely tested). Myschema is included in the
> package
> utils2_ak available for download from the IIUG Software Repository. (If
you
>
> decide to use myschema look for an update soon containing enhanced schema
> support for the SMI pseudo-tables in sysmaster.)
>
> Art S. Kagel
>
> ----- Original Message -----
> From: Marius Erasmus <MErasmus@ejustice.pwv.gov.za>
> At: 1/21 4:44
>
> > Hi there,
> >
> > I want to know if it's possible to use something like DBSCHEMA or some
> other
> > program to generate me a schema (like the one DBSCHEMA does), that will
> give
> > me ALL the constraints as separate commands.
> > The schema file that DBSCHEMA creates only have certain ALTER TABLE
.....
> or
> > CREATE INDEX ....... constraints at the bottom of the schema file, and
> most
> > of the primary key constraints are part of the table declarations.
> >
> > I need ALL the constraints and indexes (including PRIMARY KEYS) as a
> > separate ALTER TABLE / CREATE INDEX ....... command.
> >
> > Does someone know of any tool/script that can generate me something like
> > this.
> >
> > Thanx,
> >
> >
> > Marius Erasmus
> > DBA / UNIX Admin
> >
> > * (012) 470-1306
> > * 082 5522 848
> > * 082 131 5522 848
> >
> >
> > " Never interrupt your enemy when he is making a mistake!! "
>
>
>
--0__=08BBE4B0DFF0A8098f9e8a93df938690918c08BBE4B0DFF0A809
Content-type: multipart/alternative;
Boundary="1__=08BBE4B0DFF0A8098f9e8a93df938690918c08BBE4B0DFF0A809"
--1__=08BBE4B0DFF0A8098f9e8a93df938690918c08BBE4B0DFF0A809
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: quoted-printable
You've not got your Informix environment set properly? Specifically, y=
our
LD_LIBRARY_PATH (or moral equivalent - SHLIB_PATH or LIB_PATH, for exam=
ple)
is not set to include $INFORMIXDIR/lib and $INFORMIXDIR/lib/esql (you n=
eed
both). Or you did not manage to link statically. Or you did not manag=
e to
arrange for absolute pathnames for the shared libraries. Or ...
"esql -static ..." does a static link.
On some platforms (Solaris, Linux), using "esql -R$INFORMIXDIR/lib
-R$INFORMIXDIR/lib/esql ..." ensures that libraries are found even when=
LD_LIBRARY_PATH is not set.
Alternatively, you have to generate the list of CSDK libraries, convert=
them to absolute pathnames, and list the absolute pathnames on the comm=
and
line. It's a good idea to list them in the correct order, but you only=
need to list any given library once.
--
Jonathan Leffler (jleffler@us.ibm.com)
STSM, Informix Database Engineering, IBM Data Management
4100 Bohannon Drive, Menlo Park, CA 94025
Tel: +1 650-926-6921 Tie-Line: 630-6921
"I don't suffer from insanity; I enjoy every minute of it!"
|---------+------------------------------>
| | "Erasmus, Marius" |
| | <MErasmus@ejustice.|
| | pwv.gov.za> |
| | Sent by: |
| | forum.subscriber@ii|
| | ug.org |
| | |
| | |
| | 01/21/2004 11:35 PM|
|---------+------------------------------>
>--------------------------------------------------------------------=
-----------------------------------------------------------------------=
--|
| =
=
|
| To: ids@iiug.org =
=
|
| cc: =
=
|
| Subject: RE: Constraints script [2470] =
=
|
>--------------------------------------------------------------------=
-----------------------------------------------------------------------=
--|
Hi,
Thanx for the reply....
After struggling very much to compile, and eventually succeeding, I got=
the
following message when executing myschema from the command line.
The PATH is set to include the directory where libifsql.so resides.
ld.so.1: myschema: fatal: libifsql.so: open failed: No such file or
directory
Killed
What can be wrong
Marius.
-----Original Message-----
From: ART KAGEL, BLOOMBERG/ 65E 55TH [mailto:KAGEL@bloomberg.net]
Sent: 21 January 2004 03:55 PM
To: Erasmus, Marius
Subject: Re: Constraints script [2465]
Yes. My dbschema replacement utility, myschema, works in just this way=
,
and
if
you present two filename on the commandline myschema will write the CRE=
ATE
DDL
to the first file and all CREATE INDEX and ALTER TABLE ADD CONSTRAINT D=
DL
commands to the second file. Myschema is a complete replacement for
dbschemawith the sole exception of the -hd option and also contains many
enhancements
and improvements to dbschema and avoids several of dbschema's problems.=
Myschema supports all Informix database engines (though support for 8.x=
x
features has not been completely tested). Myschema is included in the
package
utils2_ak available for download from the IIUG Software Repository. (I=
f
you
decide to use myschema look for an update soon containing enhanced sche=
ma
support for the SMI pseudo-tables in sysmaster.)
Art S. Kagel
----- Original Message -----
From: Marius Erasmus <MErasmus@ejustice.pwv.gov.za>
At: 1/21 4:44
> Hi there,
>
> I want to know if it's possible to use something like DBSCHEMA or som=
e
other
> program to generate me a schema (like the one DBSCHEMA does), that wi=
ll
give
> me ALL the constraints as separate commands.
> The schema file that DBSCHEMA creates only have certain ALTER TABLE .=
....
or
> CREATE INDEX ....... constraints at the bottom of the schema file, an=
d
most
> of the primary key constraints are part of the table declarations.
>
> I need ALL the constraints and indexes (including PRIMARY KEYS) as a
> separate ALTER TABLE / CREATE INDEX ....... command.
>
> Does someone know of any tool/script that can generate me something l=
ike
> this.
>
> Thanx,
>
>
> Marius Erasmus
> DBA / UNIX Admin
>
> * (012) 470-1306
> * 082 5522 848
> * 082 131 5522 848
>
>
> " Never interrupt your enemy when he is making a mistake!! "
=
--1__=08BBE4B0DFF0A8098f9e8a93df938690918c08BBE4B0DFF0A809
Content-type: text/html; charset=US-ASCII
Content-Disposition: inline
Content-transfer-encoding: quoted-printable
<html><body>
<p>You've not got your Informix environment set properly? Specifically=
, your LD_LIBRARY_PATH (or moral equivalent - SHLIB_PATH or LIB_PATH, f=
or example) is not set to include $INFORMIXDIR/lib and $INFORMIXDIR/lib=
/esql (you need both). Or you did not manage to link statically. Or y=
ou did not manage to arrange for absolute pathnames for the shared libr=
aries. Or ...<br>
<br>
"esql -static ..." does a static link.<br>
<br>
On some platforms (Solaris, Linux), using "esql -R$INFORMIXDIR/lib=
-R$INFORMIXDIR/lib/esql ..." ensures that libraries are found eve=
n when LD_LIBRARY_PATH is not set.<br>
<br>
Alternatively, you have to generate the list of CSDK libraries, convert=
them to absolute pathnames, and list the absolute pathnames on the com=
mand line. It's a good idea to list them in the correct order, but you=
only need to list any given library once.<br>
<br>
--<br>
Jonathan Leffler (jleffler@us.ibm.com)<br>
STSM, Informix Database Engineering, IBM Data Management<br>
4100 Bohannon Drive, Menlo Park, CA 94025<br>
Tel: +1 650-926-6921 Tie-Line: 630-6921<br>
"I don't suffer from insanity; I enjoy every minute of it!&q=
uot;<br>
<br>
<br>
<img src=3D"cid:10__=3D08BBE4B0DFF0A8098f9e8a93df938@us.ibm.com" width=3D=
"16" height=3D"16" alt=3D"Inactive hide details for "Erasmus, Mari=
us" <MErasmus@ejustice.pwv.gov.za>">"Erasmus, Marius&qu=
ot; <MErasmus@ejustice.pwv.gov.za><br>
<br>
<br>
<table V5DOTBL=3Dtrue width=3D"100%" border=3D"0" cellspacing=3D"0" cel=
lpadding=3D"0">
<tr valign=3D"top"><td width=3D"1%"><img src=3D"cid:20__=3D08BBE4B0DFF0=
A8098f9e8a93df938@us.ibm.com" border=3D"0" height=3D"1" width=3D"72" al=
t=3D""><br>
</td><td style=3D"background-image:url(cid:30__=3D08BBE4B0DFF0A8098f9e8=
a93df938@us.ibm.com); background-repeat: no-repeat; " width=3D"1%"><img=
src=3D"cid:20__=3D08BBE4B0DFF0A8098f9e8a93df938@us.ibm.com" border=3D"=
0" height=3D"1" width=3D"225" alt=3D""><br>
<ul>
<ul>
<ul>
Hi,
I have compiled the myschema from ART KAGEL (utils2_ak) and it works very
well.
I can give you the copy I compiled, but I think it will only work if you are
using Informix (9.21) on Sun Solaris (7).
Let me know.......
Marius.
-----Original Message-----
From: pamadeo@info.unlp.edu.ar [mailto:pamadeo@info.unlp.edu.ar]
Sent: 26 January 2004 05:19 PM
To: Erasmus, Marius
Subject: RE: Constraints script [2470]
Hi, do you have this scripts? Because, if is possible, I'd like a copy of
them.
Thanks and sorry for my english.
Paola
Buenos Aires. Argentina.
Mensaje citado por "Erasmus, Marius" <MErasmus@ejustice.pwv.gov.za>:
> Hi,
>
> Thanx for the reply....
>
> After struggling very much to compile, and eventually succeeding, I got
the
> following message when executing myschema from the command line.
> The PATH is set to include the directory where libifsql.so resides.
>
> ld.so.1: myschema: fatal: libifsql.so: open failed: No such file or
> directory
> Killed
>
> What can be wrong
>
> Marius.
>
> -----Original Message-----
> From: ART KAGEL, BLOOMBERG/ 65E 55TH [mailto:KAGEL@bloomberg.net]
> Sent: 21 January 2004 03:55 PM
> To: Erasmus, Marius
> Subject: Re: Constraints script [2465]
>
> Yes. My dbschema replacement utility, myschema, works in just this way,
and
> if
> you present two filename on the commandline myschema will write the CREATE
> DDL
> to the first file and all CREATE INDEX and ALTER TABLE ADD CONSTRAINT DDL
> commands to the second file. Myschema is a complete replacement for
> dbschema> with the sole exception of the -hd option and also contains many
> enhancements
> and improvements to dbschema and avoids several of dbschema's problems.
> Myschema supports all Informix database engines (though support for 8.xx
> features has not been completely tested). Myschema is included in the
> package
> utils2_ak available for download from the IIUG Software Repository. (If
you
>
> decide to use myschema look for an update soon containing enhanced schema
> support for the SMI pseudo-tables in sysmaster.)
>
> Art S. Kagel
>
> ----- Original Message -----
> From: Marius Erasmus <MErasmus@ejustice.pwv.gov.za>
> At: 1/21 4:44
>
> > Hi there,
> >
> > I want to know if it's possible to use something like DBSCHEMA or some
> other
> > program to generate me a schema (like the one DBSCHEMA does), that will
> give
> > me ALL the constraints as separate commands.
> > The schema file that DBSCHEMA creates only have certain ALTER TABLE
.....
> or
> > CREATE INDEX ....... constraints at the bottom of the schema file, and
> most
> > of the primary key constraints are part of the table declarations.
> >
> > I need ALL the constraints and indexes (including PRIMARY KEYS) as a
> > separate ALTER TABLE / CREATE INDEX ....... command.
> >
> > Does someone know of any tool/script that can generate me something like
> > this.
> >
> > Thanx,
> >
> >
> > Marius Erasmus
> > DBA / UNIX Admin
> >
> > * (012) 470-1306
> > * 082 5522 848
> > * 082 131 5522 848
> >
> >
> > " Never interrupt your enemy when he is making a mistake!! "
>
>
>
-------------------------------------------------
This mail sent through IMP: http://mail.info.unlp.edu.ar/