How can we help you today? How can we help you today?
swjohnson
Ok, but this is a stand alone server and there are no linked servers nor aliases with this one--it;s about a simple of a SQL Server as they come. However, i will try the update you spoke about and let you know. Thanks SJ / comments
Ok, but this is a stand alone server and there are no linked servers nor aliases with this one--it;s about a simple of a SQL Server as they come. However, i will try the update you spoke about and ...
0 votes
Brad, Yes, it would be easier if it was in the interface but I too have over 300 databases on my primary SQL Server (several others have over 100 databases each) and I didn't want a custom procedure for each one. Also, I do a full backup every night for my primary server and it only takes a few hours. The script I use is generic and I use it on all my servers for their backups. You should be able to modify it fairly easily for your use. With that said would it make more sense to do a full backup once a week and then differential backups every night if you don't want to impact performance very much? My script that is on each server in the Master DB and called from a scheduled job: CREATE PROCEDURE usp_SQLBackup @BackupPath varchar(255), @CopyToPath varchar(255), @SvrName varchar(50), @RetainDays tinyint=7, @CompressLvl tinyint=3, @SendCompletionMail bit=0, @NotifyAddr varchar(100)='sqlserverdb@xxxxxxx.com' AS /********************************************************* This stored procedure gets all of the databases and generates the necessary text for executing Red Gate's SQL Backup utillity v3.x. @BackupPath is the path to put the backup files @CopyToPath is the path to copy backup files after done @SvrName name of the server this should report @RetainDays is the number of days to retain (Max 255) @CompresssLvl 1=Default, 2=High, 3=Max @SendCompletionMail 0=Don't Send, 1=Send notice this uses EasyMail SMTP components @NotifyAddr is the email address to notify HISTORY: ***********************************************************/ --declare Variables DECLARE @dbName SYSNAME DECLARE @MyString VARCHAR(4000) DECLARE @Result VARCHAR(4000) DECLARE @BeginTime DATETIME DECLARE @EndTime DATETIME DECLARE @failFlag bit DECLARE @failCount int SET NOCOUNT ON --Create temporary tables for use below CREATE TABLE #ResultDatabase (DBName sysname, BUResult varchar(4000),BeginTime datetime,EndTime datetime) CREATE TABLE #ResultString (message varchar (4000)) --Initialize variables SET @failFlag = 0 SET @failCount=0 SELECT @BeginTime=Getdate() --Open Cursor of databases to backup DECLARE c1 CURSOR FOR SELECT [Name] FROM master.dbo.sysdatabases WHERE [Name] NOT IN ('pubs', 'tempdb', 'Northwind') ORDER BY [Name] OPEN c1 FETCH NEXT FROM c1 INTO @dbName WHILE @@fetch_status <> -1 BEGIN --Generate string for BackupSQL SELECT @MyString= '-SQL "BACKUP DATABASE [' + @dbName + '] TO DISK = ''' + @BackupPath + '<AUTO>'' WITH NAME = ''Database (' + @dbName + '), ' + cast(getdate() as varchar(30)) + ''', DESCRIPTION = ''Full Backup on ' + cast(getdate() as varchar(30)) + ' Database: ' + @dbName + ' Instance: (local) Server: ' + @SvrName + ''', PASSWORD = ''mypasswordNOT'', VERIFY, ERASEFILES = ' + cast(@RetainDays as varchar(3)) + ', MAILTO_ONERROR = ''' + @NotifyAddr + ''', COMPRESSION = ' + cast(@CompressLvl as varchar(1)) + '" -E' SELECT @MyString --Execute backup of specified database INSERT INTO #ResultString EXEC master..sqlbackup @Mystring --Check results of backup SELECT @EndTime=GetDate() SELECT @failCount = count(*) FROM #ResultString WHERE patindex('%error%', message) > 0 --If successful insert sucess entry, otherwise set failFlag and note in table IF @failCount > 0 BEGIN INSERT INTO #ResultDatabase (DBName, BUResult,BeginTime,EndTime) SELECT @DBName,message,@BeginTime,@EndTime FROM #resultstring SET @failFlag = 1 END ELSE BEGIN INSERT INTO #ResultDatabase (DBName, BUResult,BeginTime,EndTime) SELECT @DBName,'Backup Successful',@BeginTime,@EndTime FROM #resultstring END --Cleanup and get next record DELETE FROM #ResultString FETCH NEXT FROM c1 INTO @dbname END CLOSE c1 DEALLOCATE c1 --Do notifications If @SendCompletionMail=1 BEGIN EXEC Spammer.dbo.usp_InsertSpam2 'SJ','sqlserverdb@xxxxxxxx.com',@SvrName,'sqlserveragent@xxxxxxxx.com',@SvrName,'Full Backup done processing please check',@ProjectID =0,@DateAdded ='1/1/1900' END --Clean up temporary tables DROP TABLE #ResultDatabase DROP TABLE #ResultString GO Good luck! / comments
Brad, Yes, it would be easier if it was in the interface but I too have over 300 databases on my primary SQL Server (several others have over 100 databases each) and I didn't want a custom procedur...
0 votes
Could be...the msdb.backupfile, msdb.backupmediafamily, msdb.backupmediaset databases are rather huge (about 3.6 million records each). / comments
Could be...the msdb.backupfile, msdb.backupmediafamily, msdb.backupmediaset databases are rather huge (about 3.6 million records each).
0 votes