RE: Moving a table
Posted in 2008
Topics: Storage & Space Management
MIKE MAGIE wrote:
Great details dude! Simpler than you'd guess:
ALTER FRAGMENT ON TABLE <tablename> INIT IN <one_dbspace_name>;
Art
Dudes and Dudettes,
10.00.UC8
Solaris 2.8
6-1, 180
11/17/1967
Scorpio
I have been messing with alter frag, attach detach init, etc. all day. Someone
clue me in on the secret ALTER TABLE statement that lets me move a
non-fragmented table with indexes created IN TABLE to a new dbspace. I am at
this point settling on the following sequence of events which leaves my newly
moved table index-less:
alter fragment on table <TABLE> INIT
fragment by expression
reins_yr_id = "2005" in <DBSPACE_1>,reins_yr_id != "2005" in <DBSPACE_2>;
Simple and keeps rows out of my new fragment - which I dig.
Then I :
alter fragment on table <TABLE> detach <DBSPACE_2> <NEW_TABLE>;
Now I have my new, empty, non-fragged table in the dbspace I want. I next drop
the original table and rename the new one to the old ones name.
But I have no indexes - as is freaking documented.
Help -
Mike
*******************************************************************************
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 explicitely or
implicitely. Neither do those opinions reflect those of other
individuals affiliated with any entity with which I am affiliated nor
those of the entities themselves.
Thanks for all the help - yeah the INIT IN clause is the closest thing for me to use. It still leaves the index behind in the other dbspace but we can handle that. Thanks again - MM