Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2003
    Posts
    8

    Unanswered: Problem in using sqlmaint in command prompt

    Hi,

    I try to backup DB (DatabaseA) in ServerA using sqlmaint utility in command prompt.

    The sqlmaint.exe does reside in ..Mssql\Binn Folder.

    Below is the command i used (MS-DOS):
    ..\Binn>sqlmaint -S ServerA -U "sa" -P "########" -D DatabaseA
    -BkUpDB C:\Temp -HtmlRpt BackupRpt.html

    When I execute the command, it only shows a list of the commands as if I execute -? command. There's NO any other messages that indicate the backup command is being executed.

    When I check in the C:\Temp folder, there's no BackupRpt.html file.

    Anyone got any idea?

    Thanks.
    Last edited by ckway; 02-14-04 at 00:00.

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Make sure you are using short path names when you execute the program. I.E.: C:\Progra~1\Micros~1\Binn\sqlmaint.exe

    ...etc.

    Also, what's with the ">" symbol? My DOS is rusty, but I think you should just use a path separator like my example above.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Nov 2003
    Posts
    8
    Thanks for the reply.

    My DOS is rusty also.

    What I mean by ">" is I'm typing the command at the Binn directory where sqlmaint.exe resides in. The actual command is only:

    sqlmaint -S ServerA -U "sa" -P "########" -D DatabaseA -BkUpDB C:\Temp -HtmlRpt BackupRpt.html

    I got this command from #Books Online, but I'm not sure whether I'm using the right way to execute it.

    Basically, what I intend to do is to perform a SQL Server DB Backup just by typing a command in MS-DOS, instead of using EM.

    Thanks again.

  4. #4
    Join Date
    Nov 2003
    Posts
    8
    Hi,

    I tried to run DBCC CHECKDB using sqlmaint.exe in command line:

    sqlmaint -S ServerA -U "sa" -P "########" -D DatabaseA - CkDB -Rpt C:\Temp\Check.txt

    It worked out fine and a report is generated in the Temp folder.

    This puzzles me as I wonder why BkUpDB can't work?

    Is there sth wrong with the syntax?

    Anyone?

    Thanks first.

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Try creating a backup job through the Maintenance Plan wizard. It will create a job that calls the maintenance utility and you can copy the syntax for your command line job.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  6. #6
    Join Date
    Nov 2003
    Posts
    8
    Blindman, you're the man!

    The commands in Maintenance Plan's Job can't work directly in DOS, but it gave me the rough idea to debug.

    Glad to tell you that the new command work perfectly, :>

    sqlmaint -S ServerA -U "sa" -P "########" -D DatabaseA -BkUpDB -BkUpMedia DISK -UseDefDir -BkExt "BAK" -VrfyBackup -Rpt "C:\Temp\BkRpt.txt"

    Once again, Thanks alot!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •