Backup Plan Didn't Remove The Old Files

Nov 28, 2005

Hello, everyone:

I have a backup plan that remove the old backup files more than two days. Last Monday, the SQL Server restart. Since that, the backup is fine, but it didn't remove the old backup files. Why and how to handle that? Thanks

ZYT

View 2 Replies


ADVERTISEMENT

Remove Old Backup And Tran Logs Thru Maintenance Plan Cleanup Task

Mar 27, 2007

Has anyone been able to successfully delete old backup files(*.bak) and tran logs (*.trn) TOGETHER using maintenance plan cleanup task in SQL 2005 SP2.

this is transact sql running in the back ground.
EXECUTE master.dbo.xp_delete_file 0,N'F:MSSQL.2MSSQLBackupibmdir',N'"bak" & "trn"',N'2007-03-26T22:21:14',1

This DOESNT WORK.

It works if I just try to delete only one of the things ie trn or bak files.

EXECUTE master.dbo.xp_delete_file 0,N'F:MSSQL.2MSSQLBackupibmdir',N'bak',N'2007-03-26T22:21:14',1

But is there a way to delete both bak and trn files using one task ?

View 5 Replies View Related

Remove Old SQL 2005 Backup Files

Aug 17, 2006

I am trying to configure a maintenance plan in SQL 2005 to do a full backup every day and to do log file backups every hour.

What I want to do is to keep 3 days worth of full backups and 24 hours of log backups and remove all the backups older that this from the server so that I do not use all of my disk space. I will then backup these files to tape so that I have a good backup history.

In SQL 2000 there was a simple option to remove backup files older than a given time frame. Is there an option to do this in 2005? If not can you suggest a way that I can do this.

View 8 Replies View Related

Copy Files After Backup In Maintenance Plan

Sep 19, 2007



Hello,

We're new users of SQL Server 2005. I created two maintenance plans...one to backup the database at 2 AM daily and one to back up transaction logs every 30 minutes. These maintenance plans write to a local disk. What we want to do, within the maintenance plan, is copy the files as soon as they are written to a remote server. Is that possible?

Thanks in advance.

View 7 Replies View Related

DB Engine :: Cannot Remove Key Lookup From Execution Plan

Jun 4, 2015

how to eliminate a key lookup from the execution plan

  SET TRANSACTION ISOLATION LEVEL READ COMMITTED    
    SET NOCOUNT ON  
    SELECT COUNT(ph.lid) AS Total  
    FROM   PLB ph  
    WHERE  ph.lPhysician = @Physician  
    AND  ph.BSF = CAST(0 AS bit)  
   
[code]....

View 6 Replies View Related

Integration Services :: Unable To Remove View From Maintenance Plan

Sep 9, 2015

We have a maintenance plan in place for updating the statistics on daily basis. Now, i would like to remove the view from maintenance plan. How can i remove that from Update statistics task?

View 8 Replies View Related

Should Full Backup And Transaction Backup Be From One Plan?

Mar 11, 2008

Hello, everyone:

I just heard that for restore purpose, ths full backup and transaction log backup should be from one maintenance plan. Otherwise transaction log backup files cannot be restored after restoring full backup files.

Is it true? Can anyone offer official documents?

In my system, full and transaction backups are from one maintenance plan. Restores are doing fine. I am not sure that ideal is true or not.

Thanks

ZYT

View 2 Replies View Related

How Do I Remove Expired Backup From Backup Set

Nov 23, 2007

I have a backup that runs every evening. I set the backup to expire in 7 days time and have it appended to an existing backup set.

When I look at the contents of the backup set I can still see backups which have expired and show the expired date in the past.

e.g. It is 23/11/2007 today and I view my backup set and can still see backups showing an expiry date of 22/11/2007.

I need to remove the expired backups from the set as I do not want the backup set file growing too large in size and therefore a pain to transfer off of the server to another location.

I tried to find somewhere I can remove expired backups from within Microsoft SQL Server Management Studio Express but am unable to locate anywhere to do this. I know you can view the contents of a backup set by selecting the database > Tasks > Backup and then Clicking 'Contents' button.

I would appreciate any help with this.

Thanks

Lee

View 5 Replies View Related

SQL 2012 :: FOR FILES Command To Delete Old Backup Files On Remote Server?

Feb 24, 2015

I have the need to delete old backup files via TSQL job. Found this solution online:

PushD "
emoteservershareDIFF" &&(
forfiles -m *DIFF*.sqb -d -1 -c "cmd /c del /q @path"
) & PopD

It works remotely if I run it via command prompt. But when I add this to a TSQL job on my remote SQL instance, it runs without deleting anything. What I'm missing?

View 6 Replies View Related

How To Remove Files From MS SQL Databse

Jul 6, 2004

Hello,

I am trying to remove files from my MS SQL database but I cannot find them. I do not know anything about databases. Someone had created a program for me through which I could upload files to MS SQL database but I need to delete some of the old files to free up some database space. I can access MS SQL database through the control panel of my host but I cannot seem to find the files I have been uploading.

If someone could give me step-by-step information on how to view the files within MS SQL database and how to remove them, it would be greatly appreciated.

Thank you.

View 1 Replies View Related

Remove Files From Databases

Jun 15, 2007

Hi, I've created a new filegroup, then added to it a new filename, then create a table pointing to this filegroup. So far everything is ok, but if I want to revert the process in this way:



1- Drop the table - OK

2- Drop the filegroup - OK

3- Drop the filename - ERROR: Msg 5009, Level 16, State 9, Line 2
One or more files listed in the statement could not be found or could not be initialized.



When I query a catalog view with this query:

Select * From Sys.Database_Files



I get the file that I had recently deleted, it is offline but I can not delete it using the ALTER DATABASE instructions.





This is the code I use:





Use [TESTING ]

Go



-- Add a FileGroup to the Database

Alter Database TESTING Add FileGroup FG01

Go



-- Add a file to a FileGroup

Alter Database TESTING Add File (

NAME = TESTING_DATA01,

FILENAME = 'D:Sql ServerDataTesting_Data01.ndf',

SIZE = 1 MB,

MAXSIZE = 10 MB,

FILEGROWTH = 1 MB

) To FileGroup FG01

Go



-- Create the table using a specific FileGroup

Create Table TABLE1 (

Id Int Not Null,

FirstName VarChar(30) Not Null,

LastName VarChar(30) Not Null,

BirthDate SmallDateTime

)

On FG01



So far everything works ok, but in the next code there is an error:



-- Delete the table

Drop Table TABLE1

Go



-- Remove a FileGroup from the Database

Alter Database TESTING Remove FileGroup FG01

Go



-- Try to remove the file

Alter Database TESTING Remove File TESTING_DATA01



When I try to remove the file there is an error:

"Msg 5009, Level 16, State 9, Line 2
One or more files listed in the statement could not be found or could not be initialized"

View 2 Replies View Related

SQL Server 2008 :: Count Number Of Backup Files Deleted From A Default Backup Location

Mar 13, 2015

I've written a custom script to delete backup files from location. But unable to modify now to count the number of files are deleted. How to modify the script...

/* Script to delete older than N days backup from a specific directory */

USE [db_admin]
GO
IF OBJECT_ID('usp_DeleteBackup', 'P') IS NOT NULL
DROP PROC usp_DeleteBackup
GO

[Code] .....

View 2 Replies View Related

Backup Plan

Aug 13, 2006

I am having a hard time setting up a backup plan for my sql server databases. Right now I create a copy of each database on another machine on the network once a day. Once a week I upload a MSAccess version to a remote site. Obviously there are huge amounts of potential data loss if a crash of some sort would occur locally.

My new plan is looking like this:

1) Run a complete database backup once a day

2) Run Transaction Log backups every hour

My questions are as follows:

1) What role does a "Backup Device" play in this process (I currently do everything through the Enterprise Manager interface)?

2) I am having a hard time scheduling mydatabase_complete.bak and mydatabase_trans.TRN at all. I get several errors.

3) I would like to run these backups on another network machine but am not seeing how to access "My Network Places" from the "Backup Database" utility in Enterprise Manager.

Any help in the form of answers or pointing me towards a useful resource for this process would be much appreciated!

Thanks in advance~

View 1 Replies View Related

Help With Backup Plan

Feb 7, 2004

Hi all,

I am new to SQL and was given a SQL server to administer. There are lots of databases on the server and no one seems to know which one is used and which one is not. I try to do some cleanning.

1. Can I find out if there is any activity on a database so I can delete them off and how?

2. There are backup jobs that run every night which do a full backup. I am thinking of changing it to do full backup once a week and differential every night. These databases are updated daily. Some have lots of activities, some have less. Does that sound reasonable? and if I do differential backup, should I create separate back up file or should I add on to the full backup file?

Any comments or suggestions are greatly appreciated.

View 2 Replies View Related

Backup Plan

Jan 6, 2008

I would like to implement the following backup strategy in SQL Server 2000:
full backup is done once a week
diff backup daily
tran backup every hour


How should I approach this. Should I use a backup device linked to a hard disk file? Should I create a backup device for each type of backup (full, diff, tran) and schedule it. If I use a backup device how do I distinguish each backup for old backups.

thanks

View 4 Replies View Related

Unable To Delete Old ZIP Files Using Maintenance Plan

May 8, 2015

I'm using below script within the execute T-SQL statement task of the maintenance plan, which is created to delete the zip files older than 2 days, the task runs before the backup database task gets kicked off, but some how the task is not deleting the old .zip files.

Code being used within the task: output of the @delete_file variable within the delete command is Del X:SQLBackup*2015_05_06*.zip before it is passed to the final exec statement, the server is in EST time zone.

declare @ConvertDate char(10)
declare @Delete_file varchar(80)
set @ConvertDate = CONVERT ( char(10) , dateadd( dd, -2, getdate()) , 121 )

[code]....

View 5 Replies View Related

Maintenance Plan To Backup DB

Jan 24, 2002

Are there any known issues using Maintenance Plans to backup DBs in SQL Server 7.0

Thanks

View 1 Replies View Related

Backup Maintenace Plan

Apr 17, 2000

I made a backup maintenace plan in sql7.0, but it doesn´t work. The message included on the event logger is:

SQLServerAgent
SQL Server Scheduled Job
'DB Backup Job for DB Maintenance Plan 'Teste''
(0x219C5CB03C11D4119D8F0020188D7311) -
Status: Failed - Invoked on: 4/17/00 3:25:00 PM - Message:
The job failed. The Job was invoked by Schedule 12 (Schedule 1).
The last step to run was step 1 (Step 1).


And before this message there is another one that can be making something goes wrong:


SQLServerProfiler
Executable: C:WINNTsystem32mmc.exe
Description: Unable_To_Set_RegKey_Val
Source: ........srceventlog.c
Line: 315


Someone can help me telling me the reason that is generating this kind of error and doesn´t work. I have do the same think in others two server and there it works ok.
Thanks in regards

Sandra Lino

View 1 Replies View Related

Maintenance Plan Backup

Feb 23, 2000

I am doing full backups on 25 databases nightly using the SQL maintenance plan. Recently I have started getting the backup process hung on one database, so the whole plan does not finish. The job shows as executing, but nothing is being done, and nothing has been written to disk for this database. The SQL logs show a DBCC TRACEON 208, but the process it refers to is using another database. The NT logs do not show anything going on either. Additionally the backup process will not die when it is killed. They only way to make it go away is to stop and start the SQL Server. The system is a quad Pentium 450, 2Gig of ram, and plenty of disk space. It is NT SP5, SQL7 SP1. The DB is about 8.2 Gig. There are no other jobs scheduled to run at the time the backups run. Does anyone have any ideas what would be causeing the process to hang? Also what is a trace flag 208, it is not listed in BOL. Thanks for your help.

View 1 Replies View Related

Backup Maintenance Plan

Feb 7, 2003

I have a maintenance plan that I use to backup some of my databases and transaction logs. I have "Check Database Integrity" checked. If the database is being used by anyone when the backups are being performed, the check issues an error because the DB cannot be put into single user mode and then skips the backup. In the Plan, I have unchecked the box for "Perform these checks before backing up the database or transaction file" and apply the change. When I go back into the plan, the option is checked again. How can I get around this problem?

Thanks,
Ken

View 1 Replies View Related

Backup Maintenance Plan

Mar 21, 2002

I have a maintenance plan where I backup the system databases and my application databases every night. Once a week I do a Check Database Integrity. For the Master and MSDB databases, it errors out telling me that the database must be in single user mode. I thought that the maintenance plan would switch the DB to single user mode when it needed to perform its checks. Any suggestions on how to get this to work successfully?

Thanks,
Ken Nicholson

View 1 Replies View Related

Backup Vs. Maintenance Plan

Sep 6, 2001

I'm running sql server 2000. All the backups created through the Maintenance Plan failed (no specific error code), whereas backups created by itself (through database name => All Tasks => Backup database...) run fine. Does anybody have a clue why the Maintenance backup failed or how to trouble shout the problem?

The reason I want to make the backups from maintenance plan to work is that each backup will have a unique name and I can schedule to remove the old backup files from the system.

View 5 Replies View Related

Maintenance Plan: Backup

Jun 21, 2006

Hi,

I have made a maintenance plan to backup a database.

The file name is like this: name_db_200606211209.BAK

isn 't it possible to get the filename to be always the same
(without 200606211209)

I have unchecked the checkbox to remove files older than x-days
but it still appends 2006... to it

View 3 Replies View Related

How To Set Up A Stable Backup Plan?

Oct 17, 2006

Our database is more than 20,000,000 bytes and increase largely everyday

who can give me some advise about stable backup?

My database is sqlserver2005 and now i use files to backup including full backup and diff backup,whether is better to use device?

any ideas? thanks in advance

View 5 Replies View Related

Backup Plan SQL 2000

Aug 21, 2007

Hello all,
I would like to be able to backup our databases to a network share mapped drive. Is this possible? When every I go in to setup a maintenance plan it will only allow me to select local drive as the backup location. If my server crashes its not going to do a whole lot of good if my databases are stored locally (I do also backup up to tape every niight). I backup the databases every hour to local disk and would like to send them to one of my MS Storage Servers on the network.
Any help would be greatly appreciated.

thanks
Jason

View 3 Replies View Related

How Do I Remove An Expired Backup Set

Mar 9, 2007

Underneath is my backup SQL statement. On day 7, how do I tell SQL to delete the backup set of day 1 from Test.bak



DATABASE [Test] TO DISK = N'C:MSSQL BACKUPSTest.bak' WITH RETAINDAYS = 6, NOFORMAT, NOINIT, NAME = N 'Test-Full Database BackuP', NOSKIP, NOREWIND, NOUNLOAD, STATS = 10

View 4 Replies View Related

Maintenacen Plan Backup Problem

Jun 12, 2002

Hi:

Set up a Maintenance Plan backup job that is set to delete the backup file after 19 hours but it waits until another SQL backup job is completed before deleting the old backup file 27 hours later. (NT4 server, SQL7 SP1). Therefore the server requires space for two complete SQL backups just to hold one SQL backup. Not an issue when you have enough disk space but on very large databases 45GB+ it results in alot of wasted space.

The current workaround is to manually schedule the backup jobs TO DISK = with a nightlybackup.BAK filename. Then another job deletes that backup file at a specific time. Would like to use the maintenace plan for the detailed time stamp it labels the backup file. Any suggestions?

Thanks,

View 1 Replies View Related

Need A Reliable Backup Plan Fro SQL 2000

Nov 22, 2002

I have set up two Maintenance Plans to do daily backups overnight for our two DBs that are on our SQL server.

As a separate strategy we want to have a second backup done nightly that would involve
#1 detach the db(s)
#2 copy the mdf(s) and ldf(s) to L:xxx
#3 attach the db(s) again
#4 zip up the db(s)
#5 copy the files to a different server for storage.

I created #1, and #3 in query analyzer and saved the script.

I want the process to run at say 2AM and don't know how to schedule them to run - that is #1 ... #2 ... #3. Anyone have sample scripts for this kind of a backup strategy?

This seems like a very simple process especially for a restore and especially since there would not be any trasaction logs involved. This way if we had a KRASH we could take the backup from the separate server and install it on a warm SQL backup server.

Apart from the new servers name then what other steps would I need to cover to get the apps up and running in the quickest time. The app software runs as a client install - Access 97DB] I'm especially curious if I need to have more than a fresh MS2000 SQL server install.

I'm know I'm asking a lot for a first timer.
It seems we want to handle disaster recovery BEFORE we even have our first system crash.

many thanks

View 11 Replies View Related

Maintenance Plan --&> Backup --&> With Init?

Dec 10, 2003

Good morning.

We are running SQL Server 2000 with SP3. I have recently created a DB Maintenance Plan to backup all of our databases nightly to a local tape drive, and verify the backup of those databases. The backup plan itself runs fine.

The first time it ran, it ran in a little over an hour. Since then, I have noticed the time increasing nightly to the point that last night's backup took 8 hours. Our databases are not that big and do not have enough transactions to cause such a drastic change in a matter of weeks.

Investigating the problem, I have found that the issue lies in the fact that the tape is not initializing each night, and thus each night's backup is appending to an increasingly more full tape.

My question is this: Is there a way to force a DB Maintenance Plan to initialize the tape each night? I know that I can probably add a "with init" command to the T-SQL statement created, but I am not sure exactly where to fit it in. Does anyone have any suggestions?

Thank you for your time.

Michael

View 1 Replies View Related

SQL 2005 Backup Maintenance Plan

Jul 9, 2007

Hi there

I feel like a complete nitwit. I've been using SQL 2000 for about 5 years now and regularly set up automatic backups using the wizard for many people. I'm in no way an advanced user and have enjoyed some of the more user-friendly features of SQL 2000 such as the backup wizard.

Well now we have SQL 2005 and I can't find the "wizard". I did a lot of googling and found very little on this. The frustration is mounting - let alone the fact that I had to edit the registry just to be able to perform a manual backup in the first place... :-(

Apparently their is a "maintenance plans" folder but the only place I can find this is under "Legacy" and you can't create jobs there.

Has anybody else had this issue? Is there a bug in SQL 2005? I reinstalled the full version with all options selected and still can't find this folder. Am I just being completely "blonde"?

View 4 Replies View Related

Backup Maintenance Plan - Best Practices

Apr 11, 2007

Hi All,

I'm about to embark on creating a maintenance plan to back up all databases on one of our SQL 2005 servers. I am looking for some advice on best practices for doing this.

I have it in my mind that i want to be taking a full database backup once a week, with differential backups on a daily basis and transactional backups performed every 2 to 4 hours.

Do i need to create three maintenance plans for this, i.e. 1 for full, 1 for differential, and 1 for transactional?

If i want to only keep the backups from the last week, is this done by setting up a maintenance cleanup task in the full backup plan to clear all bak files that are a week old?
If so i'll also probably require one to remove the trn files also.

When using the backup command from the context menu in SSMS there is an option to name the backup set. How does this work when using maintenance plans as i haven't been able to find this option whilst trying out some of the features?

I'm sure to have more questions on this subject, but any help on the above queries would be most appreciated.

TIA,

Grant

View 1 Replies View Related

SQL 2005 Backup Maintenance Plan

Feb 16, 2007

In SQL 2005...

How do I specifty in the maintenance plan to only keep 3 days worth of backup.

Andre

View 4 Replies View Related

How To Overwrite The DB Backup For Multiple DB In A Plan

Oct 19, 2007

I have to created a Maintenance Plan in SQL 2005 to take the backup of 5 different DB at 2AM everyday. Each DB has its own sub-directory and backup file The total DB size is 35GB. I need to overwrite the exsisting backup instead of having new backup everytime.

View 4 Replies View Related







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