Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Reorg,Rebuild index job failed

Author  Topic 

DBA007
Posting Yak Master

145 Posts

Posted - 2010-02-01 : 11:48:20
Team,
My Rebuild,Reorganize index job has been failing because of the following error,it is scheduled to be executed in only one db and the db is in simple mode.

ON [my].[User] REBUILD [SQLSTATE 01000] (Message 0) Executed: ALTER INDEX [IX_myUser_UserID] ON [my].[User] REBUILD [SQLSTATE 01000] (Message 0) Executed: ALTER INDEX [IX_EmPID] ON [EMPSs].[EMP] REORGANIZE [SQLSTATE 01000] (Message 0) Executed: ALTER INDEX [idx_TypeID] ON [EMPs].[EMP] REORGANIZE [SQLSTATE 01000] (Message 0) Executed: ALTER INDEX [IX_Files] ON [dbo].[Unload] REBUILD [SQLSTATE 01000] (Message 0) Executed: ALTER INDEX [IX_CardID] ON [Card].[Time] REBUILD [SQLSTATE 01000] (Message 0) Executed: ALTER INDEX [PK_PowerID] ON [dbo].[Power] REBUILD [SQLSTATE 01000] (Message 0) Executed: ALT... The step failed.

Kristen
Test

22859 Posts

Posted - 2010-02-01 : 12:13:09
As per usual such JOBs tell us nothing / little about the problem.

What happens if you rebuild the indexes manually, what message do you see then?
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2010-02-01 : 13:21:55
This does not give any error . I would recommend , you put a "print" on your script , and save to a Log file - configure this in the Advanced section of your joib step. When the job runs you should get a print out of of all the attempted ALTER INDEX statements , and the failures.

Jack Vamvas
--------------------
http://www.ITjobfeed.com
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-02-01 : 13:26:39
"on your script"

I think this is probably Wizard-generated
Go to Top of Page

DBA007
Posting Yak Master

145 Posts

Posted - 2010-02-01 : 13:37:18
no,this job was not wizard generated,it was written using TSQL
Go to Top of Page

DBA007
Posting Yak Master

145 Posts

Posted - 2010-02-01 : 13:51:21
HI,
in the file i got the message for all indexes as follows
Executed: ALTER INDEX [IX_ActGUID] ON [dbo].[Primt] REBUILD [SQLSTATE 01000]
Msg 1934, Sev 16, State 1, Line 1 : ALTER INDEX failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or query notifications and/or xml data type methods. [SQLSTATE 42000]
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-02-01 : 14:04:51
"no,this job was not wizard generated,it was written using TSQL"

OK, that's good, makes it easy to re-run "manually" to see any messages - and, indeed, to modify to Log "progress" or "debugging" messages.

You probably have a Computed Column in that table / index.

I find Computed Columns a PITA in so many ways, like this, that we now avoid them.

I don't know the deal here; my guess is that either the Index should have been created with SET QUOTED_IDENTIFIER ON, or the re-indexing SProc should have been created with that state.
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2010-02-01 : 14:18:19
Put the following at the start of your script

SET ARITHABORT ON
SET QUOTED_IDENTIFIER ON


Jack Vamvas
--------------------
http://www.ITjobfeed.com
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-02-01 : 14:32:42
"Put the following at the start of your script"

The index rebuild script?

or the CREATE INDEX script?

or the CREATE Computed Column script?

I have never understood what QUOTED_IDENTIFIER is supposed to achieve, and when it is supposed to be used.
Go to Top of Page

DBA007
Posting Yak Master

145 Posts

Posted - 2010-02-01 : 14:40:48
thanks jackv,
the job has executed successfully but on the txt file for every index i got the messages as follows.

Executed: ALTER INDEX [PK_User] ON [dbo].[one] REORGANIZE [SQLSTATE 01000]

what is this [SQLSTATE 01000] ?
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-02-01 : 16:31:15
"the job has executed successfully"

Has it? You posted an error message above?? or did you fix that? and if so I'd be interested to know what change you made?
Go to Top of Page

DBA007
Posting Yak Master

145 Posts

Posted - 2010-02-01 : 16:51:19
I mean the job was executed,with out showing any errors,but on the txt file,I get these statements for all the indexes in the database as
Executed: ALTER INDEX [IX_Group] ON [dbo].[Quoted] REBUILD [SQLSTATE 01000]
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-02-01 : 16:53:24
I expect they are benign.

Did you manage to fix "INDEX failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or query notifications and/or xml data type methods"?
Go to Top of Page

DBA007
Posting Yak Master

145 Posts

Posted - 2010-02-01 : 16:58:54
no, I have added the QUOTED_IDENTIFIER,ARITHABORT to set to ON
Go to Top of Page

DBA007
Posting Yak Master

145 Posts

Posted - 2010-02-01 : 17:30:39
the indexes have not rebild or reorganized,but with the messages as [SQLSTATE 01000] for all the rebuild and reorganize.
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2010-02-02 : 03:34:44
As far as I know when the [SQLSTATE 01000] is part of the print functionality

Jack Vamvas
--------------------
http://www.ITjobfeed.com
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2010-02-02 : 03:38:30
The QUOTED_IDENTIFIER force the script to follow rules regarding identifiers and literals.
The ARITHABORT deals with the divide by zero

Jack Vamvas
--------------------
http://www.ITjobfeed.com
Go to Top of Page
   

- Advertisement -