Serial Values after dbimport
Posted in 1999
Topics: Migration, Import/Export & Data Conversion
After a dbexport/dbimport (7.24) all my serial column
values get reset back to 1. Why? Is there an easy
way to reset the next serial values back to where they
should be without doing it one table at a time?
Edit your SQL import file, and at each of the "serial" column enties,
you can specify the starting number. Sorry, I can't remember the
syntax, but it's in the manual.
MoJo Risin
--
In article <3819d962.98580260@client.ce.news.psi.net>,
larsen@qec.com (Jeff Larsen) wrote:
> After a dbexport/dbimport (7.24) all my serial column
> values get reset back to 1. Why? Is there an easy
> way to reset the next serial values back to where they
> should be without doing it one table at a time?
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
I was hoping for something more graceful. Why isn't the
engine smart enough to do this itself!!!! Anyone else
got any ideas?
mojo_risin@my-deja.com wrote:
>Edit your SQL import file, and at each of the "serial" column enties,
>you can specify the starting number. Sorry, I can't remember the
>syntax, but it's in the manual.
>
>MoJo Risin
>--
>In article <3819d962.98580260@client.ce.news.psi.net>,
> larsen@qec.com (Jeff Larsen) wrote:
>> After a dbexport/dbimport (7.24) all my serial column
>> values get reset back to 1. Why? Is there an easy
>> way to reset the next serial values back to where they
>> should be without doing it one table at a time?
>>
>>
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
Jeff Larsen wrote:
> I was hoping for something more graceful. Why isn't the
> engine smart enough to do this itself!!!! Anyone else
> got any ideas?
>
> mojo_risin@my-deja.com wrote:
>
> >Edit your SQL import file, and at each of the "serial" column enties,
> >you can specify the starting number. Sorry, I can't remember the
> >syntax, but it's in the manual.
> >
> > larsen@qec.com (Jeff Larsen) wrote:
> >> After a dbexport/dbimport (7.24) all my serial column
> >> values get reset back to 1. Why? Is there an easy
> >> way to reset the next serial values back to where they
> >> should be without doing it one table at a time?
If there's any data in the table, then the serial column will be set
correctly for the latest undeleted row of data from the table. This is
usually a good enough approximation to what you want. The 1 values are
only left if the table is empty.
Otherwise, the system cannot help you with the original starting number
for the serial column because the information is not stored anywhere in
the system. I don't know why it isn't stored, beyond it isn't usually
very helpful after the system is running, but it never has been stored and
(TTBOMK) still is not stored.
--
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix v0.62 -- see http://www.perl.com/CPAN
#include <disclaimer.h>
Jonathan Leffler <jleffler@earthlink.net> wrote in message
news:381A7895.99BD24DB@earthlink.net...
>
>
> Jeff Larsen wrote:
>
> > I was hoping for something more graceful. Why isn't the
> > engine smart enough to do this itself!!!! Anyone else
> > got any ideas?
> >
> > mojo_risin@my-deja.com wrote:
> >
> > >Edit your SQL import file, and at each of the "serial" column enties,
> > >you can specify the starting number. Sorry, I can't remember the
> > >syntax, but it's in the manual.
> > >
> > > larsen@qec.com (Jeff Larsen) wrote:
> > >> After a dbexport/dbimport (7.24) all my serial column
> > >> values get reset back to 1. Why? Is there an easy
> > >> way to reset the next serial values back to where they
> > >> should be without doing it one table at a time?
>
> If there's any data in the table, then the serial column will be set
> correctly for the latest undeleted row of data from the table. This is
> usually a good enough approximation to what you want. The 1 values are
> only left if the table is empty.
>
> Otherwise, the system cannot help you with the original starting number
> for the serial column because the information is not stored anywhere in
> the system. I don't know why it isn't stored, beyond it isn't usually
> very helpful after the system is running, but it never has been stored and
> (TTBOMK) still is not stored.
Next serial value is stored on the partition page. Why engine can't take
this value from this location ?
---------------------------------------------------
With best regards, Yuri Dovgart
SAP R/3, Informix technical consultant,
Senior System Consultant
System Architecture and High Availability Systems,
'Telecominvest' company
Email y_dovgart@tci.ukrtel.net
ICQ 39284285
>
> --
> Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
> Guardian of DBD::Informix v0.62 -- see http://www.perl.com/CPAN
> #include <disclaimer.h>
>
>
>
Yuri Dovgart wrote:
>
> Jonathan Leffler <jleffler@earthlink.net> wrote in message
> news:381A7895.99BD24DB@earthlink.net...
> >
> >
> > Jeff Larsen wrote:
> >
> > > I was hoping for something more graceful. Why isn't the
> > > engine smart enough to do this itself!!!! Anyone else
> > > got any ideas?
> > >
> > > mojo_risin@my-deja.com wrote:
> > >
> > > >Edit your SQL import file, and at each of the "serial" column enties,
> > > >you can specify the starting number. Sorry, I can't remember the
> > > >syntax, but it's in the manual.
[SNIP]
> Next serial value is stored on the partition page. Why engine can't take
> this value from this location ?
Yet another reason to use myschema.ec rather than dbschema to create
schema files! Myschema ALWAYS prints syntax needed to set the current
serial number to what it was. Also note that myschema, unlike dbschema,
can also make dbload compatible schema scripts which will save you editing
the dbexport output to add dbspaces, extent sizes, and serial number
initializers. Myschema.ec is part of the package utils2_ak in the IIUG
Software Repository.
Art S. Kagel