Shell to make dbexports
Posted in 2017
Topics: Server Administration, Migration, Import/Export & Data Conversion
Hi,
I making a shell to
dbexport all my databases.
I first put an
onmode -uy line,then
onmode -jy lineMy question is, where and how many time do I need to put an sleep ??? Line to
make sure all sesions are terminated, before I put the dbexport cicle lines ?
Thanks in advance.
Hi,
you cannot foresee that.
The issue here is you could be interrupting a transaction which was before
changing a lot of data
and needs to roll back now.
This can take very long, depending on the amount of data to be moved.
So it very much depends on your DB usage.
You could check with a onmode -g sql | grep databasename
before a dbexport is started.
There are alternatives, though. Take a look at myexport from Art Kagel,
available in the
iuug repos. You might be able to export without a DB lock.
The point here is that the data might not be constistent when you do not place
a
lock on everything and read only what is committed (the last table you export
could contain data referencing to the first table you exported but to a record
which did not exists at the time of the export of that table).
So it very much depends why you are exporting the data and what you want to do
with it
and how much you rely on consistency.
dbexport does not replace a full backup, the purpose is different.
Marcus Haarmann
Von: "jorge valenzuela" <jorgervt@gmail.com>
An: "ids" <ids@iiug.org>
Gesendet: Freitag, 6. Oktober 2017 18:53:44
Betreff: Shell to make dbexports [40019]
Hi,
I making a shell to
dbexport all my databases.
I first put an
onmode -uy line,then
onmode -jy lineMy question is, where and how many time do I need to put an sleep ??? Line to
make sure all sesions are terminated, before I put the dbexport cicle lines ?
Thanks in advance.
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
Thanks you.
> El 07/10/2017, a las 23:25, Marcus Haarmann <marcus.haarmann@midoco.de>
escribió:
>
> Hi,
> you cannot foresee that.
> The issue here is you could be interrupting a transaction which was before
> changing a lot of data
> and needs to roll back now.
> This can take very long, depending on the amount of data to be moved.
> So it very much depends on your DB usage.
> You could check with a onmode -g sql | grep databasename
> before a dbexport is started.
>
> There are alternatives, though. Take a look at myexport from Art Kagel,
> available in the
> iuug repos. You might be able to export without a DB lock.
> The point here is that the data might not be constistent when you do not
place
> a
> lock on everything and read only what is committed (the last table you export
> could contain data referencing to the first table you exported but to a
record
> which did not exists at the time of the export of that table).
>
> So it very much depends why you are exporting the data and what you want to
do
> with it
> and how much you rely on consistency.
> dbexport does not replace a full backup, the purpose is different.
>
> Marcus Haarmann
>
> Von: "jorge valenzuela" <jorgervt@gmail.com>
> An: "ids" <ids@iiug.org>
> Gesendet: Freitag, 6. Oktober 2017 18:53:44
> Betreff: Shell to make dbexports [40019]
>
> Hi,
> I making a shell to
> dbexport all my databases.
>
> I first put an
> onmode -uy line,then
> onmode -jy line> My question is, where and how many time do I need to put an sleep ??? Line to
> make sure all sesions are terminated, before I put the dbexport cicle lines ?
>
> Thanks in advance.
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>