A script and batch file that practically anyone can run, no matter how non-technical. The batch file prompts you for backup path, server, and instance, and then calls the SQL script.
@echo off
prompt $g
@echo.
@echo %date% %time%
@echo.
for /f "tokens=3" %%a in ('dir ^ find /i "bytes free"') do set freeMB=%%a
set freeMB=%freeMB:~0,-8%
@echo Disk Space Free: %freeMB% MB
@echo.
set /p TargetServerAndInstance=Server and Instance ("Enter" for default)?
if "%TargetServerAndInstance%"=="" set TargetServerAndInstance="UNICORN\SQL2008EXPRESS"
set /p BackupFolder =Backup Folder ("Enter" for default)?
if "%BackupFolder%" =="" set BackupFolder="C:\TEMP"
set SqlCmdCommand=sqlcmd.exe
if not "%TargetServerAndInstance%"=="" set SqlCmdCommand=sqlcmd.exe -S %TargetServerAndInstance%
set SqlCmdCommand=%SqlCmdCommand% -r 1 -b -m-1 -V 1 -a 32767 -w 2000
set SqlCmdCommand=%SqlCmdCommand% -i BackupAllDatabases.sql
set SqlCmdCommand=%SqlCmdCommand% -o BackupAllDatabases.txt
set SqlCmdCommand=%SqlCmdCommand% -v BackupFolder=%BackupFolder%
if not exist "@BackupFolder" mkdir "@BackupFolder"
if errorlevel 1 goto l_error
@echo on
%SqlCmdCommand%
@echo off
@echo.
if errorlevel 1 goto l_error
goto l_done
:l_error
@echo.
@echo *** AN ERROR HAS OCCURRED! ***
:l_done:
@echo.
@echo %date% %time%
@echo.
Notepad.exe BackupAllDatabases.txt
pause
@echo.
prompt $p$g
The SQL script backs up all user databases and their logs, and the master and msdb system databases.
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
SET ARITHABORT ON
SET CONCAT_NULL_YIELDS_NULL ON
SET NUMERIC_ROUNDABORT OFF
SET QUOTED_IDENTIFIER ON
SET NOCOUNT ON
SET ROWCOUNT 0
SET XACT_ABORT ON
DECLARE @sBackupFolder NVARCHAR(260)
SET @sBackupFolder = 'C:\Temp'
DECLARE @sDate NVARCHAR(50)
SET @sDate = CONVERT(NVARCHAR, CAST(GETDATE() AS SMALLDATETIME), 126)
SET @sDate = REPLACE(@sDate, 'T', '_')
SET @sDate = REPLACE(@sDate, ':', '-')
DECLARE @sSql NVARCHAR(4000)
SET @sSql =''
+ 'IF ''?'' NOT IN (''model'', ''tempdb'') '
+ 'AND ''?'' NOT LIKE ''ReportServer$%'' '
+ ''
+ 'BEGIN '
+ ' RAISERROR(''Starting backup of database ?.'', 10, 1) WITH NOWAIT '
+ ''
+ ' BACKUP DATABASE [?] '
+ ' TO DISK = ''' + @sBackupFolder + '\?_dat_' + @sDate + '.bak '''
+ ' WITH '
+ ' NOFORMAT, '
+ ' NOINIT, '
+ ' NAME = ''? - Full Database Backup - ' + @sDate + ''', '
+ ' SKIP, '
+ ' STATS = 10; '
+ ''
+ ' IF ''?'' NOT IN (''master'', ''msdb'') '
+ ' BEGIN '
+ ' BACKUP LOG [?] '
+ ' TO DISK = ''' + @sBackupFolder + '\?_log_' + @sDate + '.bak '''
+ ' WITH '
+ ' NOFORMAT, '
+ ' NOINIT, '
+ ' NAME = ''? - Full Log Backup - ' + @sDate + ''', '
+ ' SKIP, '
+ ' STATS = 10; '
+ ' END '
+ ''
+ 'END; '
USE master
EXEC sp_MsForEachDb @sSql
-- Done.
GO
Pretty much anyone should be able to run this.