Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Just wondering if anybody's ever done this...  DBREINDEX x 2

Posted on 2009-04-09
13
Medium Priority
?
358 Views
Last Modified: 2012-08-13
v2000, four tables, one is freeking huge.  the other three or similarly huge, but not as bad as the other.  Say I've got 2B records in one, and a bit less than that in the others.
(B = billion)

heavily fragmented, i need to defrag. the last time i did this, it took 46hrs.  completed successfully.. just rather timely.  surely it's going to be greater this time around, as the data is never purged.  

i'm starting to wonder... what if i split it up, two different jobs:  two tables in one, two tables in the other, and ran them in parallel?  fully dedicated machine, completely dedicated to me and only me, throughout the Easter weekend.  

What do you think?  Might that be too harsh to the machine?  It should be ok... don't you think?
ample, ample disk space on all drives... simple recovery model... so i'm not too worried about chewing tons of disk.  But.... maybe I should be more worried.

I don't know.

Anybody ever tried anything like this?
0
Comment
Question by:dbaSQL
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 2
  • 2
  • +1
13 Comments
 
LVL 8

Accepted Solution

by:
MrMintanet earned 800 total points
ID: 24113202
This sounds brilliant.  I did something similar, and to be honest, I think I had more data than this.  "Harsh"?  I think it will be fine.  You said it, "Ample disk space".  That and the recovery model is really all you need.  Anything else is just routine, IMHO.
0
 
LVL 17

Author Comment

by:dbaSQL
ID: 24113240
well, i hope so.... i think i'm going to give it a go.  i will let you know.  
in a day or two..... :-)
0
 
LVL 5

Assisted Solution

by:brandonvmoore
brandonvmoore earned 600 total points
ID: 24113255
You might consider doing some research on how to optimize your storage system and database in order to elimate the need for defragmentation.  I'm guessing you don't have to do it often, but if you do then this would be the way to go.
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 17

Author Comment

by:dbaSQL
ID: 24113263
oh yes... i agree.  in sql agent, my job description:

    Hopefully only once more before upgrade.... dbcc dbreindex.

my new model in v2008 is a partitioned structure.  i fully intend to take advantage of he ability to parition selectively, by partition
0
 
LVL 8

Expert Comment

by:MrMintanet
ID: 24113268
There will always be a need to defrag.  What are you talking about brandon?
0
 
LVL 17

Author Comment

by:dbaSQL
ID: 24113279
agreed... there will be.  slight type-o in my previous post:

 i fully intend to take advantage of he ability to MAINTAIN THE paritions selectively, by partition

that maintenance may be defrag, backups, who knows... but, it's going to help me optimize my storage system such that it is more manageable, and doesn't require such ridiculous runtimes for mantenance of this nature.
0
 
LVL 5

Expert Comment

by:brandonvmoore
ID: 24113530
Mr Mintanet: Yes, I should have said that it greatly reduces the need for defragging.
0
 
LVL 60

Assisted Solution

by:chapmandew
chapmandew earned 600 total points
ID: 24115138
partitioning is the way to go, when you can.

becareful with dbreindex....it rebuilds the reindex rather than the reorg (defrag), which means it is going to take a lock on the table(s)
0
 
LVL 17

Author Comment

by:dbaSQL
ID: 24115962
yep.... that's why i chose tihs weekend to do it.  Good Friday, Easter Sunday... nobody's trading.  That db is mine.  Two of my four targeted tables are complete... two are still running.  And I expect they will be yet for some time.

0
 
LVL 17

Author Comment

by:dbaSQL
ID: 24122042
Msg 1204, Sev 19: The SQL Server cannot obtain a LOCK resource at this time. Rerun your statement when there are fewer active users or ask the system administrator to check the SQL Server lock and memory configuration. [SQLSTATE HY000]

>>>what if i split it up, two different jobs:  two tables in one, two tables in the other, and ran them in parallel?  

as i said, that box is completely dedicated to me during this effort.  i have to assume that splitting it up into two jobs was a problem.  and one just crapped on the other.  i don't know what else it could have been.

regardless..... dbcc dbreindex (tablename, '',90)
ran for X number of hours, and got interrupted.  

wonder, if i run it again now, is it resuming the efforts from before... or starting over completely from the ground up?  i mean, since it's a rebuild and not a reorg, isn't it an all or nothing?
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 24122077
Hmmm...I think the reorg would start over where it left off, but not the reindex.  If you restart, its likely going to start at the beginning...otherwise, it might leave the db in an inconsistent state.
0
 
LVL 17

Author Comment

by:dbaSQL
ID: 24122102
yeah... haven't actually done this precise move before, but i am inclined to agree, chap.  ouch
0
 
LVL 17

Author Comment

by:dbaSQL
ID: 24129193
splitting it into two jobs, to be run in parallel, tripped me.  (they ran into eachother)
in the future, we'll just do it sequentially.   (till i upgrade to the partitioned version and can handle things more selectively, that is)
thank you each for your input
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question