Moving dbspaces to larger chunks
Posted in 2009
After upgrading from IDS 7.31 to IDS 10 on AIX, a DBA needed to move ~9000 tables from many 2GB-chunk dbspaces into new dbspaces built on 16GB chunks, since Patrol's DBREORG no longer supported the newer engine. Replies recommended scripting ALTER FRAGMENT/ALTER TABLE ... INIT IN <newdbspace> (fastest method; watch logical-log/long transactions, use PDQ, and note indexes may need dropping/recreating), plus AGS Server Studio's reorg feature or Art Kagel's utils4_ak AWK scripts to generate the statements or unload/reload scripts. A side question about using IDS mirroring to swap chunks was answered: possible with symbolic links and an engine bounce, but it can't enlarge a chunk because mirrors must match size. The poster thanked the group.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Installation, Setup & Upgrades, Storage & Space Management, Platform-Specific Issues
Everyone, We have recently upgraded to IDS10 from 7.31 running on AIX 5.3 and we previously used Patrol's DBREORG to reorg the entire database and perform tasks such as moving all tables in a dbscpace to a new dbspace. Since DBREORG doesn't support newer versions of IDS, does anyone know of other tools that can perform this type of task in an automated fashion? Specifically, I need to migrate most of our dbspaces to larger chunks to reduce the number of logical volumes used by the database for a CDP product. We currently use 2GB chunks and plan to start using 16 GB chunks. The database contains over 9000 tables, so I'm looking for an automated tool to do this. Thanks in advance, Kevin
Kevin,
First, create necessary new dbspaces (of 16GB chunks), then use alter fragment
to relocated all your tables. If the table is very large, you may run into a
long transaction, so make sure to turn off logging -- in addition, take
advantage of PDQ, so turn it on.
-- move table address_book from its current dbspace to prod6dbs;
alter fragment on table address_book init in prod6dbs;
You can script all the alter fragment to automate it. However, this technique
doesn't seem to move your index -- I don't know a way to move them using
"alter fragment" or "alter table" besides dropping and recreating those in new
dbspaces. If anyone knows a better way please share.
Hope this help.
Kern--
________________________________
From: KEVIN MONDAY <kevin.monday@manitowoc.com>
To: ids@iiug.org
Sent: Tuesday, January 13, 2009 11:46:46 AM
Subject: Moving dbspaces to larger chunks [14510]
Everyone,
We have recently upgraded to IDS10 from 7.31 running on AIX 5.3 and we
previously used Patrol's DBREORG to reorg the entire database and perform
tasks such as moving all tables in a dbscpace to a new dbspace. Since DBREORG
doesn't support newer versions of IDS, does anyone know of other tools that
can perform this type of task in an automated fashion? Specifically, I need to
migrate most of our dbspaces to larger chunks to reduce the number of logical
volumes used by the database for a CDP product. We currently use 2GB chunks
and plan to start using 16 GB chunks. The database contains over 9000 tables,
so I'm looking for an automated tool to do this.
Thanks in advance,
Kevin
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
AGS's Server Studio, which comes free with your copy of IDS 10.00, has the
capability to reorg your tables/databases for you. The license for Server
Studio is IB for 60 days once activated with full features including the
Sentinel module. After the initial period, the license converts to a basic
license and you would have to purchase a full license to continue to use the
advanced features such as Sentinel, however, IB that the table reorg option
is part of the basic licensed features.
Another option: get my package utils4_ak. It contains a bunch of sample AWK
scripts that read dbschema or myschema output and generate various scripts
to process your database tables easily. It would be trivial to modify one
of those to generate an ALTER TABLE <tablename> INIT IN <dbspace>; statement
to a script that you can run to reorg your tables almost automatically.
That ALTER command is the fastest way to reorg a table into a new dbspace
and is preferred over unloading the data and reloading it unless your
logical logs cannot hold the entire transaction.
Other options using utils4_ak:
- There are actually scripts there, mkul_u.awk & mkul_l.awk which create
scripts to unload a table to binary files and reload them using my
ul.ecutility
- Scripts mkunl.awk and mkreload.awk which do the same thing using
basicUNLOAD and LOAD in dbaccess
- Script mkdrop.awk which will generate a script to drop all of your
tables after they have been safely exported
Or you can modify these scripts to do one table at a time, export, drop,
recreate, import, build indexes, etc.
Art
On Tue, Jan 13, 2009 at 11:46 AM, KEVIN MONDAY
<kevin.monday@manitowoc.com>wrote:
> Everyone,
>
> We have recently upgraded to IDS10 from 7.31 running on AIX 5.3 and we
> previously used Patrol's DBREORG to reorg the entire database and perform
> tasks such as moving all tables in a dbscpace to a new dbspace. Since
> DBREORG
> doesn't support newer versions of IDS, does anyone know of other tools that
> can perform this type of task in an automated fashion? Specifically, I need
> to
> migrate most of our dbspaces to larger chunks to reduce the number of
> logical
> volumes used by the database for a CDP product. We currently use 2GB chunks
> and plan to start using 16 GB chunks. The database contains over 9000
> tables,
> so I'm looking for an automated tool to do this.
>
> Thanks in advance,
>
> Kevin
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Art S. Kagel
Oninit (www.oninit.com)
IIUG Board of Directors (art@iiug.org)
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Oninit, the IIUG, nor any other organization
with which I am associated either explicitly or implicitly. Neither do
those opinions reflect those of other individuals affiliated with any entity
with which I am affiliated nor those of the entities themselves.
Thank you for your replies. This should help a lot! Kevin
One question, just out of pure curiosity; is it feasible/possible to
create a mirror chunk, allow the mirror to sync, then break the mirror
and remove the old chunk?
Lazy DBA always looking for new ways to do less :)
Jonathan Smaby
Pomona College
-----Original Message-----
From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of
Art Kagel
Sent: Tuesday, January 13, 2009 10:00 AM
To: ids@iiug.org
Subject: Re: Moving dbspaces to larger chunks [14512]
AGS's Server Studio, which comes free with your copy of IDS 10.00, has
the
capability to reorg your tables/databases for you. The license for
Server
Studio is IB for 60 days once activated with full features including the
Sentinel module. After the initial period, the license converts to a
basic
license and you would have to purchase a full license to continue to use
the
advanced features such as Sentinel, however, IB that the table reorg
option
is part of the basic licensed features.
Another option: get my package utils4_ak. It contains a bunch of sample
AWK
scripts that read dbschema or myschema output and generate various
scripts
to process your database tables easily. It would be trivial to modify
one
of those to generate an ALTER TABLE <tablename> INIT IN <dbspace>;
statement
to a script that you can run to reorg your tables almost automatically.
That ALTER command is the fastest way to reorg a table into a new
dbspace
and is preferred over unloading the data and reloading it unless your
logical logs cannot hold the entire transaction.
Other options using utils4_ak:
- There are actually scripts there, mkul_u.awk & mkul_l.awk which create
scripts to unload a table to binary files and reload them using my
ul.ecutility
- Scripts mkunl.awk and mkreload.awk which do the same thing using
basicUNLOAD and LOAD in dbaccess
- Script mkdrop.awk which will generate a script to drop all of your
tables after they have been safely exported
Or you can modify these scripts to do one table at a time, export, drop,
recreate, import, build indexes, etc.
Art
On Tue, Jan 13, 2009 at 11:46 AM, KEVIN MONDAY
<kevin.monday@manitowoc.com>wrote:
> Everyone,
>
> We have recently upgraded to IDS10 from 7.31 running on AIX 5.3 and we
> previously used Patrol's DBREORG to reorg the entire database and
perform
> tasks such as moving all tables in a dbscpace to a new dbspace. Since
> DBREORG
> doesn't support newer versions of IDS, does anyone know of other tools
that
> can perform this type of task in an automated fashion? Specifically, I
need
> to
> migrate most of our dbspaces to larger chunks to reduce the number of
> logical
> volumes used by the database for a CDP product. We currently use 2GB
chunks
> and plan to start using 16 GB chunks. The database contains over 9000
> tables,
> so I'm looking for an automated tool to do this.
>
> Thanks in advance,
>
> Kevin
>
>
>
>
************************************************************************
*******
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Art S. Kagel
Oninit (www.oninit.com)
IIUG Board of Directors (art@iiug.org)
Disclaimer: Please keep in mind that my own opinions are my own opinions
and
do not reflect on my employer, Oninit, the IIUG, nor any other
organization
with which I am associated either explicitly or implicitly. Neither do
those opinions reflect those of other individuals affiliated with any
entity
with which I am affiliated nor those of the entities themselves.
************************************************************************
*******
Forum Note: Use "Reply" to post a response in the discussion forum.
-------------------------------------------------------------
This message has been scanned by Postini anti-virus software.
Yes. I'm assuming you mean to use IDS mirroring. You have to have had
MIRROR turned on in the ONCONFIG file when the server started up in order to
be able to use mirroring according to the Administrator's Reference manual.
So if you don't have MIRROR enabled, shutdown and turn that on, then
restart.
Given that, if you use a symbolic link for the mirror chunk (and hopefully
for the original chunk as well) you can add the mirror, once it has caught
up, shutdown the server, swap the links so that the mirror is now the
primary and vice-versa, then restart the engine and drop the mirror. Once
you are done with the disk migration you can disable MIRROR and bounce the
engine again. The manuals recommend to not keep MIRROR turned on if you are
not using it.
Note that you CANNOT however, use this method to expand a chunk into a
larger chunk. The mirror has to be declared to be exactly the same size as
the original chunk that it mirrors. So if it is physically larger the
remaining space will be wasted or will have to be used for chunks with
offsets.
Art
On Tue, Jan 13, 2009 at 1:33 PM, Jonathan Smaby
<Jonathan.Smaby@pomona.edu>wrote:
> One question, just out of pure curiosity; is it feasible/possible to
> create a mirror chunk, allow the mirror to sync, then break the mirror
> and remove the old chunk?
>
> Lazy DBA always looking for new ways to do less :)
>
> Jonathan Smaby
> Pomona College
>
> -----Original Message-----
> From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of
> Art Kagel
> Sent: Tuesday, January 13, 2009 10:00 AM
> To: ids@iiug.org
> Subject: Re: Moving dbspaces to larger chunks [14512]
>
> AGS's Server Studio, which comes free with your copy of IDS 10.00, has
> the
> capability to reorg your tables/databases for you. The license for
> Server
> Studio is IB for 60 days once activated with full features including the
>
> Sentinel module. After the initial period, the license converts to a
> basic
> license and you would have to purchase a full license to continue to use
> the
> advanced features such as Sentinel, however, IB that the table reorg
> option
> is part of the basic licensed features.
>
> Another option: get my package utils4_ak. It contains a bunch of sample
> AWK
> scripts that read dbschema or myschema output and generate various
> scripts
> to process your database tables easily. It would be trivial to modify
> one
> of those to generate an ALTER TABLE <tablename> INIT IN <dbspace>;
> statement
> to a script that you can run to reorg your tables almost automatically.
> That ALTER command is the fastest way to reorg a table into a new
> dbspace
> and is preferred over unloading the data and reloading it unless your
> logical logs cannot hold the entire transaction.
>
> Other options using utils4_ak:
>
> - There are actually scripts there, mkul_u.awk & mkul_l.awk which create
>
> scripts to unload a table to binary files and reload them using my
> ul.ecutility
>
> - Scripts mkunl.awk and mkreload.awk which do the same thing using
>
> basicUNLOAD and LOAD in dbaccess
>
> - Script mkdrop.awk which will generate a script to drop all of your
>
> tables after they have been safely exported
>
> Or you can modify these scripts to do one table at a time, export, drop,
>
> recreate, import, build indexes, etc.
>
> Art
>
> On Tue, Jan 13, 2009 at 11:46 AM, KEVIN MONDAY
> <kevin.monday@manitowoc.com>wrote:
>
> > Everyone,
> >
> > We have recently upgraded to IDS10 from 7.31 running on AIX 5.3 and we
>
> > previously used Patrol's DBREORG to reorg the entire database and
> perform
> > tasks such as moving all tables in a dbscpace to a new dbspace. Since
> > DBREORG
> > doesn't support newer versions of IDS, does anyone know of other tools
> that
> > can perform this type of task in an automated fashion? Specifically, I
> need
> > to
> > migrate most of our dbspaces to larger chunks to reduce the number of
> > logical
> > volumes used by the database for a CDP product. We currently use 2GB
> chunks
> > and plan to start using 16 GB chunks. The database contains over 9000
> > tables,
> > so I'm looking for an automated tool to do this.
> >
> > Thanks in advance,
> >
> > Kevin
> >
> >
> >
> >
> ************************************************************************
> *******
> > Forum Note: Use "Reply" to post a response in the discussion forum.
> >
> >
>
> --
> Art S. Kagel
> Oninit (www.oninit.com)
> IIUG Board of Directors (art@iiug.org)
>
> Disclaimer: Please keep in mind that my own opinions are my own opinions
> and
> do not reflect on my employer, Oninit, the IIUG, nor any other
> organization
> with which I am associated either explicitly or implicitly. Neither do
> those opinions reflect those of other individuals affiliated with any
> entity
> with which I am affiliated nor those of the entities themselves.
>
> ************************************************************************
> *******
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
> -------------------------------------------------------------
> This message has been scanned by Postini anti-virus software.
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Art S. Kagel
Oninit (www.oninit.com)
IIUG Board of Directors (art@iiug.org)
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Oninit, the IIUG, nor any other organization
with which I am associated either explicitly or implicitly. Neither do
those opinions reflect those of other individuals affiliated with any entity
with which I am affiliated nor those of the entities themselves.