Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 7,2000
»
Backups
»
SQL Express Backup
11 posts, Page 1 of 2
1
2
»»
SQL Express Backup
Rate Topic
Display Mode
Topic Options
Author
Message
kgrady
kgrady
Posted Tuesday, November 02, 2010 7:05 AM
Forum Newbie
Group: General Forum Members
Last Login: Tuesday, November 02, 2010 7:32 AM
Points: 3,
Visits: 1
I'm new to SQL and we have an SQLExpress database that we need to backup on a nightly basis. Is there a backup process with SQLExpress or will the Windows Server Backup process include the database if we point it to SQL location..?? Thank you..!!
Post #1014439
spaghettidba
spaghettidba
Posted Tuesday, November 02, 2010 7:12 AM
SSCarpal Tunnel
Group: General Forum Members
Last Login: Yesterday @ 8:17 AM
Points: 4,804,
Visits: 8,074
With SQLExpress you don't have SQLAgent to run backups. You have to manually set up a Windows Scheduled Task to run a backup command.
A simple filesystem backup won't help in case you need to restore a database: you have to backup the database, not its files.
Get your two-cent-answer quickly
The Spaghetti DBA
Post #1014445
kgrady
kgrady
Posted Tuesday, November 02, 2010 7:20 AM
Forum Newbie
Group: General Forum Members
Last Login: Tuesday, November 02, 2010 7:32 AM
Points: 3,
Visits: 1
Do you mean like a Batch(.bat) file to run...??? Is there an example anywhere..?? Thank you..!
Post #1014453
spaghettidba
spaghettidba
Posted Tuesday, November 02, 2010 7:29 AM
SSCarpal Tunnel
Group: General Forum Members
Last Login: Yesterday @ 8:17 AM
Points: 4,804,
Visits: 8,074
Take a look at this:
http://www.sqldbatips.com/showarticle.asp?ID=27
Get your two-cent-answer quickly
The Spaghetti DBA
Post #1014464
kgrady
kgrady
Posted Tuesday, November 02, 2010 7:35 AM
Forum Newbie
Group: General Forum Members
Last Login: Tuesday, November 02, 2010 7:32 AM
Points: 3,
Visits: 1
Thanks so much...!! I deeply appreciate your help..!! Have a great day..!!
Post #1014467
AlexGreen
AlexGreen
Posted Tuesday, July 05, 2011 8:00 AM
Grasshopper
Group: General Forum Members
Last Login: Tuesday, February 05, 2013 8:56 AM
Points: 17,
Visits: 40
You can also try this GUI tool
SQL Backup and FTP
which lets you schedule your backups. It is very simple to use and it's free
Post #1136496
Todd Beller
Todd Beller
Posted Thursday, January 17, 2013 7:42 AM
Forum Newbie
Group: General Forum Members
Last Login: Friday, February 22, 2013 6:41 AM
Points: 4,
Visits: 8
Another useful free tool is SQL Backup Master.
http://www.sqlbackupmaster.com/
Post #1408423
vikingDBA
vikingDBA
Posted Friday, January 18, 2013 6:54 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: 2 days ago @ 7:34 AM
Points: 189,
Visits: 864
Here is a simple example.
First file is the .sql script. It is invoked using SQLCMD in a batch file. Create one of these .sql files for each of the databases that you want to back up, including the system databases (master, model, msdb).
Then create a .bat file and have a line in it invoking SQLCMD for each of the database files that you want to run.
MyDatabase_backup_script.sql
==========================
DECLARE @fn nvarchar(256),
@dbname nvarchar(50),
@stmt nvarchar(4000),
@path nvarchar(4000)
SET @dbname = 'MyDatabase'
SET @path = 'c:\SQLBackups\' + @dbname + '\'
SET @fn = @path + @dbname + '_backup_' +
CONVERT(nchar(8),getdate(), 112) +
right(N'0' + rtrim(CONVERT
(nchar(2), datepart(hh, getdate()))), 2) +
right(N'0' + rtrim(CONVERT
(nchar(2), datepart(mi, getdate()))), 2) +
N'.bak'
--SELECT @fn
SET @stmt = 'BACKUP DATABASE '
+ QUOTENAME(@dbname, '[') + ' to disk
= ''' + @fn + ''''
--SELECT @stmt
EXEC (@stmt)
Database_backups.bat
==========================
sqlcmd -S (local)\SQLEXPRESS -E -i C:\SQLEE_Backups\MyDatabase_backup_script.sql -o C:\SQLBackupLogs\MyDatabase_backuplog.txt
Have one of these lines for each database to back up, then just schedule the .bat file to run every night, say at 1am.
The (local) part runs on the local machine, where the batch file is ran. This could be changed to the specific server or pc name if needed.
The -o text file is the output log file of the run. It will show any errors if it encounters any. I would keep the name in a format that will just overwrite itself so you don't have to worry about multiple versions to clean up. Note that this will be an issue with the database backups, since the script backs it up to a file name with a date stamp on it.
Here is an example of a .sql script to do a tranlog backup. Again, just have a .sql file for each database that you need to do tranlog backups for, and put them in a separate .bat file and set to run multiple times per day.
Tranlog backup script
==================================
DECLARE @fn nvarchar(256),
@dbname nvarchar(50),
@stmt nvarchar(4000),
@path nvarchar(4000)
SET @dbname = 'MyDatabase'
SET @path = 'c:\SQLBackups\' + @dbname + '\tlogs\'
SET @fn = @path + @dbname + '_backup_' +
CONVERT(nchar(8),getdate(), 112) +
right(N'0' + rtrim(CONVERT
(nchar(2), datepart(hh, getdate()))), 2) +
right(N'0' + rtrim(CONVERT
(nchar(2), datepart(mi, getdate()))), 2) +
N'.trn'
--SELECT @fn
SET @stmt = 'BACKUP LOG '
+ QUOTENAME(@dbname, '[') + ' to disk
= ''' + @fn + ''''
--SELECT @stmt
EXEC (@stmt)
Hope it helps.
Post #1408886
mr.jeff.freedman
mr.jeff.freedman
Posted Saturday, February 02, 2013 10:42 AM
Forum Newbie
Group: General Forum Members
Last Login: Thursday, February 07, 2013 6:43 AM
Points: 5,
Visits: 13
vikingDBA (1/18/2013)
Create one of these .sql files for each of the databases that you want to back up, including the system databases (master, model, msdb).
Why is there need to backup system DBs too?
Post #1414953
spaghettidba
spaghettidba
Posted Monday, February 04, 2013 2:51 AM
SSCarpal Tunnel
Group: General Forum Members
Last Login: Yesterday @ 8:17 AM
Points: 4,804,
Visits: 8,074
System databases can get corrupted just as user databases.
In case of corruption, you'll need a backup copy if you don't want to install from scratch.
Get your two-cent-answer quickly
The Spaghetti DBA
Post #1415197
« Prev Topic
|
Next Topic »
11 posts, Page 1 of 2
1
2
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.