Backup Possessive or Performance hog ???

  • Will it hurt if I run a backup of a database being used (Not in single user mode)? 

    Backup Format?

    sqlmaint -D Database  -WriteHistory  -VrfyBackup -BkUpMedia DISK -BkUpDB  "Drive:\Directory"  -CrBkSubDir -BkExt "BAK" -DelBkUps 3days

  • A database can be backed up while in use.  no problem.

    Steve

  • Hi,

    I have setup a backup (My 1st ever), and it has issues running. Can you tell me why?

    Note:  The drive is not on the local server ... I have mapped to it.

    Backup Code in DTS as CmdExec:

    sqlmaint -D DatabaseName  -WriteHistory  -VrfyBackup -BkUpMedia DISK -BkUpDB  "I:\Directory"  -CrBkSubDir -BkExt "BAK" -DelBkUps 3days

    Error:

    Executed as user: Domain\Owner. Microsoft (R) SQLMaint Utility (Unicode), Version 8.00.760 

    Logged on to SQL Server 'DatabaseName-WHSE-DB'   as 'Domain\Owner' (trusted)   

    Starting maintenance of database 'DatabaseName' on 6/29/2004 9:29:34 PM   

    Could not create a sub directory for database DatabaseName.

    The parent directory will be used instead. 

    [1] Database DatabaseName: Database Backup...       

    Destination: [I:\Directory\DatabaseName_db_200406292129.BAK]   

    [Microsoft SQL-DMO (ODBC SQLState: 42000)]

    Error 3201: [Microsoft][ODBC SQL Server Driver][SQL Server]

    Cannot open backup device 'I:\Directory\DatabaseName_db_200406292129.BAK'.

    Device error or device off-line. See the SQL Server error log for more details. 

    [Microsoft][ODBC SQL Server Driver][SQL Server]BACKUP DATABASE is terminating abnormally.   

    End of maintenance for database 'DatabaseName' on 6/29/2004 9:29:34 PM   

    SQLMAINT.EXE Process Exit Code: 1 (Failed).  Process Exit Code 1.  The step failed.

  • Its most likely a permissions issue.  The account that SQL is running under doesn't have rights to your mapped drive.  If at all possible, backup your databases to a local drive and then move them to your network share.

    Steve

  • SQL is very intolerant of any network delays as well. That's not your error here, but I'd recommend a local drive as well.

  • I agree with all that backing up to a network drive is not a good idea.

    But if you still need to back up, try giving a UNC path and hope that works.

  • When backing up to a network drive, you need to remember/check the following:

    1. Using the command tool, PING the system that you will be backing up to.....this will ensure you can actually 'reach' the system.

      1a. PING by name first, if that doesn't work then PING by IP. DNS name resolution may not be set up. If it isn't then using the name in the path won't work, you'll need to use the IP address.

    2. Backup jobs run under the login account that the SQL Server Agent uses.  Make sure that account is a DOMAIN account.

    3. Make sure that account has permissions to access the system and drive that you are going to backup to.

    4. Use the FULL UNC path in the backup command.

    -SQLBill

  • One other thing usually forgotten:

    The full UNC path includes two slashes (//) before the server name.

    -SQLBill

  • The full command I am using is

    sqlmaint -D Database  -WriteHistory  -VrfyBackup -BkUpMedia DISK -BkUpDB  "I:\DIRECTORY"  -CrBkSubDir -BkExt "BAK" -DelBkUps 3days

    I can see the drive in Windows Explorer ... where does the // go?  Is the command case sensative?  What is the difference between BACKUP command and this SQLMAINT?

    I'm Melllttttingggggg ,  Thanks for helpppppingggg

     

  • No room on local drives

    What is UNC path ?

  • F.Y.I.  UNC paths start with \\ rather than //



    A.J.
    DBA with an attitude

  • Current Error:

    BackupDiskFile::CreateMedia: Backup device 'I:\DIRECTORY\DoD_db_200406301343.BAK' failed to create. Operating system error = 3(The system cannot find the path specified.).

    Bring back any memories?

  • Is I:\ your mapped drive?

    If so, did you map it under YOUR NT Logonid?

    If so, SQL Agent wouldn't know that the drive mapping exists.  Determine what Logonid SQL Agent is running under (and make sure that it is a domain id), and map your drive from that ID, or use the UNC path.  Better still, backup to a local drive.

    Steve

  • Sorry, just saw your "no room on local drives" message.

    UNC:

    \\servername\c$\Directory\filename

    where "c" = server's drive letter

    Steve

  • Command in job:

    sqlmaint -D DoD  -WriteHistory  -VrfyBackup -BkUpMedia DISK -BkUpDB  "\\Name\I\DIRECTORY"  -CrBkSubDir -BkExt "BAK" -DelBkUps 3days

    Error:

    [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 3201: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open backup device '\\Name\I\DIRECTORY\Database_200406301444.BAK'. Device error or device off-line. [Microsoft][ODBC SQL Server Driver][SQL Server]BACKUP DATABASE is terminating abnormally.    End of maintenance for database ...

    Note:  I got name from Windows Explorer name as displayed.  

Viewing 15 posts - 1 through 15 (of 34 total)

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