+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
MIS Systems Thread, DBAttach Script in Technical; When we ran SIMS on Server 2003 and SQL 2008 Express I used the following to backup the DB. "F:\Microsoft ...
  1. #1

    fiza's Avatar
    Join Date
    Dec 2008
    Location
    London
    Posts
    2,305
    Thank Post
    457
    Thanked 330 Times in 278 Posts
    Rep Power
    156

    DBAttach Script

    When we ran SIMS on Server 2003 and SQL 2008 Express I used the following to backup the DB.

    "F:\Microsoft SQL Server\MSSQL10_50.SIMS2008\MSSQL\Binn\dbattach.exe " \BACKUP /SERVER="KCN-SVR-06\SIMS2008" /USER="backup" /PASSWORD="xxxxxxxxx." /DATABASE="sims" /AUTO /PATH="c:\simsbackup\sims.bak

    I have now rebuilt the server to 2008 R2 and SQL 2008 R2 Full. SIMS is working but when I try to use the script I just get the DBattach dialogue box up with the database field filled in and the username/password filled in but it doesnt actually execute and make a backup. If I click connect it says "login failed for user : backup". I know user "backup" exists as I have logged into SIMS with the user account.

    If i replace the user "backup" with the sa credentials and run the script it still comes up with the DBAttach dialogue box but this time I am able to connect to the DB by clicking "connect" but it does nothing else.

    Previously the script would just run and backup the DB without showing the DBattach dialogue box and using the user called "backup".

    Have I missed something or done something wrong?

  2. #2
    Mcshammer_dj's Avatar
    Join Date
    Feb 2007
    Location
    Portsmouth
    Posts
    982
    Thank Post
    38
    Thanked 179 Times in 144 Posts
    Rep Power
    97
    why is there a " between Path= and C:\simsbackup\sims.bak

    Actually why are there speech marks around all the entires??

    dbattach /backup /server=somepr-dc-01\sims2008 /database=sims /user=username /password=password /auto

    This then places the backups into the backup folder of SQL

  3. Thanks to Mcshammer_dj from:

    fiza (17th November 2011)

  4. #3

    fiza's Avatar
    Join Date
    Dec 2008
    Location
    London
    Posts
    2,305
    Thank Post
    457
    Thanked 330 Times in 278 Posts
    Rep Power
    156
    Oops my mistake - I just put them in there for clarity - not actually there in real script.

  5. #4

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    5,893
    Thank Post
    751
    Thanked 1,469 Times in 1,220 Posts
    Rep Power
    364
    Maybe if it can take speech marks, then the one missing off the end is the issue.., maybe try running the script as admin, windows 2008 is more secure by default, the box popping up makes me think it didn't like one of the parameters though.

  6. #5

    fiza's Avatar
    Join Date
    Dec 2008
    Location
    London
    Posts
    2,305
    Thank Post
    457
    Thanked 330 Times in 278 Posts
    Rep Power
    156
    @mcshammer_dj - Just replaced my script with yours and it seems to have worked. Thanks
    Not sure whats changed from before but I never had issues with it previously.

  7. #6

    creese's Avatar
    Join Date
    Feb 2009
    Location
    -28° 31' 48.89", +28° 25' 37.42" ... if only.
    Posts
    3,258
    Thank Post
    182
    Thanked 375 Times in 304 Posts
    Rep Power
    183
    I would say

    "F:\Microsoft SQL Server\MSSQL10_50.SIMS2008\MSSQL\Binn\" DBATTACH /AUTO /SERVER="KCN-SVR-06\SIMS2008" /DATABASE="sims" /USER="backup" /PASSWORD="xxxxxxxxx." /PATH="c:\simsbackup\"

  8. #7
    Mcshammer_dj's Avatar
    Join Date
    Feb 2007
    Location
    Portsmouth
    Posts
    982
    Thank Post
    38
    Thanked 179 Times in 144 Posts
    Rep Power
    97
    I also use the Tidybackups.exe that Matt Smith created for my backups. Got it set to zip the backups down and only keep the last 15 on the server. Defo worth taking a look at the utility

  9. Thanks to Mcshammer_dj from:

    matt40k (17th November 2011)

  10. #8

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    5,893
    Thank Post
    751
    Thanked 1,469 Times in 1,220 Posts
    Rep Power
    364
    Quote Originally Posted by Mcshammer_dj View Post
    I also use the Tidybackups.exe that Matt Smith created for my backups. Got it set to zip the backups down and only keep the last 15 on the server. Defo worth taking a look at the utility
    nudge - @matt40k - come bask in the glory

  11. Thanks to vikpaw from:

    matt40k (17th November 2011)

  12. #9

    fiza's Avatar
    Join Date
    Dec 2008
    Location
    London
    Posts
    2,305
    Thank Post
    457
    Thanked 330 Times in 278 Posts
    Rep Power
    156
    Where can I find this utility? Sounds like just what I need

  13. #10

    creese's Avatar
    Join Date
    Feb 2009
    Location
    -28° 31' 48.89", +28° 25' 37.42" ... if only.
    Posts
    3,258
    Thank Post
    182
    Thanked 375 Times in 304 Posts
    Rep Power
    183
    I keep my backups for a set number of day before deleting.

  14. #11
    Mcshammer_dj's Avatar
    Join Date
    Feb 2007
    Location
    Portsmouth
    Posts
    982
    Thank Post
    38
    Thanked 179 Times in 144 Posts
    Rep Power
    97
    Quote Originally Posted by fiza View Post
    Where can I find this utility? Sounds like just what I need
    If you search for Tidybackups you will Find a thread that Matt started regarding this with information about how to use it.

    I would link the thread but can't see how you do that....
    Last edited by Mcshammer_dj; 17th November 2011 at 01:08 PM.

  15. #12

    matt40k's Avatar
    Join Date
    Jun 2008
    Location
    Ipswich
    Posts
    4,489
    Thank Post
    372
    Thanked 657 Times in 537 Posts
    Rep Power
    162
    Quote Originally Posted by fiza View Post
    Where can I find this utility? Sounds like just what I need
    tidybackups | Free software downloads at SourceForge.net

  16. #13

    fiza's Avatar
    Join Date
    Dec 2008
    Location
    London
    Posts
    2,305
    Thank Post
    457
    Thanked 330 Times in 278 Posts
    Rep Power
    156
    @Matt40k Thank you.

    Quick (dumb) question if it zips up and then deletes everything older than 30 days there are .bak files in there called master and msdb dated from the day I installed SQL. Is it ok for those to be zipped up and then the originals deleted?

  17. #14

    matt40k's Avatar
    Join Date
    Jun 2008
    Location
    Ipswich
    Posts
    4,489
    Thank Post
    372
    Thanked 657 Times in 537 Posts
    Rep Power
    162
    It deletes anything older then specified days and then if you've set it to zip, it'll zip any uncompressed .bak files - MASTER and MSDB included and delete the uncompressed copy.

    It's really safe as it'll ignore anything that isn't a .bak file and you can use the built-in Windows Zip function to uncompress the files - which you'll need to do if you wish to restore them - not that restoring the MASTER or MSDB databases are easy!

    The preserve switch allows you to set a a min number of backups for each type - for each sims\fms. This will stop you deleting all your backups if your backup routine stops

    I've also got a tool somewhere to transfer the passwords from the MASTER database to the actual database (ie SIMS), so when you backup the SIMS database, it includes all the passwords.

  18. #15

    bossman's Avatar
    Join Date
    Nov 2005
    Location
    England
    Posts
    4,017
    Thank Post
    1,253
    Thanked 1,099 Times in 781 Posts
    Rep Power
    337
    I just use the backup tool in SQL to set a task sequence which backs up all the databases into a set folder and this is then backed up daily by our normal school backup solution using BE, SQL backs up throughout the weekly 7 days (People may have altered files remotely on the weekend) and it is set to keep the last 3 backups only after it has completed the 7 days backups via another set task within SQL,

    This works very well along with our VM backup of the server we have it pretty much covered from all possibilities as far as we are able.



SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Action Scripting in Flash
    By StewartKnight in forum Web Development
    Replies: 11
    Last Post: 4th June 2006, 12:23 PM
  2. Replies: 18
    Last Post: 14th October 2005, 10:28 AM
  3. Pretty Scripts (Making HTAs)
    By Ric_ in forum Scripts
    Replies: 3
    Last Post: 29th July 2005, 03:22 PM
  4. FREE: Microsoft Script-O-Matic
    By zippy in forum Downloads
    Replies: 0
    Last Post: 27th July 2005, 08:26 PM
  5. The KiXtart free-format scripting language
    By ninjabeaver in forum Downloads
    Replies: 10
    Last Post: 16th June 2005, 01:11 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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