Backup Fails Using SMO With Big Databases

Feb 11, 2007

Hello
I'm seeing the backup using SMO fails with big databases (>15GB). I
have a 2GB database and I can see the command go thru. in Profiler but
after it's about 50-70% done, I get an exception saying backup failed.
There is no details on the SQLServer log.

Here's the code snippet:

bk.Initialize = m_backupInit;
bk.PercentCompleteNotification = 10;
bk.PercentComplete += new
PercentCompleteEventHandler(bk_PercentComplete);
bk.SqlBackup(m_Server);

Here's the command as captured by SQL-Profiler:
BACKUP DATABASE [Test_MODEL] TO DISK = N'D:Temp
Test_Model_Backup.dat' WITH NOFORMAT, INIT, NOSKIP, REWIND,
NOUNLOAD, STATS = 10

Has anyone else seen this. The wierd thing is it works using old SQL-
DMO.

thanks
Sunit

View 1 Replies


ADVERTISEMENT

Differential Backup Fails Because Of Erroneous Full Backup

Jul 19, 2007

Hi

I am using the Simple recovery model and I'm taking a weekly full backup each Monday morning with differentials taken every 4 hours during the day.

On Wednesday afternoon, a programmer ran a process that corrupted the db and I had to restore to the most recent differential. It was 5pm in the afternoon and a differential backup had just occured at 4pm. No problem, I figured.

I restored the full backup from Monday morning and tried to restore the most recent differential backup. The differential restore failed. Since I had used T-SQL for the initial attempt, I tried using Enterprise Manager to try again.

When viewing the backup history, I see my initial full backup taken on Monday plus all the differentials. BUT, on closer inspection, I noticed another full backup in the backup history that was taken early Tuesday morning. I can't figure out where this Tuesday morning full backup came from. It wasn't taken by me (or scheduled by me) and I'm the only one with access to the server. My full backups are usually named something like HCMPRP_20070718_FULL.bak. This erroneous full backup was named something like HCMPRP_03a_361adk2k_dd53.bak. It seemed like it was a system generated name. Not something I would choose. To top it off, I could not find this backup file anywhere on the server and when I tried to restore using this full backup, it failed.

Does anyone have any clues as to where this full backup might come from? Does SQL Server trigger a full backup on its own if some threshold is reached?

I ended up having to restore using the differential taken just before this erroneous full backup and lost a day of transactions.

Any insight is greatly appreciated.

View 3 Replies View Related

BackUp Fails

Dec 17, 2007

Guys I was wondering if you can help me figure out the problem with the script.

1) I am getting the following error message on one of the job which is backing up all the databases on the server.

...ges for database 'AdminWorkFlow_Reports', file 'AdminWorkFlow_Reports_Data' on file 1.
[SQLSTATE 01000] (Message 4035) Processed 1 pages for database 'AdminWorkFlow_Reports',
file 'AdminWorkFlow_Reports_Log' on file 1. [SQLSTATE 01000] (Message 4035) Backup or
restore operation successfully processed 433177 pages in 64.328 seconds (55.163 MB/sec).
[SQLSTATE 01000] (Message 3014) Processed 113720 pages for database 'BMSRep', file 'BMS_Data'
on file 1. [SQLSTATE 01000] (Message 4035) Processed 1 pages for database 'BMSRep', file '
BMS_Log' on file 1. [SQLSTATE 01000] (Message 4035) Backup or restore operation
successfully processed 113721 pages in 17.200 seconds (54.162 MB/sec). [SQLSTATE 01000]
(Message 3014) Processed 208 pages for database 'EmailAddress', file 'EMailAddress_STGE_Data'
on file 1. [SQLSTATE 01000] (Message 4035) Processed 1 pages for database 'EmailAddress',
file 'EMailAddress_STGE_Log' on file 1. [SQLSTATE 01000] (Message 4035) Backup or restore
operation succe... The step failed.

Not sure where to start. I looked up the backup script it looks fine.

BackUp Database AdminWorkFlow_Reports to Disk = 'q:\AdminWorkFlow_Reports12-17-2007.bak'

--
--
--
--

BackUp Database EmailAddress to Disk = 'q:\EmailAddress12-17-2007.bak'

2)Also I have another script which for some reason doesn't run on some nights. Its enabled and the job is scheduled daily but its not running for about a week.

SQL server agent is running though.

Any help in this regard would be appreciated.

View 5 Replies View Related

Backup Job Sometimes Fails

Jul 18, 2007

Hi

We have a nightly job on a production server which backs up all databases
(about 90 on the server)

Sometimes it'll only backup some of them, yet it reports success.

Our proc to manage the process is below:

Any ideas on what we need to do to make it reliable ?

-----------------------------------------------------

DECLARE @DB_Name varchar(32)
DECLARE @Backup_Path varchar(255)
DECLARE @Backup_Name varchar(255)

DECLARE DB_Cursor CURSOR FOR SELECT NAME FROM sysdatabases

OPEN DB_Cursor

FETCH NEXT FROM DB_Cursor INTO @DB_Name

WHILE @@FETCH_STATUS = 0
BEGIN
IF @DB_Name <> 'tempdb' AND @DB_Name <> 'model'
BEGIN
print '--------------------------------<< ' + @db_name + '
>>--------------------------------'
SET @Backup_Path = N'd:sql2005backupsightly' + @DB_Name + 'Daily' +
'.bak'
SET @Backup_Name = @DB_Name + N' backup'
BACKUP DATABASE @DB_Name TO DISK = @Backup_Path WITH INIT
print ''
END
FETCH NEXT FROM DB_Cursor INTO @DB_Name
END

Print "Finished backing up the databases"

CLOSE DB_cursor
DEALLOCATE DB_cursor

View 8 Replies View Related

Trans Log Backup Fails

Nov 4, 2005

I have a trans log backup that runs every 15 minutes on san, works fine until I do a backup after a large load. I get the below error message. Anyone had this before?

Executed as user: DPSCSDOMsqlexec. The file on device 'n:sqllogsmdentallgdmp' is not a valid Microsoft Tape Format backup set. [SQLSTATE 42000] (Error 3242) BACKUP LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013). The step fail

View 4 Replies View Related

Transaction Log Backup Fails

May 7, 2001

My transaction log backup is failing with the following error:
Does anyone know how I can fix it?
(null)
Microsoft (R) SQLMaint Utility (Unicode), Version 8.00.194 Copyright (C) Microsoft Corporation
(null)
Logged on to SQL Server as 'NT AUTHORITYSYSTEM' (trusted) Starting maintenance plan 'Maint Plan - TLogs' on 5/7/2001 8:18:11 AM Backup can not be performed on database. This sub task is ignored. (null)
Thanks

View 2 Replies View Related

Backup To Tape Fails Sometimes

Jul 2, 2001

I am trying to backup a database to a tape. It works when it wants to. I get a 3013 error. The drive is fully functional. Seagate backup works fine. SQL Backup does not. I think it might be that the tape needs retensioning sometimes. Here is the sql statement: BACKUP DATABASE pubs TO TAPE='.ape0' WITH FORMAT. Is there a retension parameter I am failing to see?

View 2 Replies View Related

Transaction Log Backup Job Fails

Jan 21, 2004

Our Transaction Log backup job runs every two hours from 7:00am to 8:59pm. Today, our Full backup job and the first Transaction Lob backup job ran successfully. Subsequent Transaction Log Backups have failed with the following error message under Job History:

"The job failed. The Job was invoked by Schedule 13 (Schedule 1). The last step to run was step 1 (Step 1)."

The caveats are that the database is in Full recovery mode and a .TRN file is generated on the server. Also, the SQL Server log says the job ran successfully. Any ideas?

View 7 Replies View Related

SQL Transaction Log Backup Fails.

Jul 11, 2007

Hi,

I'm a clueless SQL noob trying to set a maintenance plan to backup my databases.

This is SQL 2005 running on Windows SBS 2003 R2.

I've created two maintenance plans one to do a full backup of all DBs and one to do transaction log backups every 4 hours of the databases.

The full backups run but the transaction log backup fails with

DTExec: The package execution returned DTSER_SUCCESS (0). in the logs.

I can run the backup manually from the SQL Studio but not automatically.

Any clues on what can cause this not to work?

Thanks,
nline

View 20 Replies View Related

Backup CERTIFICATE Fails

Jun 13, 2006

I've problems with backing up the certificate (on the Witness Server). On principal and mirror, it works fine (Win 2003 Server, US English), but on my local PC (XP Prof, German) what i use as witness Server following backup command raises an error:

USE master;

CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'something$Strong123';

CREATE CERTIFICATE HOST_W_cert WITH SUBJECT = 'HOST_W certificate for database mirroring', START_DATE = '01/01/2006', EXPIRY_DATE = '12/31/2050';

BACKUP CERTIFICATE HOST_W_cert TO FILE = 'C:HOST_W_cert.cer';

The error message is:

Msg 15240, Level 16, State 1, Line 1

Cannot write into file 'C:HOST_W_cert.cer'. Verify that you have write permissions, that the file path is valid, and that the file does not already exist.

I connect to the database with a domain user what is a local admin on the witness server (my local user), so this couldn't be a permission reason. The file doesn't already exists, so that is not the problem.

What could it be?

Greetings, Torsten

View 3 Replies View Related

Backup Fails On Network Drive???

Nov 14, 2000

I have creted a backup device on network drive and getting the following error when I run the backup command as a job.SQL server and the agent are running on a domain account which has full permission on the network drive.Any help is greatly appreciated.
Thanks!


"Cannot open backup device 'mccdiffbkpond2build'.
Device error or device off-line. See the SQL Server error
log for more details. [SQLSTATE 42000] (Error 3201) Backup or
restore operation terminating abnormally. [SQLSTATE 42000]
(Error 3013). The step failed"

View 1 Replies View Related

Transaction Log Backup Via SQL Maint Fails

Jul 5, 2002

I have setup a SQL maintenance plan to backup the transaction log file to be backup every one hour M-F.

But now I have been getting the following error:

sqlmaint.exe failed. [SQLSTATE 42000] (Error 22029). The step failed.

Any clues what does this error mean ?

Thanks.

View 2 Replies View Related

Master Transaction Log Backup Fails

Nov 9, 2004

:eek:

Okay. I changed the times that the transaction logs are backed up, via the built in maintenance schedule. It was then that I started to get failures only on the Transaction log backup for the master. The error that I get from the history log is Backup can not be performed on this database. This sub task is ignored. If I look in the file that is saved to disk :


Starting maintenance plan 'DB Maintenance Plan1' on 09/11/2004 02:30:00
Backup can not be performed on database 'master'. This sub task is ignored.

[1] Database onyx: Transaction Log Backup...
Destination: [R:BACKUPonyxonyx_tlog_200411090230.TRN]

** Execution Time: 0 hrs, 0 mins, 23 secs **

[2] Database onyx: Verifying Backup...

** Execution Time: 0 hrs, 0 mins, 8 secs **

Deleting old text reports... 1 file(s) deleted.

End of maintenance plan 'DB Maintenance Plan1' on 09/11/2004 02:30:31
SQLMAINT.EXE Process Exit Code: 1 (Failed)

I changed the backup back to its original time as this was the only change made. This has not resolved the problem. As I am new to SQL and still finding my feet All the other SQL maintenance plans that I changed are working fine.


Thanks

Steve

View 5 Replies View Related

SQL 2012 :: Backup Database Fails

Aug 21, 2014

If I try to backup of database in sql 2012 with t-Sql as follows:

Backup database db1
to disk='c:myfullbkup.bak' with init
go

This code works absolutely fine.

But if I try to take backup through SSMS -Task -Backup in object explorer and gave the same path of c: drive or any other folder outside sql default "Backup" folder.It gives error as access denied.This was not the scene in Sql server 2008.

View 8 Replies View Related

Scheduled Backup Silently Fails

Jul 20, 2005

I am running a SQL Server 2000 installation with several databases. Eachdatabase and log is backed-up using a maintenance plan.The scheduled maintance plan for the latest database does not run, butdisplays no error. There is no entry in the job history. The same thinghappens when I try to run the individual jobs from Enterprise Manager.I've checked the database recovery model (full), the location of the backupfiles (same as the other databases), and just about everything else I canthink of. The scheduled maintenance plan for every other database runs asit should.What am I missing?ThanksIain

View 6 Replies View Related

DB Maintenance - Backup Transaction Log Fails

Jul 23, 2007

Hi,



I'm running SQL 2005 SP2 and having a problem with a Database Maintenance task created in SSMS doing transaction log backups of all user databases.



When I look at dbo.sysmaintplan_logdetail I see the message:

Database 'Database1' will not be backed up because it does not have its recovery model set to Full or BulkLogged.



Great - that's what we want! Skip the SIMPLE recovery mode databases. However, the next entry is the following error message:

Executing the query "BACKUP LOG [Database1] TO DISK = N'D:\MSSQL$Windows\MSSQL.2\MSSQL\Backup\Database1\Database1_backup_200707231600.trn' WITH NOFORMAT, NOINIT, NAME = N'Database1_backup_20070723160023', SKIP, REWIND, NOUNLOAD, STATS = 10 " failed with the following error: "The statement BACKUP LOG is not allowed while the recovery model is SIMPLE. Use BACKUP DATABASE or change the recovery model using ALTER DATABASE. BACKUP LOG is terminating abnormally.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.



Which says to me it is trying to backup the same database(s) it just said it was skipping!



What's going on? I see that there is a fix to a similar error message with the cumulative update KB936305 (http://support.microsoft.com/kb/936305) for maintenance cleanup tasks.



Does anybody else have such a problem?

View 1 Replies View Related

Script When Database Backup Fails

Aug 28, 2006



Hello,

I would like to have a script , that sends a mail to the dba mail box when the database backup fails . The mail should be sent to the SMTP server.

I have the script which gives the whole output of the backup status but I would like it to change so that it fires only when a backup fails. Please suggest me what to do..



select
bmf.physical_device_name,
RIGHT(bmf.physical_device_name, CHARINDEX('', REVERSE(bmf.physical_device_name))-1) as physical_device_file,
bs.database_name,
bs.backup_start_date,
bs.backup_finish_date,
bs.type,
bs.first_lsn,
bs.last_lsn,
bs.checkpoint_lsn,
bs.database_backup_lsn
into #backup
from
msdb.dbo.backupset bs,
msdb.dbo.backupmediafamily bmf
where bmf.media_set_id = bs.media_set_id
and bs.backup_finish_date is not null
AND bs.type = 'D'
AND bs.backup_start_date = (select max(backup_start_date) from msdb.dbo.backupset WHERE type = bs.type and database_name = bs.database_name)
order by bs.database_name, bs.backup_start_date asc


select @message = @message + char(13) + Char(13) + 'Backup Status' + Char(13)

DECLARE GetBackup CURSOR FOR
select database_name, backup_finish_date from #backup order by database_name

OPEN GetBackup
FETCH NEXT FROM GetBackup INTO @dbname, @Status

WHILE @@FETCH_STATUS = 0
BEGIN
select @message = @message + @dbname + ' backup up on ' + @Status + Char(13)
FETCH NEXT FROM GetBackup INTO @dbname, @Status
END
Close GetBackup
Deallocate GetBackup

drop table #backup

print @message

EXEC master.dbo.xp_smtp_sendmail
@FROM = N'testsql2000@is.depaul.edu',
@TO = N'dvaddi@depaul.edu',
@server = N'smtp.depaul.edu',
@subject = N'Status of sqlserver!',
@type = N'text/html',
@message = @message



Thanks

View 1 Replies View Related

SQL Server 2000 Backup Fails

Nov 1, 2007

Hi all,

I am using SQL Server 2000 for one of our web application system called eRoom. eRoom uses SQL Server 2000 as a database. Now I have used SQL Server 2000 Database backup features to run the 4 database backup every night at 10pm. The backup runs fine. But recently I have found that for some reason when Our server machine which is hosting eRoom and SQL Server (Windows Server 2003 Standard Edition) is restarted, the database backup does not run anymore.

Now I have checked SQL Server settings and the settings allow SQL Server and SQL Server agent to restart both the services when the operating system starts. But still the database backup does not run when the server machine is restarted. It happened twice last week. Can anyone please help me?

Here are some information to help you understand the problem.

Backup Process Followed:

I went to SQL Server 2000 Enterprise Manager, then went to the appropriate server and then right click the Database>All Tasks> Backup Database> and then selected the backup file which is a (.BAK) file and then scheduled the database to be backed up at 10:00pm every night. I followed the same procedure for all 4 databases.

I am running SQL Server 2000 Standard Edition on Windows Server 2003 Standard Edition R2

Thanks

View 9 Replies View Related

Backup Fails To Local Disk

Nov 6, 2007

Hello,
SQL 2000 backup to C dirve fails with event 17055 Operating system error = 5 access is denied. Creating and running a backup job wizards errors with SQL State 42000, Deveice error or device off line. SQL is running as LocalSystem. The backup destination has every Windows group added with Full Control.
Thanks

View 4 Replies View Related

Backup Databases

Mar 7, 2007

is it possible to take the system databases backup to a location of another server.

(i.e ) shall we able to take a backup of the databases from server 1 and putting in server2

I know we can move the databases backup file , but above condition is not possible , but before working on this stuff i wamt to make sure.

View 4 Replies View Related

Sp To Backup All Databases

Jan 23, 2008

I have this sp that backsup all our db and the master. I want the backup files to be put in D:sqlbackups. I get a return message stating that all the files were successfully backed up but only the master.bak shows and the other db files are no where to be found?!?(Processed 2000 pages for database 'master', file 'master' on file 1.
Processed 1 pages for database 'master', file 'mastlog' on file 1.
BACKUP DATABASE successfully processed 2001 pages in 0.121 seconds (135.413 MB/sec).
Processed 828272 pages for database 'MARS_SYS', file 'MARS_SYS_Data' on file 1.
Processed 1 pages for database 'MARS_SYS', file 'MARS_SYS_Log' on file 1.
BACKUP DATABASE successfully processed 828273 pages in 84.552 seconds (80.248 MB/sec).
Processed 148736 pages for database 'MSystem', file 'MSystem_Data' on file 1.
Processed 1 pages for database 'MSystem', file 'MSystem_Log' on file 1.)

Here is the sp:
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

ALTER Procedure dbo.sp_BackupAllDatabases

AS

Declare @strDatabaseName nvarchar(254)
Declare @strDatabaseLoc nvarchar(254)
Declare @Path nvarchar(255)

Declare BackupList Cursor For
Select name from sysdatabases
where dbid > 6 or dbid = 1

Open BackupList
Fetch Next From BackupList into @strDatabaseName

SET @Path = 'D:SQLBACKUPS' + @strDatabaseName + '.bak'

While @@Fetch_Status = 0
Begin
BACKUP DATABASE@strDatabaseName
to disk = @Path with Init, Skip;

Fetch Next From BackupList Into @strDatabaseName
End

CLOSE BackupList
DEALLOCATE BackupList

return


GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

View 2 Replies View Related

Backup Databases

Jan 22, 2007

Hi



I'm trying to setup a back up plan for a number of databases, I initially set up one plan to include all user databases which worked fine or so I thought, when I check them a few days later I noticed that some of the databases were not appearing in the backup set, the only way I could get these to appear is to set the comp level to 90, now when we run certain applications we get an error, when I return the comp level back to 70 then the application works fine, is there a reason I can not back up any database on sql 2005 without it being a comp level 90?



Thanks inadvance

View 6 Replies View Related

SQL Maintenence Plan And Database Backup Fails

Jan 8, 2008

Hi everyone,
I am running SQL 2000 SP3. I have one maintenence plan that is backing up one database and that is working fine. I am trying to create another maintenence plan for another database but the job does not execute and it gives me errors. Both SQL server and the agent uses 'local system account' to run the service. I have tried changing this to a domain account to see if it fixes anything. Also on the jobs, the job owner is a domain account. Below are two erros I am getting when running the jobs.
Error1:
BackupDiskFile::CreateMedia: Backup device 'D:SQL Backups....mybackupfile.bak' failed to create. Operating system error = 3(The system cannot find the path specified.).

Error2:
BACKUP failed to complete the command BACKUP DATABASE [Database_Name] TO DISK = N'D:SQL Backups....mybackupfile.bak' WITH INIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT

Any help would be appreciated.

Thanks.

View 1 Replies View Related

Differential Backup File Fails To Restore.

Jul 19, 2007

We are doing the following steps:-

1. Weekly Full Bckup

2.Daily Differential backup

3.hr Log back up

The following command works fine for all the Backups. it means backup file is fine.

RESTORE FILELISTONLY from DISK = 'D:BackupewDB_ full.BAK'

RESTORE HEADERONLY FROM DISK = 'D:BackupewDB_ ull.BAK'

RESTORE LABELONLY FROM DISK = 'D:BackupewTest_full.BAK'

RESTORE VERIFYONLY FROM DISK = 'D:BackupewTest_full.BAK'



Also The full back up restoration works fine:

RESTORE DATABASE Test3 FROM DISK = 'D:BackupewTest_full.BAK'

WITH MOVE 'Test2_Data' TO 'F:MSSQL2KMSSQLdataTest2Net_Data.MDF',

MOVE 'Test2_Log' TO 'F:MSSQL2KMSSQLdataTest2Net_Log.LDF',

NORECOVERY

GO

/* RESULT :

Processed 1032 pages for database 'Test3', file 'test2_Data' on file 1.

Processed 1 pages for database 'Test3', file 'test2_Log' on file 1.

RESTORE DATABASE successfully processed 1033 pages in 1.907 seconds (4.433 MB/sec).

*/

But While restoring the Differential file it throws error:

RESTORE DATABASE Test3 from DISK = 'D:Backupew est2_Diff1.bak'

WITH NORECOVERY

GO



Msg 3136, Level 16, State 0, Line 1

Cannot apply the backup on device 'D:Backupew est2_Diff1.bak' to database 'Test3'.

Msg 3013, Level 16, State 1, Line 1

RESTORE DATABASE is terminating abnormally.

I checked the SQL Server Log no error msg corresponding Differential backup restore.



I don't know how to proceed further.Can any one guide me how to over come this..



Thanks !

View 2 Replies View Related

SP2 Maintenance Backup Fails On Offline Database.

May 29, 2007

I have a maintenance plan step to perform transaction log backups. There are a few databases that are offline. The backup seems to fail because it tries to backup the offline databases. The backup step is by itself as one of three subplans, although it also fails when it is the only step in a plan with only one subplan.

I have another server that is only on SP1 and it does not have problems handling the offline databases.

Is this an issue with SP2(9.0.3054)?

View 4 Replies View Related

SP To Backup SQL Express Databases

Mar 2, 2007

Hi - I use the windows scheduler to execute an SP for my SQL Express instance on a server.
The SP loops through the SQL Express databases, and makes a backup - however, it will only backup the attached databases.
Is there anyway I can modify it, to make it backup the databases in my various web sites, within the app_data folder?  These aren't attached, but I think get attached when the web application needs them, then detached afterwards - so they are never permanently attached!
Thanks for any help,
Mark
The SP I use us:/**
File Name: BackupExpress.sql
Description: Backs up all databases. This script is mainly meant for SQL Express instances
The script requires a C:ackups directory by default to backup to but can be changed with the @OutputPath variable.
Accompanying file is BackupExpress.cmd, which is used to schedule the script.
Author: Brian Knight

DateChange DescriptionAuthor
8/15/2006Initial releaseBrian Knight

**/



SET QUOTED_IDENTIFIER OFF

USE master
GO
SET NOCOUNT ON


DECLARE @dayofweek varchar(20)

SELECT
@dayofweek = CASE datepart(dw, getdate())
WHEN 1 THEN 'Sunday'
WHEN 2 THEN 'Monday'
WHEN 3 THEN 'Tuesday'
WHEN 4 THEN 'Wednesday'
WHEN 5 THEN 'Thursday'
WHEN 6 THEN 'Friday'
WHEN 7 THEN 'Saturday'
END

DECLARE @OutputPath varchar(500)
DECLARE @DatabaseBackupFile varchar(500)
DECLARE @FolderName varchar(25)
DECLARE @DatabaseName varchar(25)
DECLARE @strSQL varchar(2000)
DECLARE @hostname varchar(255)

SET @hostname = (select replace(convert(varchar(255),serverproperty('SERVERNAME')), '','_'))
SET @OutputPath = 'C:Backups'

DECLARE cur_Backup CURSOR FOR
select name from sysdatabases where name !='tempdb'

OPEN cur_Backup

-- Fetch the db names from Cursor
FETCH NEXT FROM cur_Backup INTO @DatabaseName

WHILE @@FETCH_STATUS = 0
BEGIN


SET @DatabaseBackupFile = @OutputPath + '' + @hostname + '-' + @DatabaseName + '-' + @dayofweek + '.bak'
PRINT ''
PRINT ''
print @DatabaseBackupFile


SET @strSQL = 'BACKUP DATABASE '+@DatabaseName+' TO DISK = "'+ @DatabaseBackupFile+ '" WITH RETAINDAYS = 7, NOFORMAT, INIT, NAME = N''Full Database Backup'', SKIP, NOREWIND, NOUNLOAD, STATS = 10'

PRINT @strSQL
PRINT ''


EXEC (@strSQL)

FETCH NEXT FROM cur_Backup INTO @DatabaseName
END

-- Distroy Cursor
CLOSE cur_Backup
DEALLOCATE cur_Backup


SET NOCOUNT OFF

 
 
 

View 2 Replies View Related

Backup Over 50 Databases To Another Location

Nov 26, 2004

I need to back up about 50 databases that are currently sitting on MARS. Every saturday they will be backuped so that they can be moved to HOMER

Pls help as I don't know where to start

BTW..I have also set up the SQL Maintenance wizared Backup procedure which copies to the local server but I want to be able to move the database files to HOMER (another server) so eventually they are backed up by TAPE

Any ideas
Emer

View 1 Replies View Related

Backup System Databases

Feb 1, 2005

hi,

I have just started a new job and they have nightly backups of the master, msdb and model databases.

But why would you need a nightly backup of the model database? surely the model database never changes, so would a one time backup not be sufficient?

Please advise me if I am incorrect

Cheers

View 4 Replies View Related

How To Backup Read-Only Databases

Jul 23, 2005

Hello,Can anyone tell me how to backup read-only databases? I want to backupthe secondary databases in my log shipping pairs.Thanks,TGru*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!

View 6 Replies View Related

Backup Of Mirrored Databases Using TSM

Nov 30, 2006

Hi,

I currently have 2 mirrored servers and would like to implement a backup solution using an existing TSM server. The first thing that comes to mind is using the TSM client or Litespeed by Quest, but I'd like to know the effects of performing backups on principal and mirrored servers first.

Will using one of these products cause errors or problems should the backup client try to backup a mirrored database? Can anyone make any recommendations on the effects of using TSM client or Litespeed for a mirrored environment?

Thanks.

View 4 Replies View Related

SQL2000 Mainenance Plan Database Backup Fails

Dec 3, 2001

The database is SQL Server 2000. Recover Plan = 'Simple'. Maintenance Plan always fails when DBCC tries to put database in single-user mode so it can do the backup, if there is a user has a connection to it from EssBase. No queries running - just a connection. How can I get SQL Server to automatically kill the connections so it can do the backup?

View 2 Replies View Related

Backup And Restore Databases In My MSDE

Jul 13, 2004

Hi all! How can i backup databases which are running in my MSDE 2000 & then how can i restore them with all the data, Yes i know that their is no visual tool for doing this in MSDE but can we do it with scripts, if Yes then how

View 1 Replies View Related

How Give Right To Backup All Databases To NT Account

Jan 8, 2002

Hello , everybody

Is possible to set up server role to NT user in order to backup ONLY
any databases on server (nothing alse )

Now I am specifying this user as backup operator to each database

This NT account is domain account used to run Backup.exe software

Thank you

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved