Results 1 to 6 of 6

Thread: [RESOLVED] SQL Server backups

  1. #1

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    Resolved [RESOLVED] SQL Server backups

    Ok, so this isn't a coding question, but I'm pulling my hair out here. I run a development SQL Server here at my desk, and I need to do some backups on that server regularly. Everything works fine normally, but sometimes, it doesn't do the backups.

    My main backup is done to the HD of the server itself, and that works fine. However, I do a secondary backup to a network drive in case that HD fails. I had it setup and it was working great, but I come in this morning and all of those backups failed. And now I can't create a backup device other than to the C drive of the computer the server is on.

    I had setup a backup device to the drive of the webserver (different computer), and that worked fine for a while, but now I can't recreate that either.

    The thing is, I have about at least 7 or 8 network drives connected to this server, but it doesn't show any of them when I try to create a new backup device.

    Does anyone have any clues as to what I could try... or why this keeps happening? The error I keep getting is "operating system error 67 - network name cannot be found"... which is a bunch of crap, because it can see that drive just fine.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: SQL Server backups

    My general opinion is that backups should only occur to drives local to the SQL server itself.

    They can be copied off using .BAT files after they are made.

    Asking the SQLSERVER.EXE app to run a backup through a network connection seems like a bad idea to me.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  3. #3

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    Re: SQL Server backups

    Can you give me an example of a .BAT script that would do this?

    And would you only copy the latest backup? I have 3 weeks worth of full backups for about 8 databases.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  4. #4
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: SQL Server backups

    I am not a .BAT expert - but I just ripped this from one of my customers machines - apparently it copies .BAK/.TRN files to another server...

    Code:
    e:
    
    cd\Program Files\Microsoft SQL Server\MSSQL\BACKUP\Funds 
    @echo off
    set curdate=%date%
    set filedatem=%curdate:~4,2%
    set filedated=%curdate:~7,2%
    set filedatey=%curdate:~10,4%
    set curntime=%time%
    set filetimeH=%curntime:~0,2%
    set filetimeM=%curntime:~3,2%
    set filetimes=%curntime:~6,2%
    set newfiledb=Funds_db_%filedatey%%filedatem%%filedated%
    set newfilelg=Funds_tlog_%filedatey%%filedatem%%filedated%%filetimeH%
    del \\server01\d$\server03backup_am\*.bak
    copy %newfiledb%0200.bak \\server01\D$\SERVER03backup_AM\
    del \\server01\d$\server03backup_am\*.trn
    e:
    exit

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  5. #5

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    Re: SQL Server backups

    Well, thanks for that, but I think I'm just going to stick another hard drive in the SQL Server PC and just do backups to that instead. That way I can avoid the issues of network traffic, network problems, and keeping track of everything. I'll just let the SQL server handle everything.

    Thanks anyways.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  6. #6
    Fanatic Member kaffenils's Avatar
    Join Date
    Apr 2004
    Location
    Norway
    Posts
    946

    Re: SQL Server backups

    Quote Originally Posted by ober0330
    Well, thanks for that, but I think I'm just going to stick another hard drive in the SQL Server PC and just do backups to that instead. That way I can avoid the issues of network traffic, network problems, and keeping track of everything. I'll just let the SQL server handle everything.

    Thanks anyways.
    I'm using xp_cmdshell with robocopy.exe to copy new files in the backup folder to a network drive, or in your case to another drive.


    exec xp_cmdshell '"d:\mssql\mssql\jobs\robocopy.exe f:\mssql\backup\ \\someserver\someshare\somefolder\ /XO"'

Posting Permissions

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



Click Here to Expand Forum to Full Width