sqlmaint.exe failed

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Trevor Best

    sqlmaint.exe failed

    I have a maintenance plan on a client's site, there's only one database
    in the plan and it's set to backup db and log, this job fails
    consistently. The one step in the job contains this line:

    EXECUTE master.dbo.xp_s qlmaint N'-PlanID
    392B2334-6800-4655-A6C7-5414D9072505 -WriteHistory -VrfyBackup
    -BkUpMedia DISK -BkUpDB "C:\Program Files\Microsoft SQL
    Server\MSSQL\BA CKUP\DailyBacku ps" -DelBkUps 4WEEKS -BkExt "BAK"'

    Which fails if run in QA with the message:

    Server: Msg 22029, Level 16, State 1, Line 0
    sqlmaint.exe failed.

    I've searched for this error and cannot find anything to help.
    There's no "-S" in the path, it writes absolutely no history on the
    plan. I set the plan to write history in the log directory on the
    server, it wrote nothing to that directory.

    The database doesn't get backed up but is able to be backed up manually
    to the path specified in the plan. I also have a separate job with a
    SQL backup statement in it that works OK so SQLAgent is working.

  • John Bell

    #2
    Re: sqlmaint.exe failed

    Hi Trevor

    I assume you have read


    You may want to look at writing the history to a text file and the option to
    do more verbose logging from SQL agent in:


    Also check out which database you are applying the plan to:


    You may want to consider writing your own set of maintenance routines that
    give you more information.

    HTH

    John

    "Trevor Best" <googlegroups@b esty.org.uk> wrote in message
    news:1126482331 .316173.127270@ z14g2000cwz.goo glegroups.com.. .[color=blue]
    >I have a maintenance plan on a client's site, there's only one database
    > in the plan and it's set to backup db and log, this job fails
    > consistently. The one step in the job contains this line:
    >
    > EXECUTE master.dbo.xp_s qlmaint N'-PlanID
    > 392B2334-6800-4655-A6C7-5414D9072505 -WriteHistory -VrfyBackup
    > -BkUpMedia DISK -BkUpDB "C:\Program Files\Microsoft SQL
    > Server\MSSQL\BA CKUP\DailyBacku ps" -DelBkUps 4WEEKS -BkExt "BAK"'
    >
    > Which fails if run in QA with the message:
    >
    > Server: Msg 22029, Level 16, State 1, Line 0
    > sqlmaint.exe failed.
    >
    > I've searched for this error and cannot find anything to help.
    > There's no "-S" in the path, it writes absolutely no history on the
    > plan. I set the plan to write history in the log directory on the
    > server, it wrote nothing to that directory.
    >
    > The database doesn't get backed up but is able to be backed up manually
    > to the path specified in the plan. I also have a separate job with a
    > SQL backup statement in it that works OK so SQLAgent is working.
    >[/color]


    Comment

    • Trevor Best

      #3
      Re: sqlmaint.exe failed

      Thanks, I've read the links you provided but none have helped.

      I can actually run the plan from an NT command prompt window and the
      backup runs OK and the plan exits with code 0 (success).

      It's just running from the SQLAgent or from Query analyser it fails
      immediately without having done anything. It's as though it just can't
      execute sqlmaint.exe. I can run other xps such as xp_msver without
      trouble so I'm sure the paths are correct.

      I checked HKLM\SOFTWARE\M icrosoft\MSSQLS erver\Setup (not where the
      first link says it is) and the path is set correctly.

      Comment

      • John Bell

        #4
        Re: sqlmaint.exe failed

        Hi

        That would imply permissions is an issue, have you changed the service
        account or directory permissions/locations?

        John

        "Trevor Best" <googlegroups@b esty.org.uk> wrote in message
        news:1126541866 .564969.175060@ g14g2000cwa.goo glegroups.com.. .[color=blue]
        > Thanks, I've read the links you provided but none have helped.
        >
        > I can actually run the plan from an NT command prompt window and the
        > backup runs OK and the plan exits with code 0 (success).
        >
        > It's just running from the SQLAgent or from Query analyser it fails
        > immediately without having done anything. It's as though it just can't
        > execute sqlmaint.exe. I can run other xps such as xp_msver without
        > trouble so I'm sure the paths are correct.
        >
        > I checked HKLM\SOFTWARE\M icrosoft\MSSQLS erver\Setup (not where the
        > first link says it is) and the path is set correctly.
        >[/color]


        Comment

        • Greg D. Moore \(Strider\)

          #5
          Re: sqlmaint.exe failed


          "Trevor Best" <googlegroups@b esty.org.uk> wrote in message
          news:1126541866 .564969.175060@ g14g2000cwa.goo glegroups.com.. .[color=blue]
          > Thanks, I've read the links you provided but none have helped.
          >
          > I can actually run the plan from an NT command prompt window and the
          > backup runs OK and the plan exits with code 0 (success).
          >
          > It's just running from the SQLAgent or from Query analyser it fails
          > immediately without having done anything. It's as though it just can't
          > execute sqlmaint.exe. I can run other xps such as xp_msver without
          > trouble so I'm sure the paths are correct.
          >
          > I checked HKLM\SOFTWARE\M icrosoft\MSSQLS erver\Setup (not where the
          > first link says it is) and the path is set correctly.[/color]

          Almot definitely then SQLAgent is NOT running under a domain account that
          has access to the path you're specifying.

          [color=blue]
          >[/color]


          Comment

          • Trevor Best

            #6
            Re: sqlmaint.exe failed

            The services are running under the local system account and that has
            full access to the path specified.

            SQLAgent can back up to the path using just a "backup database" command.

            Comment

            • John Bell

              #7
              Re: sqlmaint.exe failed

              Hi

              You could prove this by temporarily changing the account or to a lesser
              degree by changing the directory.

              John

              "Trevor Best" <googlegroups@b esty.org.uk> wrote in message
              news:1126650430 .806647.73590@g 43g2000cwa.goog legroups.com...[color=blue]
              > The services are running under the local system account and that has
              > full access to the path specified.
              >
              > SQLAgent can back up to the path using just a "backup database" command.
              >[/color]


              Comment

              • Trevor Best

                #8
                Re: sqlmaint.exe failed

                I tried backing up to a different directory (c:\backup) where another
                SQLAgent job successfully backs up using just a "backup database"
                command, the backup database command works in this directory but the
                maintenance plan doesn't.

                I will see if I can get their IT guy to make SQLServer and SQLAgent to
                run as Administrator user and see if that helps.

                Comment

                • John Bell

                  #9
                  Re: sqlmaint.exe failed

                  Hi Trevor

                  That would rule out permissions for the account.

                  Do you know what type of backup the maintenance plan is doing?

                  Have you tried dropping the plan and creating a new one?

                  John

                  "Trevor Best" <googlegroups@b esty.org.uk> wrote in message
                  news:1126805453 .468393.303380@ g49g2000cwa.goo glegroups.com.. .[color=blue]
                  >I tried backing up to a different directory (c:\backup) where another
                  > SQLAgent job successfully backs up using just a "backup database"
                  > command, the backup database command works in this directory but the
                  > maintenance plan doesn't.
                  >
                  > I will see if I can get their IT guy to make SQLServer and SQLAgent to
                  > run as Administrator user and see if that helps.
                  >[/color]


                  Comment

                  • Trevor Best

                    #10
                    Re: sqlmaint.exe failed

                    John Bell wrote:[color=blue]
                    > Hi Trevor
                    >
                    > That would rule out permissions for the account.
                    >
                    > Do you know what type of backup the maintenance plan is doing?
                    >
                    > Have you tried dropping the plan and creating a new one?[/color]

                    Yes, that didn't help.

                    I got the client to reboot their server in the end, this seemed to have
                    cured the problem.

                    Thanks for the advice.

                    Comment

                    Working...