Jump to content

Recommended Posts

Posted
So a simple dbattach to backup sims2008 and fmsmain will save me in case of failure ? Ive got it backing up then copying to the other side of the site then also doing a backup to a removable device for off site
Posted
So a simple dbattach to backup sims2008 and fmsmain will save me in case of failure ? Ive got it backing up then copying to the other side of the site then also doing a backup to a removable device for off site

 

In the simplest method yes that's correct. All you stand to lose is the user logins, but your data is safe. You should test your backup all the same.

 

To keep logins, firstly go and vote for the change request so this in included in the dbattach backup. Secondly, you have some options, either detach and reattach the db prior to every backup, or just do it once, and any changes after that will not be updated.

 

You could also manually run the stored procedure for transfering the logins, prior to doing the backup, which is what happens during the detach process.

 

The attachment earlier explains the finer intricacies, but in a nutshell the above is how it works. Hope it makes sense.

Posted

I'm confused.

 

We use scripts provided by our LA support team (their recommendation) and from what I can tell all this does is backup the MDF files into the backup folder within MSSQL. From here these are then copied over in our backup procedure.

 

Is this not sufficient? :-S

Posted
I'm confused.

 

We use scripts provided by our LA support team (their recommendation) and from what I can tell all this does is backup the MDF files into the backup folder within MSSQL. From here these are then copied over in our backup procedure.

 

Is this not sufficient? :-S

 

I'm assuming it's a standard SQL backup and nothing else funky being done. In this case, you'll end up with a .bak file or maybe a .zip or .rar if they are compressing it after.

 

That is sufficient to back up your data, so don't worry. You will not lose any data, and in a disaster recovery scenario you'll be able to get it all back.

 

Unless you use dbattach to detach then reattach the database prior to a backup, then the logins will either not work, or be out of date. That's all.

 

Worst case you'd have to reset everyone's passwords.

  • 2 weeks later...
Posted

A little story that might brighten someone's day:

 

Ok, so i just set up my new Win2k8R2 test box with SQL2k8R2 put on a basic SIMS install.

 

I logged in with the default SIMS sysman account, so there was definitely 1 working login. The only other logins in the system were the initial one created with a basic install, e.g. SLGuser, sims_teacher, sims_student, etc. By logins i mean actual logins listed in the SQL | security section.

 

I next restored my live sims server backup. It complained and threw an error about a massive list of users / logins not found in the system, some where it tried to fix by mapping to existing logins and all manner of other weird stuff. i couldn't see the end of the window or resize so i just had to close.

 

No logins had been created, however i was able to login with the sysman account, so i used this to go into the system manager and reset my own password. I actually chose to use trusted login and linked it to the local admin account as the box is not yet on the domain.

 

When i did this, i got an error about a user, my colleague, whose account is also using trusted authentication in my live system. i thought nothing of it, and closed the box. The change to my user had saved, so i carried on.

 

I logged in and started testing all was good. :)

 

When i looked on SQL at the list of users i was very shocked to find not just the addition of my login, but also every single other of my users, so now i have 458 additions :).

 

I tried them, and for the ones i know passwords to, this worked perfectly. So all users were recreated somehow when i updated my own user, which must have been why the error for my colleague, as his domain account was not available, but for all other users it worked fine.

 

I don't think this was using the fact that from a previous detach, the logins were stored in the db and at this point were pushed to the SQL, because the last time i detached would have been automatically during sql 2008 migration. And, a new user i'd created since then, who had not logged in was available to login also, so it had recreated all my users for me. :)

 

The only thing that i wanted to test but now can't was what would happen if i had detached the db and reattached, but i wanted to do this when there were no logins in the SQL server, and since luckily they got pushed there i'll have to roll back to a snapshot to see the effects.

  • Thanks 1
Posted

Footnote on above findings:

 

I went back to snapshot of clean install of spring 10. There were no logins created under security tab on SQL.

 

Restored my summer 10 backup. - Looking at the error message, the page full i could see was all related to the trusted logins, and then just starts on about a repair to another account. Might try to run from command line to see if error could be redirected to a file..

 

Anyway, closed that and found full list of logins in SQL, so just tried to login with a known account and it worked :) So don't need to even update one account to push settings as i thought, they were all pushed on as part of the restore which is really good to know. Had the machine been domained or i had no trusted logins, i probably would not even receive any errors.

 

Would be good if anyone else is testing that can confirm these findings. It looks like, it's not all that important to detach the db. Still i'm unconvinced, so tried to delete all users from sysman and start again, but have managed to bork the install, and cleared all users from sims, but not from SQL. Might need to consult jinnantonnix reincarnate for some sql tips tomorrow before i can know for sure.

  • 2 months later...
Posted

I never fully updated my findings because i ran out of time and over Easter needed to get the server up and running. I did a detach and reattach of my databases and didnt' lose any logins, as should be the case.

 

I think, that from now on, if i restore my new backup files, to a test server the logins will be pushed there, as i first thought, but the best test would be a brand new server with a clean master db. I'll see if i get time to do those tests later.

Posted
I have 2 batch files. One that stops the SQL service of the database before the backup starts and one that starts it again when its finished.

 

net stop "SQL Server (SIMS2008)"

net start "SQL Server (SIMS2008)"

 

You will need to replace "SQL Server (SIMS2008)" with the name of your sims databse.

 

I am using Backup exec and put these in the pre and post command sections

 

I've run into situations where a restoration following this method of backup has left the SIMS DB corrupt meaning a hefty Capita bill to sort it out (if they can). Just stopping the SQL service and copying the MDF LDF doesn't always work. The DB will need detaching correctly (using DBAttach) or use the DBAttach script to backup on the fly.

 

Seriously: I can confirm that this is not a safe backup method!

Posted
I've run into situations where a restoration following this method of backup has left the SIMS DB corrupt meaning a hefty Capita bill to sort it out (if they can). Just stopping the SQL service and copying the MDF LDF doesn't always work. The DB will need detaching correctly (using DBAttach) or use the DBAttach script to backup on the fly.

 

Seriously: I can confirm that this is not a safe backup method!

 

Could you expand on this statement?

Posted
Could you expand on this statement?

 

Certainly though I don't know all the ins-and-outs as it was a colleague who dealt with it. A school backed up using this method (not BackUp Exec, but to tape). The server died taking the live data with it. On restoration, the DB had not only dropped logins, but also lost some recent data, with some data corruption. The previous backups were the same (a rolling weeks worth). Everything else from the tapes recovered fine. File recovery on the HDD gave us the live DB, but with similar problems. I do not know the exact nature of some of these problems, the DB was known good prior to the server dying. Anyway, Capita became involved, charged a hefty fee, and left the school with a DB that was mostly OK (well, a lot better than before).

 

Need less to say a thorough survey was done of all the backup methods used by the school we were involved with and the scripts to stop / start the service were removed and new scripts based on DBAttach were used instead. Recovery testing was also conducted to ensure that worked. It did.

 

Some online backup solutions will call DBAttach themselves to ensure the DB is backed up correctly. Smart move!

Posted
I never fully updated my findings because i ran out of time and over Easter needed to get the server up and running. I did a detach and reattach of my databases and didnt' lose any logins, as should be the case.

 

I think, that from now on, if i restore my new backup files, to a test server the logins will be pushed there, as i first thought, but the best test would be a brand new server with a clean master db. I'll see if i get time to do those tests later.

 

To add to this, I have experience with trusted logins. When we migrated to a new Server 2008 R2 and SQL 2008 R2, I installed SIMS from scratch on the new server, which was already attached to the domain, and used DBAttach to bring in the SIMS MDF / LDF (not the master DB, or any other) that I'd correctly unattached from the old server. I used the raw DB files rather than a backup 'cause I wanted to change the name of the DB from SIMS2008 to SIMS. I did not receive an error message on attachment regarding the trusted logins and they all worked fine.

 

I have, on other occasions, pulled a live backup from the server and restored it to my workstation for testing. Despite being on the same Domain, I did receive the error message regarding trusted logins that @vikpaw is referring to. I can't tell you if this is because it's a workstation and not a server, or because of the method used to bring the DB over, but in both instances the account used to login into Windows was the same and has local administrator access only, not domain admin access (in case that's relevant).

Posted (edited)

As NorthernSands says, stopping the SQL service and backing up the files is a terrible idea.

You should backup the database, not the underlying files.

 

You can do this with relatively simple piece of TSQL coding, using a job running on the server's scheduler.

 

This might be worth a look: Download Details - Microsoft Download Center - Microsoft SQL Server 2008 Management Studio Express

 

It might be possible to use the 'generate script' feature in the above studio to give you the TSQL code which you can call from an OSQL command script.

Edited by jinnantonnixx
Posted (edited)

If anybody's interested, here's a bit of code I wrote to do a manual backup (I must have had a reason).

 

You could set this to run in the server's regular scheduler, (as matt pointed out there's no SQL server agent in Express which is a shame).

 

Don't forget to put the full file path to OSQL, as there's no 'PATH' as far as the scheduler's concerned. Every file must be called or referred to by its full file path.

 

@echo off
cls
rem script to backup SIMS sql database
rem v1.1 2/2/05
for /f "tokens=1" %%a in ('date /t') do set Today=%%a
set Today=%Today:/=-%
set file=C:\Program Files\Microsoft SQL Server\MSSQL$SIMS\BACKUP\%1_%Today%_Backup.BAK
if $%1 NEQ $ (
echo Backing up database %1...
OSQL -S \SIMS -U sa -P  -d master -Q "BACKUP DATABASE [%1] TO DISK = '%file%'  WITH  NOUNLOAD ,  NAME = '%1',  NOSKIP ,  NOFORMAT"
echo Backup file on server is: %file%
) else (
echo Usage SQLBack [name of SIMS database]
echo e.g. SQLBack ABC
)

 

It takes the database name as a parameter. You could strip out the guts and just use the main OSQL bit if you just needed to backup one or two databases.

Edited by jinnantonnixx
Posted

What's wrong with dbAttach?

 

The free version doesn't encrypt and it doesn't FTP securely. So for god sake don't FTP to a external site!

  • 11 months later...
Posted
why does the browser tab say mysql backup? but the site says sql backup.

 

It is MSSQL, so I guess that's a mistake. Regardless, I wouldn't touch it with a 10 ft barpole personally - at least not with my SIMS and FMS databases.... maybe the SOLUS3 database ;)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...