Optimization job failed

  • Hi

    I have created Maintenances plan in the sql server 2000

    All the jobs are running but my optimization job failed

    I have set up all the options

    SET QUOTED_IDENTIFIER on

    SET ARITHABORT ON

    SET ARITHIGNORE ON

    but still is failing

    Can someone help me out

    Many thanks in advance

    PK

  • Are you getting any specific error?

  • Hi shahab,

    Thank you for quick response

    No I am not getting any error message but big red X is showing front of Optimization job Failed .

    Thank.

    PK

  • Right click on the job and check the job history for any error.

  • Shahab,

    I checked job history  and following error is showing

    The job faield: the job was invoked user sa the last step to run was step 1(step1)

    PK

  • try running it under the same user as sqlserveragent.

  • Actually I did try that too. Instead of sa the same user as sqlserveragent.

  • unfortunately this doesnt give me enough info to troubleshoot the issue.

  • Hi, open Query Analyser and try this and see how you get on. Rgds Derek

    DECLARE @InstallPath NVARCHAR(128),

     @DatabaseName NVARCHAR(128),

     @parms   NVARCHAR(256),

     @Report   NVARCHAR(128),

     @returncode  INT,

     @cmd   NVARCHAR(4000)

     

    SET @DatabaseName = 'YourDataBase'

    SET @Report = 'Where you want to put the output'

     SELECT @parms =

      '-D ' + @DatabaseName + ' ' +

      '-Rpt ' + @Report + ' ' +

      '-DelTxtRpt 4WEEKS ' +

      '-WriteHistory ' +

      '-RebldIdx 100 '

     EXECUTE @ReturnCode = master.dbo.xp_sqlmaint @parms

     IF @ReturnCode <> 0

      BEGIN

      PRINT 'Received @ReturnCode = ' +

       CONVERT(char(10),@ReturnCode) +

       'attempting to execute xp_sqlmaint'

      PRINT '@parms = ' + @parms

      END

    GO

  • To get the history from the job step, click the box "Show step details". This hopefully will give you little better info.

    Mark

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply