Showing posts with label rebuilt. Show all posts
Showing posts with label rebuilt. Show all posts

Friday, March 30, 2012

Recently Rebuilt SQL2K Cluster

I have recently had to rebuild my SQL Server 2000 sp3a 2 node active/passive
cluster running on Windows 2000 AS SP4. We ran into issues about two weeks
ago after a SAN migration (I'll spare all the gory details). When my
previous cluster died, I used one of the nodes as a stand alone instance of
SQL Server (to run our production database). On the other former node, I
removed the OS clustering software and had to manually remove SQL Server. I
eventually (with the assistance of Donna L. at MS) was able to get a single
node cluster of SQL2K running on physical server PRODSQL01 (the virtual
server name is PRODSQLCL01). While the cluster was running as a single node
cluster, I applied sp3a and the 818 hotfix. I then migrated the data from
the stand alone instance to PRODSQLCL01 and started to use it for production.
I turned my attention to the other box and removed and reinstalled the
Windows 2000 cluster software. This box is now called PRODSQL02. I was able
to add PRODSQL02 to the windows cluster, and the successfully added it via
SQL Server setup to the virtual server. My issue now is that PRODSQL02 has
the RTM versions of the binaries. I am not sure if I have a setup issue or I
misunderstand point 3.10 of the sp3a readme. Currently the virtual server is
running on PRODSQL01. If I attempt follow the steps under "If you need to
rebuild a node in the failover cluster..." from PRODSQL02 I am only able to
select the Virtual Server, and if I continue setup I get this error "all
cluster disks available to this virtual server are owned by other node(s)"
and then "Setup was unable to verify the state of the server for an upgrade.
Verify the server is able to start and that you provided a valid sa password
and restart setup". I understand that the virtual resources are only
available on the currently active node, but the way I read the instructions I
should be able to run the service pack installation on the inactive node. Do
I need to rerun the SP (and hotfix) setup on SQL01 (since the virtual server
is running there)? Do I need to move the resources to SQL02 and run the SP
setup there? I just need clarification of where to run the SP setup since I
just added SQL02 to this cluster.
You should be able to run setup on the non-host node and it will upgrade the
local binaries. Try rebooting the newly added RTM node and see if it helps.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
"Justin Hoffmann" <Justin Hoffmann@.discussions.microsoft.com> wrote in
message news:A214ED19-F6CD-4D25-90CE-0A1D456750BD@.microsoft.com...
>I have recently had to rebuild my SQL Server 2000 sp3a 2 node
>active/passive
> cluster running on Windows 2000 AS SP4. We ran into issues about two
> weeks
> ago after a SAN migration (I'll spare all the gory details). When my
> previous cluster died, I used one of the nodes as a stand alone instance
> of
> SQL Server (to run our production database). On the other former node, I
> removed the OS clustering software and had to manually remove SQL Server.
> I
> eventually (with the assistance of Donna L. at MS) was able to get a
> single
> node cluster of SQL2K running on physical server PRODSQL01 (the virtual
> server name is PRODSQLCL01). While the cluster was running as a single
> node
> cluster, I applied sp3a and the 818 hotfix. I then migrated the data from
> the stand alone instance to PRODSQLCL01 and started to use it for
> production.
> I turned my attention to the other box and removed and reinstalled the
> Windows 2000 cluster software. This box is now called PRODSQL02. I was
> able
> to add PRODSQL02 to the windows cluster, and the successfully added it via
> SQL Server setup to the virtual server. My issue now is that PRODSQL02
> has
> the RTM versions of the binaries. I am not sure if I have a setup issue
> or I
> misunderstand point 3.10 of the sp3a readme. Currently the virtual server
> is
> running on PRODSQL01. If I attempt follow the steps under "If you need to
> rebuild a node in the failover cluster..." from PRODSQL02 I am only able
> to
> select the Virtual Server, and if I continue setup I get this error "all
> cluster disks available to this virtual server are owned by other node(s)"
> and then "Setup was unable to verify the state of the server for an
> upgrade.
> Verify the server is able to start and that you provided a valid sa
> password
> and restart setup". I understand that the virtual resources are only
> available on the currently active node, but the way I read the
> instructions I
> should be able to run the service pack installation on the inactive node.
> Do
> I need to rerun the SP (and hotfix) setup on SQL01 (since the virtual
> server
> is running there)? Do I need to move the resources to SQL02 and run the
> SP
> setup there? I just need clarification of where to run the SP setup since
> I
> just added SQL02 to this cluster.
>
|||Geoff:
I've rebooted the newly added RTM node several times and it doesn't seem to
help. When I launch SP3 setup (via setup.bat in the local sql2ksp3
directory) on the newly added RTM node I get to the screen that says Computer
Name. Local Computer is grayed out, there is a box for the existing Virtual
Server name. When I type the virtual server name in the box and press next,
I get the error messages I mentioned in my original post. Is there anything
else you can recommend?
Thanks,
Justin
"Geoff N. Hiten" wrote:

> You should be able to run setup on the non-host node and it will upgrade the
> local binaries. Try rebooting the newly added RTM node and see if it helps.
>
> Geoff N. Hiten
> Microsoft SQL Server MVP
> Senior Database Administrator
>
|||This is how I wound up fixing this:
I ran sp3a setup from PRODSQL01, which was the machine in control of the SQL
Virtual server at the time. It updated the binaries on PRODSQL02, but in
order to do so, the SQL Server service was stopped. Once sp3a setup
completed, I had to reboot PRODSQL02. When it was back up, I verified the
version of the sqlservr.exe file, and it was 8.00.760 (right click,
properties, version). Once I established that sp3a took on the newly added
node, I started the setup for the 8.00.818 security hotfix. SQL Server went
down briefly again, and then the binaries on the newly added box were
updated. I then installed MDAC 2.8 on this node and rebooted. Once
PRODSQL02 was running again I tested moving the cluster resources from 01 to
02. It succeeded. While SQL was running on 02 I ran throught setting up
Imceda SQL Lite Speed (again, it was on 01 but not 02). Once that completed,
I was able to verify that my normally scheduled transaction log backups
completed successfully. Both machines run SQL Server and perform the
backups correctly. I am not sure about the root cause of the issue I
encountered with not being able to run the sp and hotfix on the newly added
node when it wasn't running the Virtual SQL Server (the sp3a readme seems to
indicate that you can), but I finally have a 2 node active passive cluster
running again.
|||Just to clarify, it is active passive, so only one node runs the Virtual SQL
Server at any time. I was trying to say that each node is able to run SQL
Server, and each node is able to run the SQL Lite Speed backups. I had been
concerned that somehow I would get PRODSQL02 all patched but then failing
over would not work correctly. Everything is working OK.
"Justin Hoffmann" wrote:

> This is how I wound up fixing this:
> I ran sp3a setup from PRODSQL01, which was the machine in control of the SQL
> Virtual server at the time. It updated the binaries on PRODSQL02, but in
> order to do so, the SQL Server service was stopped. Once sp3a setup
> completed, I had to reboot PRODSQL02. When it was back up, I verified the
> version of the sqlservr.exe file, and it was 8.00.760 (right click,
> properties, version). Once I established that sp3a took on the newly added
> node, I started the setup for the 8.00.818 security hotfix. SQL Server went
> down briefly again, and then the binaries on the newly added box were
> updated. I then installed MDAC 2.8 on this node and rebooted. Once
> PRODSQL02 was running again I tested moving the cluster resources from 01 to
> 02. It succeeded. While SQL was running on 02 I ran throught setting up
> Imceda SQL Lite Speed (again, it was on 01 but not 02). Once that completed,
> I was able to verify that my normally scheduled transaction log backups
> completed successfully. Both machines run SQL Server and perform the
> backups correctly. I am not sure about the root cause of the issue I
> encountered with not being able to run the sp and hotfix on the newly added
> node when it wasn't running the Virtual SQL Server (the sp3a readme seems to
> indicate that you can), but I finally have a 2 node active passive cluster
> running again.
|||The current correct term is "Single-Instance". "Active-Active" and its
cousins all refer to technology used specifically in SQL server 7.0 only.
Sometimes the binary only upgrade doesn't work right. Your solution is the
fallback solution but it does have the obvious downside of taking the SQL
server offline for a short time during the upgrade.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Adminstrator
"Justin Hoffmann" <JustinHoffmann@.discussions.microsoft.com> wrote in
message news:DA3E156A-EAFD-45D9-B72E-AB4A657D53A0@.microsoft.com...[vbcol=seagreen]
> Just to clarify, it is active passive, so only one node runs the Virtual
> SQL
> Server at any time. I was trying to say that each node is able to run SQL
> Server, and each node is able to run the SQL Lite Speed backups. I had
> been
> concerned that somehow I would get PRODSQL02 all patched but then failing
> over would not work correctly. Everything is working OK.
> "Justin Hoffmann" wrote:

Monday, March 26, 2012

rebuilt option for master database

I was testing Disaster Recovery plann for master database recovery , While
rebuliding master file on test setup , I am getting following error , can u
pls let me know why does it give this error ..I am already in a single user
mode .
Rebuilt master is failed due to following error no : 266 , copy function
cannot be used
There has been sharing violations in source or destination file .
Regards,
swati
Seems like your SQL Server is still started so that rebuildm.exe can't create the database files...
Also, note that rebuildm has a bug where it can't run the source database files from the CD, as it
doesn't remove the read-only attribute.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"swati" <swati.zingade@.ugamsolutions.com> wrote in message
news:%23gE5zkwwEHA.3528@.TK2MSFTNGP10.phx.gbl...
> I was testing Disaster Recovery plann for master database recovery , While
> rebuliding master file on test setup , I am getting following error , can u
> pls let me know why does it give this error ..I am already in a single user
> mode .
> Rebuilt master is failed due to following error no : 266 , copy function
> cannot be used
> There has been sharing violations in source or destination file .
>
> Regards,
> swati
>
>
|||Hi !
sql server is in single user mode , and then i tried to rebulid the same
using rebuild option ,i am accessing the files which are present in
c:\programme files \ ..ie. a default directory . there is no read only
option for data /log files . Pls tell me what should be done ?
Regards,
Swati
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:#$zD9pwwEHA.3824@.TK2MSFTNGP15.phx.gbl...
> Seems like your SQL Server is still started so that rebuildm.exe can't
create the database files...
> Also, note that rebuildm has a bug where it can't run the source database
files from the CD, as it[vbcol=seagreen]
> doesn't remove the read-only attribute.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "swati" <swati.zingade@.ugamsolutions.com> wrote in message
> news:%23gE5zkwwEHA.3528@.TK2MSFTNGP10.phx.gbl...
While[vbcol=seagreen]
can u[vbcol=seagreen]
user
>
|||Seems you are using the rebildm.exe program in a completely wrong way, I'm afraid. I recommend that
you start by reading in Books Online how this program work, no need to re-phrase all the information
from Books Online as you already have the information there. And then you can of course post back
questions here is you still don't get it working.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"swati" <swati.zingade@.ugamsolutions.com> wrote in message
news:OaroX0wwEHA.2572@.tk2msftngp13.phx.gbl...
> Hi !
> sql server is in single user mode , and then i tried to rebulid the same
> using rebuild option ,i am accessing the files which are present in
> c:\programme files \ ..ie. a default directory . there is no read only
> option for data /log files . Pls tell me what should be done ?
>
> Regards,
> Swati
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:#$zD9pwwEHA.3824@.TK2MSFTNGP15.phx.gbl...
> create the database files...
> files from the CD, as it
> While
> can u
> user
>

rebuilt option for master database

I was testing Disaster Recovery plann for master database recovery , While
rebuliding master file on test setup , I am getting following error , can u
pls let me know why does it give this error ..I am already in a single user
mode .
Rebuilt master is failed due to following error no : 266 , copy function
cannot be used
There has been sharing violations in source or destination file .
Regards,
swatiSeems like your SQL Server is still started so that rebuildm.exe can't creat
e the database files...
Also, note that rebuildm has a bug where it can't run the source database fi
les from the CD, as it
doesn't remove the read-only attribute.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"swati" <swati.zingade@.ugamsolutions.com> wrote in message
news:%23gE5zkwwEHA.3528@.TK2MSFTNGP10.phx.gbl...
> I was testing Disaster Recovery plann for master database recovery , Whi
le
> rebuliding master file on test setup , I am getting following error , can
u
> pls let me know why does it give this error ..I am already in a single use
r
> mode .
> Rebuilt master is failed due to following error no : 266 , copy function
> cannot be used
> There has been sharing violations in source or destination file .
>
> Regards,
> swati
>
>|||Hi !
sql server is in single user mode , and then i tried to rebulid the same
using rebuild option ,i am accessing the files which are present in
c:\programme files \ ..ie. a default directory . there is no read only
option for data /log files . Pls tell me what should be done ?
Regards,
Swati
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:#$zD9pwwEHA.3824@.TK2MSFTNGP15.phx.gbl...
> Seems like your SQL Server is still started so that rebuildm.exe can't
create the database files...
> Also, note that rebuildm has a bug where it can't run the source database
files from the CD, as it
> doesn't remove the read-only attribute.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "swati" <swati.zingade@.ugamsolutions.com> wrote in message
> news:%23gE5zkwwEHA.3528@.TK2MSFTNGP10.phx.gbl...
While[vbcol=seagreen]
can u[vbcol=seagreen]
user[vbcol=seagreen]
>|||Seems you are using the rebildm.exe program in a completely wrong way, I'm a
fraid. I recommend that
you start by reading in Books Online how this program work, no need to re-ph
rase all the information
from Books Online as you already have the information there. And then you ca
n of course post back
questions here is you still don't get it working.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"swati" <swati.zingade@.ugamsolutions.com> wrote in message
news:OaroX0wwEHA.2572@.tk2msftngp13.phx.gbl...
> Hi !
> sql server is in single user mode , and then i tried to rebulid the same
> using rebuild option ,i am accessing the files which are present in
> c:\programme files \ ..ie. a default directory . there is no read only
> option for data /log files . Pls tell me what should be done ?
>
> Regards,
> Swati
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote i
n
> message news:#$zD9pwwEHA.3824@.TK2MSFTNGP15.phx.gbl...
> create the database files...
> files from the CD, as it
> While
> can u
> user
>sql

rebuilt option for master database

I was testing Disaster Recovery plann for master database recovery , While
rebuliding master file on test setup , I am getting following error , can u
pls let me know why does it give this error ..I am already in a single user
mode .
Rebuilt master is failed due to following error no : 266 , copy function
cannot be used
There has been sharing violations in source or destination file .
Regards,
swatiSeems like your SQL Server is still started so that rebuildm.exe can't create the database files...
Also, note that rebuildm has a bug where it can't run the source database files from the CD, as it
doesn't remove the read-only attribute.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"swati" <swati.zingade@.ugamsolutions.com> wrote in message
news:%23gE5zkwwEHA.3528@.TK2MSFTNGP10.phx.gbl...
> I was testing Disaster Recovery plann for master database recovery , While
> rebuliding master file on test setup , I am getting following error , can u
> pls let me know why does it give this error ..I am already in a single user
> mode .
> Rebuilt master is failed due to following error no : 266 , copy function
> cannot be used
> There has been sharing violations in source or destination file .
>
> Regards,
> swati
>
>|||Hi !
sql server is in single user mode , and then i tried to rebulid the same
using rebuild option ,i am accessing the files which are present in
c:\programme files \ ..ie. a default directory . there is no read only
option for data /log files . Pls tell me what should be done ?
Regards,
Swati
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:#$zD9pwwEHA.3824@.TK2MSFTNGP15.phx.gbl...
> Seems like your SQL Server is still started so that rebuildm.exe can't
create the database files...
> Also, note that rebuildm has a bug where it can't run the source database
files from the CD, as it
> doesn't remove the read-only attribute.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "swati" <swati.zingade@.ugamsolutions.com> wrote in message
> news:%23gE5zkwwEHA.3528@.TK2MSFTNGP10.phx.gbl...
> > I was testing Disaster Recovery plann for master database recovery ,
While
> > rebuliding master file on test setup , I am getting following error ,
can u
> > pls let me know why does it give this error ..I am already in a single
user
> > mode .
> >
> > Rebuilt master is failed due to following error no : 266 , copy function
> > cannot be used
> > There has been sharing violations in source or destination file .
> >
> >
> > Regards,
> > swati
> >
> >
> >
>|||Seems you are using the rebildm.exe program in a completely wrong way, I'm afraid. I recommend that
you start by reading in Books Online how this program work, no need to re-phrase all the information
from Books Online as you already have the information there. And then you can of course post back
questions here is you still don't get it working.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"swati" <swati.zingade@.ugamsolutions.com> wrote in message
news:OaroX0wwEHA.2572@.tk2msftngp13.phx.gbl...
> Hi !
> sql server is in single user mode , and then i tried to rebulid the same
> using rebuild option ,i am accessing the files which are present in
> c:\programme files \ ..ie. a default directory . there is no read only
> option for data /log files . Pls tell me what should be done ?
>
> Regards,
> Swati
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:#$zD9pwwEHA.3824@.TK2MSFTNGP15.phx.gbl...
> > Seems like your SQL Server is still started so that rebuildm.exe can't
> create the database files...
> >
> > Also, note that rebuildm has a bug where it can't run the source database
> files from the CD, as it
> > doesn't remove the read-only attribute.
> >
> > --
> > Tibor Karaszi, SQL Server MVP
> > http://www.karaszi.com/sqlserver/default.asp
> > http://www.solidqualitylearning.com/
> >
> >
> > "swati" <swati.zingade@.ugamsolutions.com> wrote in message
> > news:%23gE5zkwwEHA.3528@.TK2MSFTNGP10.phx.gbl...
> > > I was testing Disaster Recovery plann for master database recovery ,
> While
> > > rebuliding master file on test setup , I am getting following error ,
> can u
> > > pls let me know why does it give this error ..I am already in a single
> user
> > > mode .
> > >
> > > Rebuilt master is failed due to following error no : 266 , copy function
> > > cannot be used
> > > There has been sharing violations in source or destination file .
> > >
> > >
> > > Regards,
> > > swati
> > >
> > >
> > >
> >
> >
>

Rebuilt master, what's next?

Hello,
What would be the way to go after rebuilding master database: (1)
restore it from the backup, restore msdb, and then user databases or (2)
restore user databases, restore master, and then msdb.
I mean, is it bad, when the master is restored w/o user databases being
accessible?
Many thanks,
Pablo
Hi,
What would be the way to go after rebuilding master database?
This is the correct step:- Restore it from the backup (Master) , Restore
msdb, and then user databases
Have a look into steps (15 - 28) in the attached link.
http://www.dbarecovery.com/restoremasterdb.html
I mean, is it bad, when the master is restored w/o user databases being
accessible?
You have to restore the Master database and then the user databases.
Otherwise Master database restore will
overwrite the existing database entries.
Thanks
Hari
MCDBA
"msnews.microsoft.com" <pablo@.this_isnt_my_mail.aaa> wrote in message
news:OcAE63nREHA.3052@.TK2MSFTNGP12.phx.gbl...
> Hello,
> What would be the way to go after rebuilding master database: (1)
> restore it from the backup, restore msdb, and then user databases or (2)
> restore user databases, restore master, and then msdb.
> I mean, is it bad, when the master is restored w/o user databases being
> accessible?
> --
> Many thanks,
> Pablo
|||Thanks, Hari.
Still, one thing remains unclear to me: what will happen when I restore
master then start the server and user databases aren't where they
supposed to be. Will the references to them in master be automatically
erased or will the databases be marked suspect? Will I have to drop the
suspect databases before restoring them or will I have to use WITH
REPLACE clause to force the restore over the existing (suspect) user
database?
Thanks,
Pablo
Hari wrote:
> Hi,
> What would be the way to go after rebuilding master database?
> This is the correct step:- Restore it from the backup (Master) , Restore
> msdb, and then user databases
> Have a look into steps (15 - 28) in the attached link.
> http://www.dbarecovery.com/restoremasterdb.html
> I mean, is it bad, when the master is restored w/o user databases being
> accessible?
> You have to restore the Master database and then the user databases.
> Otherwise Master database restore will
> overwrite the existing database entries.
> Thanks
> Hari
> MCDBA
>
> "msnews.microsoft.com" <pablo@.this_isnt_my_mail.aaa> wrote in message
> news:OcAE63nREHA.3052@.TK2MSFTNGP12.phx.gbl...
>
>
|||If SQL Server expects a databases's MDF file be in a place, and the file isn't there, you have a suspect
database. Drop it and do a regular restore.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"msnews.microsoft.com" <pablo@.this_isnt_my_mail.aaa> wrote in message
news:uLaYNSvREHA.3628@.TK2MSFTNGP12.phx.gbl...[vbcol=seagreen]
> Thanks, Hari.
> Still, one thing remains unclear to me: what will happen when I restore
> master then start the server and user databases aren't where they
> supposed to be. Will the references to them in master be automatically
> erased or will the databases be marked suspect? Will I have to drop the
> suspect databases before restoring them or will I have to use WITH
> REPLACE clause to force the restore over the existing (suspect) user
> database?
> --
> Thanks,
> Pablo
> Hari wrote:

Rebuilt master, what's next?

Hello,
What would be the way to go after rebuilding master database: (1)
restore it from the backup, restore msdb, and then user databases or (2)
restore user databases, restore master, and then msdb.
I mean, is it bad, when the master is restored w/o user databases being
accessible?
--
Many thanks,
PabloHi,
What would be the way to go after rebuilding master database?
This is the correct step:- Restore it from the backup (Master) , Restore
msdb, and then user databases
Have a look into steps (15 - 28) in the attached link.
http://www.dbarecovery.com/restoremasterdb.html
I mean, is it bad, when the master is restored w/o user databases being
accessible?
You have to restore the Master database and then the user databases.
Otherwise Master database restore will
overwrite the existing database entries.
Thanks
Hari
MCDBA
"msnews.microsoft.com" <pablo@.this_isnt_my_mail.aaa> wrote in message
news:OcAE63nREHA.3052@.TK2MSFTNGP12.phx.gbl...
> Hello,
> What would be the way to go after rebuilding master database: (1)
> restore it from the backup, restore msdb, and then user databases or (2)
> restore user databases, restore master, and then msdb.
> I mean, is it bad, when the master is restored w/o user databases being
> accessible?
> --
> Many thanks,
> Pablo|||Thanks, Hari.
Still, one thing remains unclear to me: what will happen when I restore
master then start the server and user databases aren't where they
supposed to be. Will the references to them in master be automatically
erased or will the databases be marked suspect? Will I have to drop the
suspect databases before restoring them or will I have to use WITH
REPLACE clause to force the restore over the existing (suspect) user
database?
--
Thanks,
Pablo
Hari wrote:
> Hi,
> What would be the way to go after rebuilding master database?
> This is the correct step:- Restore it from the backup (Master) , Restore
> msdb, and then user databases
> Have a look into steps (15 - 28) in the attached link.
> http://www.dbarecovery.com/restoremasterdb.html
> I mean, is it bad, when the master is restored w/o user databases being
> accessible?
> You have to restore the Master database and then the user databases.
> Otherwise Master database restore will
> overwrite the existing database entries.
> Thanks
> Hari
> MCDBA
>
> "msnews.microsoft.com" <pablo@.this_isnt_my_mail.aaa> wrote in message
> news:OcAE63nREHA.3052@.TK2MSFTNGP12.phx.gbl...
>>Hello,
>>What would be the way to go after rebuilding master database: (1)
>>restore it from the backup, restore msdb, and then user databases or (2)
>>restore user databases, restore master, and then msdb.
>>I mean, is it bad, when the master is restored w/o user databases being
>>accessible?
>>--
>>Many thanks,
>>Pablo
>
>|||If SQL Server expects a databases's MDF file be in a place, and the file isn't there, you have a suspect
database. Drop it and do a regular restore.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"msnews.microsoft.com" <pablo@.this_isnt_my_mail.aaa> wrote in message
news:uLaYNSvREHA.3628@.TK2MSFTNGP12.phx.gbl...
> Thanks, Hari.
> Still, one thing remains unclear to me: what will happen when I restore
> master then start the server and user databases aren't where they
> supposed to be. Will the references to them in master be automatically
> erased or will the databases be marked suspect? Will I have to drop the
> suspect databases before restoring them or will I have to use WITH
> REPLACE clause to force the restore over the existing (suspect) user
> database?
> --
> Thanks,
> Pablo
> Hari wrote:
> > Hi,
> >
> > What would be the way to go after rebuilding master database?
> >
> > This is the correct step:- Restore it from the backup (Master) , Restore
> > msdb, and then user databases
> >
> > Have a look into steps (15 - 28) in the attached link.
> >
> > http://www.dbarecovery.com/restoremasterdb.html
> >
> > I mean, is it bad, when the master is restored w/o user databases being
> > accessible?
> >
> > You have to restore the Master database and then the user databases.
> > Otherwise Master database restore will
> > overwrite the existing database entries.
> >
> > Thanks
> > Hari
> > MCDBA
> >
> >
> >
> > "msnews.microsoft.com" <pablo@.this_isnt_my_mail.aaa> wrote in message
> > news:OcAE63nREHA.3052@.TK2MSFTNGP12.phx.gbl...
> >
> >>Hello,
> >>
> >>What would be the way to go after rebuilding master database: (1)
> >>restore it from the backup, restore msdb, and then user databases or (2)
> >>restore user databases, restore master, and then msdb.
> >>
> >>I mean, is it bad, when the master is restored w/o user databases being
> >>accessible?
> >>
> >>--
> >>Many thanks,
> >>Pablo
> >
> >
> >

Rebuilt master, what's next?

Hello,
What would be the way to go after rebuilding master database: (1)
restore it from the backup, restore msdb, and then user databases or (2)
restore user databases, restore master, and then msdb.
I mean, is it bad, when the master is restored w/o user databases being
accessible?
Many thanks,
PabloHi,
What would be the way to go after rebuilding master database?
This is the correct step:- Restore it from the backup (Master) , Restore
msdb, and then user databases
Have a look into steps (15 - 28) in the attached link.
http://www.dbarecovery.com/restoremasterdb.html
I mean, is it bad, when the master is restored w/o user databases being
accessible?
You have to restore the Master database and then the user databases.
Otherwise Master database restore will
overwrite the existing database entries.
Thanks
Hari
MCDBA
"msnews.microsoft.com" <pablo@.this_isnt_my_mail.aaa> wrote in message
news:OcAE63nREHA.3052@.TK2MSFTNGP12.phx.gbl...
> Hello,
> What would be the way to go after rebuilding master database: (1)
> restore it from the backup, restore msdb, and then user databases or (2)
> restore user databases, restore master, and then msdb.
> I mean, is it bad, when the master is restored w/o user databases being
> accessible?
> --
> Many thanks,
> Pablo|||Thanks, Hari.
Still, one thing remains unclear to me: what will happen when I restore
master then start the server and user databases aren't where they
supposed to be. Will the references to them in master be automatically
erased or will the databases be marked suspect? Will I have to drop the
suspect databases before restoring them or will I have to use WITH
REPLACE clause to force the restore over the existing (suspect) user
database?
Thanks,
Pablo
Hari wrote:
> Hi,
> What would be the way to go after rebuilding master database?
> This is the correct step:- Restore it from the backup (Master) , Restore
> msdb, and then user databases
> Have a look into steps (15 - 28) in the attached link.
> http://www.dbarecovery.com/restoremasterdb.html
> I mean, is it bad, when the master is restored w/o user databases being
> accessible?
> You have to restore the Master database and then the user databases.
> Otherwise Master database restore will
> overwrite the existing database entries.
> Thanks
> Hari
> MCDBA
>
> "msnews.microsoft.com" <pablo@.this_isnt_my_mail.aaa> wrote in message
> news:OcAE63nREHA.3052@.TK2MSFTNGP12.phx.gbl...
>
>
>|||If SQL Server expects a databases's MDF file be in a place, and the file isn
't there, you have a suspect
database. Drop it and do a regular restore.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"msnews.microsoft.com" <pablo@.this_isnt_my_mail.aaa> wrote in message
news:uLaYNSvREHA.3628@.TK2MSFTNGP12.phx.gbl...[vbcol=seagreen]
> Thanks, Hari.
> Still, one thing remains unclear to me: what will happen when I restore
> master then start the server and user databases aren't where they
> supposed to be. Will the references to them in master be automatically
> erased or will the databases be marked suspect? Will I have to drop the
> suspect databases before restoring them or will I have to use WITH
> REPLACE clause to force the restore over the existing (suspect) user
> database?
> --
> Thanks,
> Pablo
> Hari wrote:

Rebuilding SQL2000 analysis services after server crash and attaching the Cubes

Hi,

The SQL2000 database server got crashed and has to be rebuilt from the scratch. The OS and SQL2000 Database and Analysis Services go reinstalled and luckily the data files residing on the SAN is intact and we were able to reattach the SQL databases.

The question is how can I reattach the OLAP databases and cubes. Apparently we currently do not have backups of OLAP databases but the OLAP data directory on SAN is available and is intact.

So Is it possible to reattach the OLAP database and cubes just like the way we attach the SQL databases.

Please let me know how we can fix the issue at the moment since this is a production issue.

Thanks

Vish

In Analysis Services 2000 all the informations about cubes and dimension structures are stored in the metadata repository db.

The metadata repository db, by default, is an Access db (msmdrep.mdb) that you can migrate to a SQL Server db using Analysis Manager (right click on the server and choose migrate repository).

So if you now have "that" metadata repository (the one before the crash) you can use it and AS can recognise the structure in your OLAP data directory but if you don't ... I don't know a solution to your problem.

Do you really don't have any backup of your production OLAP db?

Francesco

Friday, March 23, 2012

Rebuilding clustered index

Working on a vendor database upgrade. They want the clustered index to be
rebuilt. I have huge table with more than 10 million records....have a
clustered index and 10 non-clustered indexes...
what are my options,
As an example lets take Orders table and CIX_Orders is the clustered index.
1. DBCC DBReindex ('Northwind.dbo.Orders', CIX_Orders)
2.create clustered index [CIX_Orders] on [dbo].[Orders_Temp]([OrderID])
with drop_existing
How does the above two differ?
Thanks very muchOn SQL 2000 and 2005 these two should be the same.
--
HTH
Kalen Delaney, SQL Server MVP
"Ranga" <Ranga@.discussions.microsoft.com> wrote in message
news:5DF73102-DD50-4635-B712-C7FDA3609F9F@.microsoft.com...
> Working on a vendor database upgrade. They want the clustered index to be
> rebuilt. I have huge table with more than 10 million records....have a
> clustered index and 10 non-clustered indexes...
> what are my options,
> As an example lets take Orders table and CIX_Orders is the clustered
> index.
> 1. DBCC DBReindex ('Northwind.dbo.Orders', CIX_Orders)
> 2.create clustered index [CIX_Orders] on [dbo].[Orders_Temp]([OrderID])
> with drop_existing
> How does the above two differ?
> Thanks very much|||Thanks Kalen...
I am using SQL 2000
My questions is will my non-clustered indexes if I rebuild my clustered
index ?
"Kalen Delaney" wrote:
> On SQL 2000 and 2005 these two should be the same.
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
> news:5DF73102-DD50-4635-B712-C7FDA3609F9F@.microsoft.com...
> > Working on a vendor database upgrade. They want the clustered index to be
> > rebuilt. I have huge table with more than 10 million records....have a
> > clustered index and 10 non-clustered indexes...
> >
> > what are my options,
> >
> > As an example lets take Orders table and CIX_Orders is the clustered
> > index.
> >
> > 1. DBCC DBReindex ('Northwind.dbo.Orders', CIX_Orders)
> >
> > 2.create clustered index [CIX_Orders] on [dbo].[Orders_Temp]([OrderID])
> > with drop_existing
> >
> > How does the above two differ?
> >
> > Thanks very much
>
>|||Hi,
Yes it will rebuild all the non-clustered indexes if you rebuild the
clustered.
This is because the nonclustered index contains the keys of clustered
index. So to retake the new set of clustered keys; non clustered index is
rebuild.
Thanks
Hari
SQL Server MVP
"Ranga" <Ranga@.discussions.microsoft.com> wrote in message
news:7E10DBD5-A7CF-47C8-BC8F-6063AE24F4A2@.microsoft.com...
> Thanks Kalen...
> I am using SQL 2000
> My questions is will my non-clustered indexes if I rebuild my clustered
> index ?
>
> "Kalen Delaney" wrote:
>> On SQL 2000 and 2005 these two should be the same.
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>>
>> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
>> news:5DF73102-DD50-4635-B712-C7FDA3609F9F@.microsoft.com...
>> > Working on a vendor database upgrade. They want the clustered index to
>> > be
>> > rebuilt. I have huge table with more than 10 million records....have a
>> > clustered index and 10 non-clustered indexes...
>> >
>> > what are my options,
>> >
>> > As an example lets take Orders table and CIX_Orders is the clustered
>> > index.
>> >
>> > 1. DBCC DBReindex ('Northwind.dbo.Orders', CIX_Orders)
>> >
>> > 2.create clustered index [CIX_Orders] on [dbo].[Orders_Temp]([OrderID])
>> > with drop_existing
>> >
>> > How does the above two differ?
>> >
>> > Thanks very much
>>|||Not if you use one of these two methods, and you aren't redefining anything
about the indexes. If you are just rebuilding the indexes exactly as they
were for the purpose of removing fragmentation, the nonclustered indexes
will not have to be touched. That is why these two methods are preferred
over a separate drop index and create index.
--
HTH
Kalen Delaney, SQL Server MVP
"Ranga" <Ranga@.discussions.microsoft.com> wrote in message
news:7E10DBD5-A7CF-47C8-BC8F-6063AE24F4A2@.microsoft.com...
> Thanks Kalen...
> I am using SQL 2000
> My questions is will my non-clustered indexes if I rebuild my clustered
> index ?
>
> "Kalen Delaney" wrote:
>> On SQL 2000 and 2005 these two should be the same.
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>>
>> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
>> news:5DF73102-DD50-4635-B712-C7FDA3609F9F@.microsoft.com...
>> > Working on a vendor database upgrade. They want the clustered index to
>> > be
>> > rebuilt. I have huge table with more than 10 million records....have a
>> > clustered index and 10 non-clustered indexes...
>> >
>> > what are my options,
>> >
>> > As an example lets take Orders table and CIX_Orders is the clustered
>> > index.
>> >
>> > 1. DBCC DBReindex ('Northwind.dbo.Orders', CIX_Orders)
>> >
>> > 2.create clustered index [CIX_Orders] on [dbo].[Orders_Temp]([OrderID])
>> > with drop_existing
>> >
>> > How does the above two differ?
>> >
>> > Thanks very much
>>|||That is only true if the Clustered index is not unique. If it is unique and
you rebuild the clustered index it does not automatically rebuild the
non-clustered using DBREINDEX. In 2005 it does not matter if the clustered
index is unique or not since they handle the uniquifier in a much better
manor that does not change the uniquifier values when reindexed.
--
Andrew J. Kelly SQL MVP
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:%23iVBCS%23xGHA.4840@.TK2MSFTNGP04.phx.gbl...
> Hi,
> Yes it will rebuild all the non-clustered indexes if you rebuild the
> clustered.
> This is because the nonclustered index contains the keys of clustered
> index. So to retake the new set of clustered keys; non clustered index is
> rebuild.
> Thanks
> Hari
> SQL Server MVP
> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
> news:7E10DBD5-A7CF-47C8-BC8F-6063AE24F4A2@.microsoft.com...
>> Thanks Kalen...
>> I am using SQL 2000
>> My questions is will my non-clustered indexes if I rebuild my clustered
>> index ?
>>
>> "Kalen Delaney" wrote:
>> On SQL 2000 and 2005 these two should be the same.
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>>
>> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
>> news:5DF73102-DD50-4635-B712-C7FDA3609F9F@.microsoft.com...
>> > Working on a vendor database upgrade. They want the clustered index to
>> > be
>> > rebuilt. I have huge table with more than 10 million records....have
>> > a
>> > clustered index and 10 non-clustered indexes...
>> >
>> > what are my options,
>> >
>> > As an example lets take Orders table and CIX_Orders is the clustered
>> > index.
>> >
>> > 1. DBCC DBReindex ('Northwind.dbo.Orders', CIX_Orders)
>> >
>> > 2.create clustered index [CIX_Orders] on
>> > [dbo].[Orders_Temp]([OrderID])
>> > with drop_existing
>> >
>> > How does the above two differ?
>> >
>> > Thanks very much
>>
>|||Hi Ranga
It is usually more important for the non-clustered indexes to be rebuilt
than clustered indexes. The non-clustered indexes purely provide support for
query performance whilst clustered indexes are really the table storage
structure, so non-clustered indexes always play a performance role whilst
clustered indexes only provide performance support sometimes. Given the
specialised role of non-clustered indexes, it's critical that they be
re-built if you're doing this for performance reasons. We often rebuild our
non-clustered indexes many times between clustered index rebuilds..
Regards,
Greg Linwood
SQL Server MVP
"Ranga" <Ranga@.discussions.microsoft.com> wrote in message
news:7E10DBD5-A7CF-47C8-BC8F-6063AE24F4A2@.microsoft.com...
> Thanks Kalen...
> I am using SQL 2000
> My questions is will my non-clustered indexes if I rebuild my clustered
> index ?
>
> "Kalen Delaney" wrote:
>> On SQL 2000 and 2005 these two should be the same.
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>>
>> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
>> news:5DF73102-DD50-4635-B712-C7FDA3609F9F@.microsoft.com...
>> > Working on a vendor database upgrade. They want the clustered index to
>> > be
>> > rebuilt. I have huge table with more than 10 million records....have a
>> > clustered index and 10 non-clustered indexes...
>> >
>> > what are my options,
>> >
>> > As an example lets take Orders table and CIX_Orders is the clustered
>> > index.
>> >
>> > 1. DBCC DBReindex ('Northwind.dbo.Orders', CIX_Orders)
>> >
>> > 2.create clustered index [CIX_Orders] on [dbo].[Orders_Temp]([OrderID])
>> > with drop_existing
>> >
>> > How does the above two differ?
>> >
>> > Thanks very much
>>|||Hi Greg
Can you elaborate on this?
While I agree that nonclustered index have more of a performance support
role in more cases, I don't see what that has to do with rebuilding them.
How exactly are you finding that rebuilding helps with the performance
support of nonclustered indexes?
In particular, if the statistics are up to date, and you're using the nc
index to find just a few rows, why is rebuilding a necessary thing?
Since clustered indexes are the table storage, any scan or partial scan of
the data is impacted by the fragmentation of the clustered index, making it
imperative that the clustered index be rebuilt.
--
HTH
Kalen Delaney, SQL Server MVP
"Greg Linwood" <g_linwood@.hotmail.com> wrote in message
news:u%239yjE$xGHA.1936@.TK2MSFTNGP06.phx.gbl...
> Hi Ranga
> It is usually more important for the non-clustered indexes to be rebuilt
> than clustered indexes. The non-clustered indexes purely provide support
> for query performance whilst clustered indexes are really the table
> storage structure, so non-clustered indexes always play a performance role
> whilst clustered indexes only provide performance support sometimes. Given
> the specialised role of non-clustered indexes, it's critical that they be
> re-built if you're doing this for performance reasons. We often rebuild
> our non-clustered indexes many times between clustered index rebuilds..
> Regards,
> Greg Linwood
> SQL Server MVP
> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
> news:7E10DBD5-A7CF-47C8-BC8F-6063AE24F4A2@.microsoft.com...
>> Thanks Kalen...
>> I am using SQL 2000
>> My questions is will my non-clustered indexes if I rebuild my clustered
>> index ?
>>
>> "Kalen Delaney" wrote:
>> On SQL 2000 and 2005 these two should be the same.
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>>
>> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
>> news:5DF73102-DD50-4635-B712-C7FDA3609F9F@.microsoft.com...
>> > Working on a vendor database upgrade. They want the clustered index to
>> > be
>> > rebuilt. I have huge table with more than 10 million records....have
>> > a
>> > clustered index and 10 non-clustered indexes...
>> >
>> > what are my options,
>> >
>> > As an example lets take Orders table and CIX_Orders is the clustered
>> > index.
>> >
>> > 1. DBCC DBReindex ('Northwind.dbo.Orders', CIX_Orders)
>> >
>> > 2.create clustered index [CIX_Orders] on
>> > [dbo].[Orders_Temp]([OrderID])
>> > with drop_existing
>> >
>> > How does the above two differ?
>> >
>> > Thanks very much
>>
>|||Hi Kalen
Re> "and you're using the nc index to find just a few rows". This isn't a
good assumption b/c in most OLTPs, ncix's are range-scanned as much as
they're seek'd. Any range or full scan should ideally occur within a ncix
where page density is higher & read io is therefore more efficient than it
can ever be in a cix.. Any range or full scan that occurs within a cix will
always be less efficient other than in the obscure scenario where all
columns in a table are actually required by the query.
Re> Since clustered indexes are the table storage, any scan or partial scan
of the data is impacted by the fragmentation.
Not if the ncix covers the query. In this case, the fragmentation of the
ncix is all that matters & fragmentation in the cix is immaterial. Ideally,
all performance critical queries should be covered by ncixs, so this is
fairly important.
Re>How exactly are you finding that rebuilding helps with the performance
support of nonclustered indexes?
We have empirically measured proof and documented user feedback that
rebuilding ncixs alone usually improves the overall performance of otherwise
well configured oltp system. Happy to show you the data next time you're out
here too (c:
Regards,
Greg Linwood
SQL Server MVP
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:%23B3nhY$xGHA.4524@.TK2MSFTNGP04.phx.gbl...
> Hi Greg
> Can you elaborate on this?
> While I agree that nonclustered index have more of a performance support
> role in more cases, I don't see what that has to do with rebuilding them.
> How exactly are you finding that rebuilding helps with the performance
> support of nonclustered indexes?
> In particular, if the statistics are up to date, and you're using the nc
> index to find just a few rows, why is rebuilding a necessary thing?
> Since clustered indexes are the table storage, any scan or partial scan of
> the data is impacted by the fragmentation of the clustered index, making
> it imperative that the clustered index be rebuilt.
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
> news:u%239yjE$xGHA.1936@.TK2MSFTNGP06.phx.gbl...
>> Hi Ranga
>> It is usually more important for the non-clustered indexes to be rebuilt
>> than clustered indexes. The non-clustered indexes purely provide support
>> for query performance whilst clustered indexes are really the table
>> storage structure, so non-clustered indexes always play a performance
>> role whilst clustered indexes only provide performance support sometimes.
>> Given the specialised role of non-clustered indexes, it's critical that
>> they be re-built if you're doing this for performance reasons. We often
>> rebuild our non-clustered indexes many times between clustered index
>> rebuilds..
>> Regards,
>> Greg Linwood
>> SQL Server MVP
>> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
>> news:7E10DBD5-A7CF-47C8-BC8F-6063AE24F4A2@.microsoft.com...
>> Thanks Kalen...
>> I am using SQL 2000
>> My questions is will my non-clustered indexes if I rebuild my clustered
>> index ?
>>
>> "Kalen Delaney" wrote:
>> On SQL 2000 and 2005 these two should be the same.
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>>
>> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
>> news:5DF73102-DD50-4635-B712-C7FDA3609F9F@.microsoft.com...
>> > Working on a vendor database upgrade. They want the clustered index
>> > to be
>> > rebuilt. I have huge table with more than 10 million records....have
>> > a
>> > clustered index and 10 non-clustered indexes...
>> >
>> > what are my options,
>> >
>> > As an example lets take Orders table and CIX_Orders is the clustered
>> > index.
>> >
>> > 1. DBCC DBReindex ('Northwind.dbo.Orders', CIX_Orders)
>> >
>> > 2.create clustered index [CIX_Orders] on
>> > [dbo].[Orders_Temp]([OrderID])
>> > with drop_existing
>> >
>> > How does the above two differ?
>> >
>> > Thanks very much
>>
>>
>|||Thanks everyone for their feedback..this is a very interesting topic...I have
another Q..If the clustered index is part of PK constraint, what will the
exact syntax to rebuild it using the both methods (DBReindex and Create with
Drop_Existing)
Thanks,
Ranga
"Greg Linwood" wrote:
> Hi Kalen
> Re> "and you're using the nc index to find just a few rows". This isn't a
> good assumption b/c in most OLTPs, ncix's are range-scanned as much as
> they're seek'd. Any range or full scan should ideally occur within a ncix
> where page density is higher & read io is therefore more efficient than it
> can ever be in a cix.. Any range or full scan that occurs within a cix will
> always be less efficient other than in the obscure scenario where all
> columns in a table are actually required by the query.
> Re> Since clustered indexes are the table storage, any scan or partial scan
> of the data is impacted by the fragmentation.
> Not if the ncix covers the query. In this case, the fragmentation of the
> ncix is all that matters & fragmentation in the cix is immaterial. Ideally,
> all performance critical queries should be covered by ncixs, so this is
> fairly important.
> Re>How exactly are you finding that rebuilding helps with the performance
> support of nonclustered indexes?
> We have empirically measured proof and documented user feedback that
> rebuilding ncixs alone usually improves the overall performance of otherwise
> well configured oltp system. Happy to show you the data next time you're out
> here too (c:
> Regards,
> Greg Linwood
> SQL Server MVP
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:%23B3nhY$xGHA.4524@.TK2MSFTNGP04.phx.gbl...
> > Hi Greg
> >
> > Can you elaborate on this?
> >
> > While I agree that nonclustered index have more of a performance support
> > role in more cases, I don't see what that has to do with rebuilding them.
> >
> > How exactly are you finding that rebuilding helps with the performance
> > support of nonclustered indexes?
> >
> > In particular, if the statistics are up to date, and you're using the nc
> > index to find just a few rows, why is rebuilding a necessary thing?
> >
> > Since clustered indexes are the table storage, any scan or partial scan of
> > the data is impacted by the fragmentation of the clustered index, making
> > it imperative that the clustered index be rebuilt.
> >
> > --
> > HTH
> > Kalen Delaney, SQL Server MVP
> >
> >
> > "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
> > news:u%239yjE$xGHA.1936@.TK2MSFTNGP06.phx.gbl...
> >> Hi Ranga
> >>
> >> It is usually more important for the non-clustered indexes to be rebuilt
> >> than clustered indexes. The non-clustered indexes purely provide support
> >> for query performance whilst clustered indexes are really the table
> >> storage structure, so non-clustered indexes always play a performance
> >> role whilst clustered indexes only provide performance support sometimes.
> >> Given the specialised role of non-clustered indexes, it's critical that
> >> they be re-built if you're doing this for performance reasons. We often
> >> rebuild our non-clustered indexes many times between clustered index
> >> rebuilds..
> >>
> >> Regards,
> >> Greg Linwood
> >> SQL Server MVP
> >>
> >> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
> >> news:7E10DBD5-A7CF-47C8-BC8F-6063AE24F4A2@.microsoft.com...
> >> Thanks Kalen...
> >> I am using SQL 2000
> >> My questions is will my non-clustered indexes if I rebuild my clustered
> >> index ?
> >>
> >>
> >>
> >> "Kalen Delaney" wrote:
> >>
> >> On SQL 2000 and 2005 these two should be the same.
> >>
> >> --
> >> HTH
> >> Kalen Delaney, SQL Server MVP
> >>
> >>
> >> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
> >> news:5DF73102-DD50-4635-B712-C7FDA3609F9F@.microsoft.com...
> >> > Working on a vendor database upgrade. They want the clustered index
> >> > to be
> >> > rebuilt. I have huge table with more than 10 million records....have
> >> > a
> >> > clustered index and 10 non-clustered indexes...
> >> >
> >> > what are my options,
> >> >
> >> > As an example lets take Orders table and CIX_Orders is the clustered
> >> > index.
> >> >
> >> > 1. DBCC DBReindex ('Northwind.dbo.Orders', CIX_Orders)
> >> >
> >> > 2.create clustered index [CIX_Orders] on
> >> > [dbo].[Orders_Temp]([OrderID])
> >> > with drop_existing
> >> >
> >> > How does the above two differ?
> >> >
> >> > Thanks very much
> >>
> >>
> >>
> >>
> >>
> >
> >
>
>|||Hi Greg
Thanks for the detailed response. These are some very interesting points to
think about. However, you said:
> Re> Since clustered indexes are the table storage, any scan or partial
> scan of the data is impacted by the fragmentation.
> Not if the ncix covers the query.
But...if the ncix covers the query, then you don't have a scan of the data
level.
Which is what I was referring to.
:-)
--
HTH
Kalen Delaney, SQL Server MVP
"Greg Linwood" <g_linwood@.hotmail.com> wrote in message
news:OfDqnrAyGHA.4548@.TK2MSFTNGP05.phx.gbl...
> Hi Kalen
> Re> "and you're using the nc index to find just a few rows". This isn't a
> good assumption b/c in most OLTPs, ncix's are range-scanned as much as
> they're seek'd. Any range or full scan should ideally occur within a ncix
> where page density is higher & read io is therefore more efficient than it
> can ever be in a cix.. Any range or full scan that occurs within a cix
> will always be less efficient other than in the obscure scenario where all
> columns in a table are actually required by the query.
> Re> Since clustered indexes are the table storage, any scan or partial
> scan of the data is impacted by the fragmentation.
> Not if the ncix covers the query. In this case, the fragmentation of the
> ncix is all that matters & fragmentation in the cix is immaterial.
> Ideally, all performance critical queries should be covered by ncixs, so
> this is fairly important.
> Re>How exactly are you finding that rebuilding helps with the performance
> support of nonclustered indexes?
> We have empirically measured proof and documented user feedback that
> rebuilding ncixs alone usually improves the overall performance of
> otherwise well configured oltp system. Happy to show you the data next
> time you're out here too (c:
> Regards,
> Greg Linwood
> SQL Server MVP
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:%23B3nhY$xGHA.4524@.TK2MSFTNGP04.phx.gbl...
>> Hi Greg
>> Can you elaborate on this?
>> While I agree that nonclustered index have more of a performance support
>> role in more cases, I don't see what that has to do with rebuilding them.
>> How exactly are you finding that rebuilding helps with the performance
>> support of nonclustered indexes?
>> In particular, if the statistics are up to date, and you're using the nc
>> index to find just a few rows, why is rebuilding a necessary thing?
>> Since clustered indexes are the table storage, any scan or partial scan
>> of the data is impacted by the fragmentation of the clustered index,
>> making it imperative that the clustered index be rebuilt.
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>>
>> "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
>> news:u%239yjE$xGHA.1936@.TK2MSFTNGP06.phx.gbl...
>> Hi Ranga
>> It is usually more important for the non-clustered indexes to be rebuilt
>> than clustered indexes. The non-clustered indexes purely provide support
>> for query performance whilst clustered indexes are really the table
>> storage structure, so non-clustered indexes always play a performance
>> role whilst clustered indexes only provide performance support
>> sometimes. Given the specialised role of non-clustered indexes, it's
>> critical that they be re-built if you're doing this for performance
>> reasons. We often rebuild our non-clustered indexes many times between
>> clustered index rebuilds..
>> Regards,
>> Greg Linwood
>> SQL Server MVP
>> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
>> news:7E10DBD5-A7CF-47C8-BC8F-6063AE24F4A2@.microsoft.com...
>> Thanks Kalen...
>> I am using SQL 2000
>> My questions is will my non-clustered indexes if I rebuild my clustered
>> index ?
>>
>> "Kalen Delaney" wrote:
>> On SQL 2000 and 2005 these two should be the same.
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>>
>> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
>> news:5DF73102-DD50-4635-B712-C7FDA3609F9F@.microsoft.com...
>> > Working on a vendor database upgrade. They want the clustered index
>> > to be
>> > rebuilt. I have huge table with more than 10 million
>> > records....have a
>> > clustered index and 10 non-clustered indexes...
>> >
>> > what are my options,
>> >
>> > As an example lets take Orders table and CIX_Orders is the clustered
>> > index.
>> >
>> > 1. DBCC DBReindex ('Northwind.dbo.Orders', CIX_Orders)
>> >
>> > 2.create clustered index [CIX_Orders] on
>> > [dbo].[Orders_Temp]([OrderID])
>> > with drop_existing
>> >
>> > How does the above two differ?
>> >
>> > Thanks very much
>>
>>
>>
>|||Kalen,
If the clustered index is built on a indentity column which is is always in
a sequence and ordered, will there be any need to rebuild the clustered index
?
Thanks,
Ranga
"Kalen Delaney" wrote:
> Hi Greg
> Thanks for the detailed response. These are some very interesting points to
> think about. However, you said:
> > Re> Since clustered indexes are the table storage, any scan or partial
> > scan of the data is impacted by the fragmentation.
> > Not if the ncix covers the query.
> But...if the ncix covers the query, then you don't have a scan of the data
> level.
> Which is what I was referring to.
> :-)
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
> news:OfDqnrAyGHA.4548@.TK2MSFTNGP05.phx.gbl...
> > Hi Kalen
> >
> > Re> "and you're using the nc index to find just a few rows". This isn't a
> > good assumption b/c in most OLTPs, ncix's are range-scanned as much as
> > they're seek'd. Any range or full scan should ideally occur within a ncix
> > where page density is higher & read io is therefore more efficient than it
> > can ever be in a cix.. Any range or full scan that occurs within a cix
> > will always be less efficient other than in the obscure scenario where all
> > columns in a table are actually required by the query.
> >
> > Re> Since clustered indexes are the table storage, any scan or partial
> > scan of the data is impacted by the fragmentation.
> > Not if the ncix covers the query. In this case, the fragmentation of the
> > ncix is all that matters & fragmentation in the cix is immaterial.
> > Ideally, all performance critical queries should be covered by ncixs, so
> > this is fairly important.
> >
> > Re>How exactly are you finding that rebuilding helps with the performance
> > support of nonclustered indexes?
> > We have empirically measured proof and documented user feedback that
> > rebuilding ncixs alone usually improves the overall performance of
> > otherwise well configured oltp system. Happy to show you the data next
> > time you're out here too (c:
> >
> > Regards,
> > Greg Linwood
> > SQL Server MVP
> >
> > "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> > news:%23B3nhY$xGHA.4524@.TK2MSFTNGP04.phx.gbl...
> >> Hi Greg
> >>
> >> Can you elaborate on this?
> >>
> >> While I agree that nonclustered index have more of a performance support
> >> role in more cases, I don't see what that has to do with rebuilding them.
> >>
> >> How exactly are you finding that rebuilding helps with the performance
> >> support of nonclustered indexes?
> >>
> >> In particular, if the statistics are up to date, and you're using the nc
> >> index to find just a few rows, why is rebuilding a necessary thing?
> >>
> >> Since clustered indexes are the table storage, any scan or partial scan
> >> of the data is impacted by the fragmentation of the clustered index,
> >> making it imperative that the clustered index be rebuilt.
> >>
> >> --
> >> HTH
> >> Kalen Delaney, SQL Server MVP
> >>
> >>
> >> "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
> >> news:u%239yjE$xGHA.1936@.TK2MSFTNGP06.phx.gbl...
> >> Hi Ranga
> >>
> >> It is usually more important for the non-clustered indexes to be rebuilt
> >> than clustered indexes. The non-clustered indexes purely provide support
> >> for query performance whilst clustered indexes are really the table
> >> storage structure, so non-clustered indexes always play a performance
> >> role whilst clustered indexes only provide performance support
> >> sometimes. Given the specialised role of non-clustered indexes, it's
> >> critical that they be re-built if you're doing this for performance
> >> reasons. We often rebuild our non-clustered indexes many times between
> >> clustered index rebuilds..
> >>
> >> Regards,
> >> Greg Linwood
> >> SQL Server MVP
> >>
> >> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
> >> news:7E10DBD5-A7CF-47C8-BC8F-6063AE24F4A2@.microsoft.com...
> >> Thanks Kalen...
> >> I am using SQL 2000
> >> My questions is will my non-clustered indexes if I rebuild my clustered
> >> index ?
> >>
> >>
> >>
> >> "Kalen Delaney" wrote:
> >>
> >> On SQL 2000 and 2005 these two should be the same.
> >>
> >> --
> >> HTH
> >> Kalen Delaney, SQL Server MVP
> >>
> >>
> >> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
> >> news:5DF73102-DD50-4635-B712-C7FDA3609F9F@.microsoft.com...
> >> > Working on a vendor database upgrade. They want the clustered index
> >> > to be
> >> > rebuilt. I have huge table with more than 10 million
> >> > records....have a
> >> > clustered index and 10 non-clustered indexes...
> >> >
> >> > what are my options,
> >> >
> >> > As an example lets take Orders table and CIX_Orders is the clustered
> >> > index.
> >> >
> >> > 1. DBCC DBReindex ('Northwind.dbo.Orders', CIX_Orders)
> >> >
> >> > 2.create clustered index [CIX_Orders] on
> >> > [dbo].[Orders_Temp]([OrderID])
> >> > with drop_existing
> >> >
> >> > How does the above two differ?
> >> >
> >> > Thanks very much
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
>
>|||Are you ever updating any of the rows?
--
HTH
Kalen Delaney, SQL Server MVP
"Ranga" <Ranga@.discussions.microsoft.com> wrote in message
news:A8FA0118-2C2A-439F-8B68-2EC595253BC9@.microsoft.com...
> Kalen,
> If the clustered index is built on a indentity column which is is always
> in
> a sequence and ordered, will there be any need to rebuild the clustered
> index
> ?
> Thanks,
> Ranga
> "Kalen Delaney" wrote:
>> Hi Greg
>> Thanks for the detailed response. These are some very interesting points
>> to
>> think about. However, you said:
>> > Re> Since clustered indexes are the table storage, any scan or partial
>> > scan of the data is impacted by the fragmentation.
>> > Not if the ncix covers the query.
>> But...if the ncix covers the query, then you don't have a scan of the
>> data
>> level.
>> Which is what I was referring to.
>> :-)
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>>
>> "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
>> news:OfDqnrAyGHA.4548@.TK2MSFTNGP05.phx.gbl...
>> > Hi Kalen
>> >
>> > Re> "and you're using the nc index to find just a few rows". This isn't
>> > a
>> > good assumption b/c in most OLTPs, ncix's are range-scanned as much as
>> > they're seek'd. Any range or full scan should ideally occur within a
>> > ncix
>> > where page density is higher & read io is therefore more efficient than
>> > it
>> > can ever be in a cix.. Any range or full scan that occurs within a cix
>> > will always be less efficient other than in the obscure scenario where
>> > all
>> > columns in a table are actually required by the query.
>> >
>> > Re> Since clustered indexes are the table storage, any scan or partial
>> > scan of the data is impacted by the fragmentation.
>> > Not if the ncix covers the query. In this case, the fragmentation of
>> > the
>> > ncix is all that matters & fragmentation in the cix is immaterial.
>> > Ideally, all performance critical queries should be covered by ncixs,
>> > so
>> > this is fairly important.
>> >
>> > Re>How exactly are you finding that rebuilding helps with the
>> > performance
>> > support of nonclustered indexes?
>> > We have empirically measured proof and documented user feedback that
>> > rebuilding ncixs alone usually improves the overall performance of
>> > otherwise well configured oltp system. Happy to show you the data next
>> > time you're out here too (c:
>> >
>> > Regards,
>> > Greg Linwood
>> > SQL Server MVP
>> >
>> > "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
>> > news:%23B3nhY$xGHA.4524@.TK2MSFTNGP04.phx.gbl...
>> >> Hi Greg
>> >>
>> >> Can you elaborate on this?
>> >>
>> >> While I agree that nonclustered index have more of a performance
>> >> support
>> >> role in more cases, I don't see what that has to do with rebuilding
>> >> them.
>> >>
>> >> How exactly are you finding that rebuilding helps with the performance
>> >> support of nonclustered indexes?
>> >>
>> >> In particular, if the statistics are up to date, and you're using the
>> >> nc
>> >> index to find just a few rows, why is rebuilding a necessary thing?
>> >>
>> >> Since clustered indexes are the table storage, any scan or partial
>> >> scan
>> >> of the data is impacted by the fragmentation of the clustered index,
>> >> making it imperative that the clustered index be rebuilt.
>> >>
>> >> --
>> >> HTH
>> >> Kalen Delaney, SQL Server MVP
>> >>
>> >>
>> >> "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
>> >> news:u%239yjE$xGHA.1936@.TK2MSFTNGP06.phx.gbl...
>> >> Hi Ranga
>> >>
>> >> It is usually more important for the non-clustered indexes to be
>> >> rebuilt
>> >> than clustered indexes. The non-clustered indexes purely provide
>> >> support
>> >> for query performance whilst clustered indexes are really the table
>> >> storage structure, so non-clustered indexes always play a performance
>> >> role whilst clustered indexes only provide performance support
>> >> sometimes. Given the specialised role of non-clustered indexes, it's
>> >> critical that they be re-built if you're doing this for performance
>> >> reasons. We often rebuild our non-clustered indexes many times
>> >> between
>> >> clustered index rebuilds..
>> >>
>> >> Regards,
>> >> Greg Linwood
>> >> SQL Server MVP
>> >>
>> >> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
>> >> news:7E10DBD5-A7CF-47C8-BC8F-6063AE24F4A2@.microsoft.com...
>> >> Thanks Kalen...
>> >> I am using SQL 2000
>> >> My questions is will my non-clustered indexes if I rebuild my
>> >> clustered
>> >> index ?
>> >>
>> >>
>> >>
>> >> "Kalen Delaney" wrote:
>> >>
>> >> On SQL 2000 and 2005 these two should be the same.
>> >>
>> >> --
>> >> HTH
>> >> Kalen Delaney, SQL Server MVP
>> >>
>> >>
>> >> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
>> >> news:5DF73102-DD50-4635-B712-C7FDA3609F9F@.microsoft.com...
>> >> > Working on a vendor database upgrade. They want the clustered
>> >> > index
>> >> > to be
>> >> > rebuilt. I have huge table with more than 10 million
>> >> > records....have a
>> >> > clustered index and 10 non-clustered indexes...
>> >> >
>> >> > what are my options,
>> >> >
>> >> > As an example lets take Orders table and CIX_Orders is the
>> >> > clustered
>> >> > index.
>> >> >
>> >> > 1. DBCC DBReindex ('Northwind.dbo.Orders', CIX_Orders)
>> >> >
>> >> > 2.create clustered index [CIX_Orders] on
>> >> > [dbo].[Orders_Temp]([OrderID])
>> >> > with drop_existing
>> >> >
>> >> > How does the above two differ?
>> >> >
>> >> > Thanks very much
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>>|||Yes...
"Kalen Delaney" wrote:
> Are you ever updating any of the rows?
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
> news:A8FA0118-2C2A-439F-8B68-2EC595253BC9@.microsoft.com...
> > Kalen,
> > If the clustered index is built on a indentity column which is is always
> > in
> > a sequence and ordered, will there be any need to rebuild the clustered
> > index
> > ?
> >
> > Thanks,
> > Ranga
> >
> > "Kalen Delaney" wrote:
> >
> >> Hi Greg
> >>
> >> Thanks for the detailed response. These are some very interesting points
> >> to
> >> think about. However, you said:
> >>
> >> > Re> Since clustered indexes are the table storage, any scan or partial
> >> > scan of the data is impacted by the fragmentation.
> >> > Not if the ncix covers the query.
> >>
> >> But...if the ncix covers the query, then you don't have a scan of the
> >> data
> >> level.
> >> Which is what I was referring to.
> >> :-)
> >> --
> >> HTH
> >> Kalen Delaney, SQL Server MVP
> >>
> >>
> >> "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
> >> news:OfDqnrAyGHA.4548@.TK2MSFTNGP05.phx.gbl...
> >> > Hi Kalen
> >> >
> >> > Re> "and you're using the nc index to find just a few rows". This isn't
> >> > a
> >> > good assumption b/c in most OLTPs, ncix's are range-scanned as much as
> >> > they're seek'd. Any range or full scan should ideally occur within a
> >> > ncix
> >> > where page density is higher & read io is therefore more efficient than
> >> > it
> >> > can ever be in a cix.. Any range or full scan that occurs within a cix
> >> > will always be less efficient other than in the obscure scenario where
> >> > all
> >> > columns in a table are actually required by the query.
> >> >
> >> > Re> Since clustered indexes are the table storage, any scan or partial
> >> > scan of the data is impacted by the fragmentation.
> >> > Not if the ncix covers the query. In this case, the fragmentation of
> >> > the
> >> > ncix is all that matters & fragmentation in the cix is immaterial.
> >> > Ideally, all performance critical queries should be covered by ncixs,
> >> > so
> >> > this is fairly important.
> >> >
> >> > Re>How exactly are you finding that rebuilding helps with the
> >> > performance
> >> > support of nonclustered indexes?
> >> > We have empirically measured proof and documented user feedback that
> >> > rebuilding ncixs alone usually improves the overall performance of
> >> > otherwise well configured oltp system. Happy to show you the data next
> >> > time you're out here too (c:
> >> >
> >> > Regards,
> >> > Greg Linwood
> >> > SQL Server MVP
> >> >
> >> > "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> >> > news:%23B3nhY$xGHA.4524@.TK2MSFTNGP04.phx.gbl...
> >> >> Hi Greg
> >> >>
> >> >> Can you elaborate on this?
> >> >>
> >> >> While I agree that nonclustered index have more of a performance
> >> >> support
> >> >> role in more cases, I don't see what that has to do with rebuilding
> >> >> them.
> >> >>
> >> >> How exactly are you finding that rebuilding helps with the performance
> >> >> support of nonclustered indexes?
> >> >>
> >> >> In particular, if the statistics are up to date, and you're using the
> >> >> nc
> >> >> index to find just a few rows, why is rebuilding a necessary thing?
> >> >>
> >> >> Since clustered indexes are the table storage, any scan or partial
> >> >> scan
> >> >> of the data is impacted by the fragmentation of the clustered index,
> >> >> making it imperative that the clustered index be rebuilt.
> >> >>
> >> >> --
> >> >> HTH
> >> >> Kalen Delaney, SQL Server MVP
> >> >>
> >> >>
> >> >> "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
> >> >> news:u%239yjE$xGHA.1936@.TK2MSFTNGP06.phx.gbl...
> >> >> Hi Ranga
> >> >>
> >> >> It is usually more important for the non-clustered indexes to be
> >> >> rebuilt
> >> >> than clustered indexes. The non-clustered indexes purely provide
> >> >> support
> >> >> for query performance whilst clustered indexes are really the table
> >> >> storage structure, so non-clustered indexes always play a performance
> >> >> role whilst clustered indexes only provide performance support
> >> >> sometimes. Given the specialised role of non-clustered indexes, it's
> >> >> critical that they be re-built if you're doing this for performance
> >> >> reasons. We often rebuild our non-clustered indexes many times
> >> >> between
> >> >> clustered index rebuilds..
> >> >>
> >> >> Regards,
> >> >> Greg Linwood
> >> >> SQL Server MVP
> >> >>
> >> >> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
> >> >> news:7E10DBD5-A7CF-47C8-BC8F-6063AE24F4A2@.microsoft.com...
> >> >> Thanks Kalen...
> >> >> I am using SQL 2000
> >> >> My questions is will my non-clustered indexes if I rebuild my
> >> >> clustered
> >> >> index ?
> >> >>
> >> >>
> >> >>
> >> >> "Kalen Delaney" wrote:
> >> >>
> >> >> On SQL 2000 and 2005 these two should be the same.
> >> >>
> >> >> --
> >> >> HTH
> >> >> Kalen Delaney, SQL Server MVP
> >> >>
> >> >>
> >> >> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
> >> >> news:5DF73102-DD50-4635-B712-C7FDA3609F9F@.microsoft.com...
> >> >> > Working on a vendor database upgrade. They want the clustered
> >> >> > index
> >> >> > to be
> >> >> > rebuilt. I have huge table with more than 10 million
> >> >> > records....have a
> >> >> > clustered index and 10 non-clustered indexes...
> >> >> >
> >> >> > what are my options,
> >> >> >
> >> >> > As an example lets take Orders table and CIX_Orders is the
> >> >> > clustered
> >> >> > index.
> >> >> >
> >> >> > 1. DBCC DBReindex ('Northwind.dbo.Orders', CIX_Orders)
> >> >> >
> >> >> > 2.create clustered index [CIX_Orders] on
> >> >> > [dbo].[Orders_Temp]([OrderID])
> >> >> > with drop_existing
> >> >> >
> >> >> > How does the above two differ?
> >> >> >
> >> >> > Thanks very much
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >>
>
>|||Updates sometimes requires that rows have to split, if you change the
clustered key, or if the row becomes larger, and page splitting causes
fragmentation. So you might need to rebuild your clustered index.
--
HTH
Kalen Delaney, SQL Server MVP
"Ranga" <Ranga@.discussions.microsoft.com> wrote in message
news:E547F7AF-D4F5-4F3D-A8D1-634B8FE65513@.microsoft.com...
> Yes...
> "Kalen Delaney" wrote:
>> Are you ever updating any of the rows?
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>>
>> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
>> news:A8FA0118-2C2A-439F-8B68-2EC595253BC9@.microsoft.com...
>> > Kalen,
>> > If the clustered index is built on a indentity column which is is
>> > always
>> > in
>> > a sequence and ordered, will there be any need to rebuild the clustered
>> > index
>> > ?
>> >
>> > Thanks,
>> > Ranga
>> >
>> > "Kalen Delaney" wrote:
>> >
>> >> Hi Greg
>> >>
>> >> Thanks for the detailed response. These are some very interesting
>> >> points
>> >> to
>> >> think about. However, you said:
>> >>
>> >> > Re> Since clustered indexes are the table storage, any scan or
>> >> > partial
>> >> > scan of the data is impacted by the fragmentation.
>> >> > Not if the ncix covers the query.
>> >>
>> >> But...if the ncix covers the query, then you don't have a scan of the
>> >> data
>> >> level.
>> >> Which is what I was referring to.
>> >> :-)
>> >> --
>> >> HTH
>> >> Kalen Delaney, SQL Server MVP
>> >>
>> >>
>> >> "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
>> >> news:OfDqnrAyGHA.4548@.TK2MSFTNGP05.phx.gbl...
>> >> > Hi Kalen
>> >> >
>> >> > Re> "and you're using the nc index to find just a few rows". This
>> >> > isn't
>> >> > a
>> >> > good assumption b/c in most OLTPs, ncix's are range-scanned as much
>> >> > as
>> >> > they're seek'd. Any range or full scan should ideally occur within a
>> >> > ncix
>> >> > where page density is higher & read io is therefore more efficient
>> >> > than
>> >> > it
>> >> > can ever be in a cix.. Any range or full scan that occurs within a
>> >> > cix
>> >> > will always be less efficient other than in the obscure scenario
>> >> > where
>> >> > all
>> >> > columns in a table are actually required by the query.
>> >> >
>> >> > Re> Since clustered indexes are the table storage, any scan or
>> >> > partial
>> >> > scan of the data is impacted by the fragmentation.
>> >> > Not if the ncix covers the query. In this case, the fragmentation of
>> >> > the
>> >> > ncix is all that matters & fragmentation in the cix is immaterial.
>> >> > Ideally, all performance critical queries should be covered by
>> >> > ncixs,
>> >> > so
>> >> > this is fairly important.
>> >> >
>> >> > Re>How exactly are you finding that rebuilding helps with the
>> >> > performance
>> >> > support of nonclustered indexes?
>> >> > We have empirically measured proof and documented user feedback that
>> >> > rebuilding ncixs alone usually improves the overall performance of
>> >> > otherwise well configured oltp system. Happy to show you the data
>> >> > next
>> >> > time you're out here too (c:
>> >> >
>> >> > Regards,
>> >> > Greg Linwood
>> >> > SQL Server MVP
>> >> >
>> >> > "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
>> >> > news:%23B3nhY$xGHA.4524@.TK2MSFTNGP04.phx.gbl...
>> >> >> Hi Greg
>> >> >>
>> >> >> Can you elaborate on this?
>> >> >>
>> >> >> While I agree that nonclustered index have more of a performance
>> >> >> support
>> >> >> role in more cases, I don't see what that has to do with rebuilding
>> >> >> them.
>> >> >>
>> >> >> How exactly are you finding that rebuilding helps with the
>> >> >> performance
>> >> >> support of nonclustered indexes?
>> >> >>
>> >> >> In particular, if the statistics are up to date, and you're using
>> >> >> the
>> >> >> nc
>> >> >> index to find just a few rows, why is rebuilding a necessary thing?
>> >> >>
>> >> >> Since clustered indexes are the table storage, any scan or partial
>> >> >> scan
>> >> >> of the data is impacted by the fragmentation of the clustered
>> >> >> index,
>> >> >> making it imperative that the clustered index be rebuilt.
>> >> >>
>> >> >> --
>> >> >> HTH
>> >> >> Kalen Delaney, SQL Server MVP
>> >> >>
>> >> >>
>> >> >> "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
>> >> >> news:u%239yjE$xGHA.1936@.TK2MSFTNGP06.phx.gbl...
>> >> >> Hi Ranga
>> >> >>
>> >> >> It is usually more important for the non-clustered indexes to be
>> >> >> rebuilt
>> >> >> than clustered indexes. The non-clustered indexes purely provide
>> >> >> support
>> >> >> for query performance whilst clustered indexes are really the
>> >> >> table
>> >> >> storage structure, so non-clustered indexes always play a
>> >> >> performance
>> >> >> role whilst clustered indexes only provide performance support
>> >> >> sometimes. Given the specialised role of non-clustered indexes,
>> >> >> it's
>> >> >> critical that they be re-built if you're doing this for
>> >> >> performance
>> >> >> reasons. We often rebuild our non-clustered indexes many times
>> >> >> between
>> >> >> clustered index rebuilds..
>> >> >>
>> >> >> Regards,
>> >> >> Greg Linwood
>> >> >> SQL Server MVP
>> >> >>
>> >> >> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
>> >> >> news:7E10DBD5-A7CF-47C8-BC8F-6063AE24F4A2@.microsoft.com...
>> >> >> Thanks Kalen...
>> >> >> I am using SQL 2000
>> >> >> My questions is will my non-clustered indexes if I rebuild my
>> >> >> clustered
>> >> >> index ?
>> >> >>
>> >> >>
>> >> >>
>> >> >> "Kalen Delaney" wrote:
>> >> >>
>> >> >> On SQL 2000 and 2005 these two should be the same.
>> >> >>
>> >> >> --
>> >> >> HTH
>> >> >> Kalen Delaney, SQL Server MVP
>> >> >>
>> >> >>
>> >> >> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
>> >> >> news:5DF73102-DD50-4635-B712-C7FDA3609F9F@.microsoft.com...
>> >> >> > Working on a vendor database upgrade. They want the clustered
>> >> >> > index
>> >> >> > to be
>> >> >> > rebuilt. I have huge table with more than 10 million
>> >> >> > records....have a
>> >> >> > clustered index and 10 non-clustered indexes...
>> >> >> >
>> >> >> > what are my options,
>> >> >> >
>> >> >> > As an example lets take Orders table and CIX_Orders is the
>> >> >> > clustered
>> >> >> > index.
>> >> >> >
>> >> >> > 1. DBCC DBReindex ('Northwind.dbo.Orders', CIX_Orders)
>> >> >> >
>> >> >> > 2.create clustered index [CIX_Orders] on
>> >> >> > [dbo].[Orders_Temp]([OrderID])
>> >> >> > with drop_existing
>> >> >> >
>> >> >> > How does the above two differ?
>> >> >> >
>> >> >> > Thanks very much
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >>
>> >>
>>|||I'm really trying to point out to Ranga that he's on the wrong path in
trying to avoid rebuilding his non-clustered indexes whilst rebuilding his
clustered indexes. This is a very common trap for inexperienced DBAs or
software vendors (as appears to be the case this time) who don't work with
indexes a lot - they often miss the point that performace is mainly governed
by non-clustered indexes, not clustered indexes & that there's usually far
less to be gained from rebuilding CIXs than NCIXs. You'll usually get far
more performance improvement from rebuilding your NCIXs than your CIXs -
there are very good reasons for rebuildinig NCIXs without rebuilding CIXs,
but usually not the other way around..
Regards,
Greg Linwood
SQL Server MVP
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:u05NTXGyGHA.3440@.TK2MSFTNGP06.phx.gbl...
> Hi Greg
> Thanks for the detailed response. These are some very interesting points
> to think about. However, you said:
>> Re> Since clustered indexes are the table storage, any scan or partial
>> scan of the data is impacted by the fragmentation.
>> Not if the ncix covers the query.
> But...if the ncix covers the query, then you don't have a scan of the data
> level.
> Which is what I was referring to.
> :-)
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
> news:OfDqnrAyGHA.4548@.TK2MSFTNGP05.phx.gbl...
>> Hi Kalen
>> Re> "and you're using the nc index to find just a few rows". This isn't a
>> good assumption b/c in most OLTPs, ncix's are range-scanned as much as
>> they're seek'd. Any range or full scan should ideally occur within a ncix
>> where page density is higher & read io is therefore more efficient than
>> it can ever be in a cix.. Any range or full scan that occurs within a cix
>> will always be less efficient other than in the obscure scenario where
>> all columns in a table are actually required by the query.
>> Re> Since clustered indexes are the table storage, any scan or partial
>> scan of the data is impacted by the fragmentation.
>> Not if the ncix covers the query. In this case, the fragmentation of the
>> ncix is all that matters & fragmentation in the cix is immaterial.
>> Ideally, all performance critical queries should be covered by ncixs, so
>> this is fairly important.
>> Re>How exactly are you finding that rebuilding helps with the performance
>> support of nonclustered indexes?
>> We have empirically measured proof and documented user feedback that
>> rebuilding ncixs alone usually improves the overall performance of
>> otherwise well configured oltp system. Happy to show you the data next
>> time you're out here too (c:
>> Regards,
>> Greg Linwood
>> SQL Server MVP
>> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
>> news:%23B3nhY$xGHA.4524@.TK2MSFTNGP04.phx.gbl...
>> Hi Greg
>> Can you elaborate on this?
>> While I agree that nonclustered index have more of a performance support
>> role in more cases, I don't see what that has to do with rebuilding
>> them.
>> How exactly are you finding that rebuilding helps with the performance
>> support of nonclustered indexes?
>> In particular, if the statistics are up to date, and you're using the nc
>> index to find just a few rows, why is rebuilding a necessary thing?
>> Since clustered indexes are the table storage, any scan or partial scan
>> of the data is impacted by the fragmentation of the clustered index,
>> making it imperative that the clustered index be rebuilt.
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>>
>> "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
>> news:u%239yjE$xGHA.1936@.TK2MSFTNGP06.phx.gbl...
>> Hi Ranga
>> It is usually more important for the non-clustered indexes to be
>> rebuilt than clustered indexes. The non-clustered indexes purely
>> provide support for query performance whilst clustered indexes are
>> really the table storage structure, so non-clustered indexes always
>> play a performance role whilst clustered indexes only provide
>> performance support sometimes. Given the specialised role of
>> non-clustered indexes, it's critical that they be re-built if you're
>> doing this for performance reasons. We often rebuild our non-clustered
>> indexes many times between clustered index rebuilds..
>> Regards,
>> Greg Linwood
>> SQL Server MVP
>> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
>> news:7E10DBD5-A7CF-47C8-BC8F-6063AE24F4A2@.microsoft.com...
>> Thanks Kalen...
>> I am using SQL 2000
>> My questions is will my non-clustered indexes if I rebuild my
>> clustered
>> index ?
>>
>> "Kalen Delaney" wrote:
>> On SQL 2000 and 2005 these two should be the same.
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>>
>> "Ranga" <Ranga@.discussions.microsoft.com> wrote in message
>> news:5DF73102-DD50-4635-B712-C7FDA3609F9F@.microsoft.com...
>> > Working on a vendor database upgrade. They want the clustered index
>> > to be
>> > rebuilt. I have huge table with more than 10 million
>> > records....have a
>> > clustered index and 10 non-clustered indexes...
>> >
>> > what are my options,
>> >
>> > As an example lets take Orders table and CIX_Orders is the
>> > clustered
>> > index.
>> >
>> > 1. DBCC DBReindex ('Northwind.dbo.Orders', CIX_Orders)
>> >
>> > 2.create clustered index [CIX_Orders] on
>> > [dbo].[Orders_Temp]([OrderID])
>> > with drop_existing
>> >
>> > How does the above two differ?
>> >
>> > Thanks very much
>>
>>
>>
>>
>