Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to backup live a full database into a file

Author  Topic 

bienew
Starting Member

8 Posts

Posted - 2007-07-31 : 09:26:04
Hi

I'm migrating from access to sql server 2005.
With access, I did full backups every 6 hours, by simply copying the .mdb file to a folder on another hard disk on the server, and then ftp it to a distant server.

I guess i just can't simply do the same with the SQL server .mdf file.
What is the best practice to achieve the same goal ?

Thank you

nr
SQLTeam MVY

12543 Posts

Posted - 2007-07-31 : 09:27:39
Have a look at backup database in bol


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

bienew
Starting Member

8 Posts

Posted - 2007-07-31 : 09:34:49
What is 'bol' ?
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2007-07-31 : 09:35:53
You can use the Database Maintenance Plan Wizard to create scheduled automatic database backups in just a few minutes.

You can read about the Database Maintenance Plan Wizard and Backup/Restore in SQL Server Books Online (BOL).



CODO ERGO SUM
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2007-07-31 : 09:40:43
bol is books on-line
just run

backup database mydatabase to disk = 'c:\mydatabase.bak'

and it will create the backup.
You can schedule this by crating a job.



==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-07-31 : 09:56:02
Is it enough to say that Access isn't a database?

You need to get a book and read up

And converting Access to SQL Server isn't always a straight migration



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

bienew
Starting Member

8 Posts

Posted - 2007-07-31 : 11:24:08
I got it. Everything is working as expected.
Thanks a lot !
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-07-31 : 12:13:04
but sadly there may be a bit more to it!

If your Recovery model is FULL (rather than SIMPLE) then you also need to backup your transaction log - otherwise your .LDF file will grow-and-grow ... until your disk is full

You should prove that you can restore your database before you get too far into the project - otherwise the first time you need your backup files might be the first time you discover that, for whatever reason, they don't work.

Some pointers here:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=How%20Backup%20works,What%20type%20of%20backup%20should%20I%20use,Automating%20Backups,Backup

Edit: Oh, and

backup database mydatabase to disk = 'c:\mydatabase.bak'

will append each backup, so that file will get bigger-and-bigger too ... (various ways around that, but my suggestion would be to use a c:\mydatabase_YYMMDD_HHMMSS.bak style naming convention)

Kristen
Go to Top of Page

bienew
Starting Member

8 Posts

Posted - 2007-07-31 : 13:53:31
Thanks for the info.
My db is in simple recovery mode.
Backups are full.

The command line was generated by the wizard:

BACKUP DATABASE [mainSQL] TO  DISK = N'D:\Backup\mainSQL.bak' WITH NOFORMAT, INIT,  NAME = N'mainSQL_backup_20070731194133', SKIP, REWIND, NOUNLOAD,  STATS = 10
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-07-31 : 13:58:42
Note that "mainSQL.bak" will be overwritten each time, so if you have not already backed it up to, say, Tape then you won't have any earlier backups to revert to.

Other than that looks OK (there are some stupid parameters that the Wizard has added (e.g. SKIP, REWIND, NOUNLOAD), but they are benign

Kristen
Go to Top of Page
   

- Advertisement -