INTERVIEW PREPARATION IN 30 MINs – Read Following wires for a quick interview preparation.
REBUILD INDEX ONLINE OR OFFLINE??
ALTER INDEX IndexName ON TableName REBUILD WITH (ONLINE = ON)
ALTER INDEX IndexName ON TableName REBUILD
I am just scared why some DBAs don’t take care of small things. I asked one of my DBA to REBUILD the indexes of a table which is nothing but HBI data. What command will you use doing that? Definately ALTER INDEX IndexName ON TableName REBUILD. But wait. Do you think that users would be able to access the table when the rebuild process is going on?
Either inform the users that you are going to have the DB offline (I mean downtime here) or do this WITH (ONLINE=ON). Directly applying the REBUILD command can cause a significant outage.
Just be careful….it goes like this. If Clustered index is rebuilt OFFLINE then any user won’t be able to access the data of the table on which operation is being performed. The reason is SCHEMA lock on the table. If non clustered index is rebuilt then SELECT query can be performed but any update/insert and delete won’t work. So Just be careful…
Following blogs will help you prepare for IT Industry Interviews and Walk-Ins.
- SQL Server DBA “Interview Questions And Answers”
- MS SQL Corruption: “Msg 2627 – Violation of PRIMARY KEY constraint”
- SQL Server 2008 R2 – Foreign Key – DELETE CASCADE and DELETE UDPATE
- MSSQL Server – DBCC LOGINFO – Status 2. Log File FULL. Verify log_reuse_wait_desc
- SSRS Report – Adding Header and Footer
Online MSSQL Classes @ http://tuitionaffordable.webstarts.com