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


ADVERTISEMENT

SQL Server 2008 :: Maintenance Plan Delete History Trying To Delete Wrong Files

Sep 11, 2015

I have some simple files but they are failing because the delete history task is failing as it is looking for files in a non existent directory.

It is looking for files in C:Program FilesMicrosoft SQL ServerMSSQL10_50.INSTANCEMSSQLLog whereas it should be looking in C:Program FilesMicrosoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLLog

how I can get this corrected so I can get the Maintenance Plans to run correctly.

I have tried deleting and recreating the Plan but to no avail

View 0 Replies View Related

Maintenance Plan Fails Trying To Delete Files Older Thean One Day. Running SQL Server 2005

Oct 1, 2007

I get the following message when I execute a mantenance plan to delete files older than 1 day.

Error # -1073548784

Executing the query "EXECUTE master.dbo.xp_delete_file 0,N'',N'',N'2007-09-30T07:56:09'
" failed with the following error: "Error executing extended stored procedure: Invalid Parameter". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

Any help would be appreciated!!

View 3 Replies View Related

Unable To Create New Maintenance Plan

Mar 13, 2008

I am unable to create new maintenance plan in my SQL Server 2005 Enterprise Edition SP2. I am getting the following error. Please some one help me.


TITLE: Microsoft SQL Server Management Studio
------------------------------

Method not found: 'Void Microsoft.SqlServer.Management.DatabaseMaintenance.TaskUIUtils..ctor()'. (Microsoft.SqlServer.MaintenancePlanTasksUI)

View 1 Replies View Related

Maintenance Plan Won't Run, Modify Or Delete

Feb 28, 2008

Had to replace leased server hardware running Server2003, Sql2005. Had machine Server B, set up sql2005, set up maintenance plan to do full backup on all user dbs every night to Server C network share. Worked great for over a week. Came time to do the swamp, brought down old server, renamed Server B to Server A, ran:
EXEC sp_dropserver '<old_name>'
GO
EXEC sp_addserver '<new_name>', 'local'
GO

All other functions to the database seem to be working fine. Was using a network administrator account - same one that worked before the name change so the SID is the same. Unfortunately, I decided to try and delete and start over in case it was just a gliche. Now, the history seems to be gone, but I can't actually delete the job or the maintenance plan. Get an error "Does not allow remote connections." even when I'm physically sitting at the machine.

Now, maintenance plans won't run - can't delete them, can't modify them. Other dts packages that execute a query or bring in data from other datasources work just fine.

Help!?

View 20 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

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

SQL Tools :: Unable To Save A Maintenance Plan In 2005 / Class Not Registered

Nov 2, 2015

Unable to save a maintenance plan in sql server 2005, SP3. Error is class not registered.

View 2 Replies View Related

Can't Delete Maintenance Report Files (txt) In SQL/2005

Jul 30, 2007

I have several maintenance plans setup and working in SQL/2005 (sp2 9.0.3042) on several servers; however, the .txt maint plan output files will not delete on any of the servers. The backups run fine, the old database and transaction log backup files delete fine (.bak and .trn); but, the .txt files won't go away unless I delete them by hand. I tried copy/paste the scripted command (xp_delete_file) and it runs with no errors but does not delete the old .txt files. ( This server was upgraded from SQL/2000 -

EXECUTE master.dbo.xp_delete_file 1,N'E:Program FilesMicrosoft SQL ServerMSSQLLOG',N'txt',N'2007-07-09T10:59:38'

)
I do NOT specify a period (.) in the file extension dialog box. Any ideas before I setup a .cmd batch file and schedule it instead?

Thanks in Advance,

DeWayne

View 6 Replies View Related

Sql Server 2005 Maintenance Task Delete Files Does Not Work

Mar 24, 2008

I used the toolbox to select maintenance cleanup task to create the job to do this. In reading similar notes regarding this problem, some people mentioned that there was a choice to include subfolders. I do not have this choice. When I execute select @@version I get Microsoft SQL Server 2005 - 9.00.3042.00 (X64) Feb 10 2007 00:59:02 Copyright (c) 1988-2005 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2) . This is running on a cluster. Any idea what is going on here? Thanks.

View 6 Replies View Related

Unable Delete Remote Files Using FTP Task

Sep 28, 2006

I can create remote folder and delete it

I also can create remote files but i can not delete remote files

error warning is like subject

any ides? thanks

View 7 Replies View Related

Maintenance Plan Wizard Vs Tsql Maintenance

Aug 17, 2007

Hello,

I have a question that I hope someone can clear up for me. I have come across a number of different suggestions on DB maintenance, for example reindexing with the following script:

USE DatabaseName --Enter the name of the database you want to reindex

DECLARE @TableName varchar(255)

DECLARE TableCursor CURSOR FOR
SELECT table_name FROM information_schema.tables
WHERE table_type = 'base table'

OPEN TableCursor

FETCH NEXT FROM TableCursor INTO @TableName
WHILE @@FETCH_STATUS = 0
BEGIN
DBCC DBREINDEX(@TableName,' ',90)
FETCH NEXT FROM TableCursor INTO @TableName
END

CLOSE TableCursor

DEALLOCATE TableCursor

My question is, doesn't the maintenance plan have this functionality inherent in it when you create the maintenance jobs to reindex? Is there a benefit to scripting things out vs just using the maintenance plan wizard for this sort of thing and any of the items it covers? I came from an Oracle background where this was a no-brainer but I am a bit confused on the choices with SQL Server.

Thanks.

View 1 Replies View Related

SQL Maintenance Plan

Mar 5, 2001

I have deleted a database from SQL Enterprise Manager. Anyone know a way to clear that database from my maintenance plan? I do not wish to just uncheck the deleted database or create a new database plan.
Thanks!

View 1 Replies View Related

Db Maintenance Plan

Oct 23, 2001

Hello All

I have been given a SQL Server 2000 database to look after which has been set up with a Database maintenance plan. The plan is set to backup the complete database and the transaction log. The backups are written to the local disk correctly but the plan is also set to remove any backup files (both database .BAK and transaction log .TRN) that are over one week old. Complete database .BAK files are written daily and the .TRN are written every hour daily. The .BAK files are removed ok automatically but the .TRN files are not - they are just slowly filling the disk. There does not seen to be anything different between the way the main database and the transaction log is set up in the maintenance plan.

I would be very grateful for any ideas

View 1 Replies View Related

Maintenance Plan

Aug 31, 2000

I have a strange thing in one of our Maintenance plans.

On the first tab where you check which databases you're including in the plan I have (say my database name is CAT) a 'CAT' and 'cat' database listed and the one chosen is 'cat'. However my database in all other views shows up in all caps. (even when I do an sp_helpdb)

The backups look like they're working, etc. but it just seems weird. If I go to create a new plan it only gives me the one option 'CAT' which is really what's there. I'm new and I'm thinking the database at one time was 'cat' and this is when the maintenance plan was created. Then it was renamed to 'CAT' and there's the two db's showing in the old mainenance plan.

What would you do? Create a new plan with "CAT" and just get rid of the old one with the weird 'cat' and 'CAT'?

Any other suggestions or ideas on what happened..

ann

View 1 Replies View Related

Maintenance Plan

Oct 4, 1999

I've created a database maintenance plan to backup a database, but it just
isn't happening, am i missing something. The maintenance plan appears to be
created successfully.

responses appreciated.

thanks
Todd Minifie

View 6 Replies View Related

Maintenance Plan

Oct 1, 2004

Can you generate script for a maintenance plan?

I know how to script a job, I was wondering about a plan.

If not, whats the best way to record the configuration?

Thanks

Lystra

View 3 Replies View Related

Maintenance Plan

Apr 7, 2008

hi everyone..
this is a little bit weird ..
i am trying to make a backup strategy. i am using sql2005.
when i go to maintenance plan. right click >> new maintenance plan...
nothing happens..
if i go with the maintenance plan wizard everything goes normally.
after doing the backup, if i right click on it and press
modify , nothing happens too.
what i mean by nothing happens is that it doesn't open the "design view".
the back up is doing normally.. but i need to set a range of 5 days before overwriting the oldest backup.
any idea what is going on or what am i missing?!
thank you

View 2 Replies View Related

Maintenance Plan??

Apr 9, 2008

Windows Server 2003R2 w/ Sp2
SQL 2005 w/ Sp2

Created weekly (full backup) and a daily (differential backup) Maintenance Plans using the wizard. I formatted the server, installed the OS and SQL. Restored the full backup (No Recovery Mode), then restored the differential backup (Recovery Mode), tested and all worked well.

Then I noticed the original Maintenace Plans I created (Full and Differential) were gone; makes sense as I had formatted the server.

Is there a way to create a Maintenance Plan file or script that I can save and just add back to the server??

Hope that makes sense.
Any help appreciated.
Kerry

View 3 Replies View Related

Maintenance Plan OK?

Feb 26, 2006

Hello 2 all,

Could someone advise and/or correct me with my thoughts on how I would do my db maintenance plans?

(db's on SQL2000 as 'full' model)

Backups:
1) Daily Transaction log backups scheduled frequently enough.
2) Full Backup scheduled daily. Good way to start I presume ;)

Maintenance: Would be scheduled daily if possible, on non-production hours and if not colliding with daily full BU schedule.

3) Full DB reorg data&indexes.
4) Update Query Optimizer Stats (although 'Auto Update Stats' is on)
5) Shrink the logfile (ldf) as I presume this will have grown due to previous maintenance jobs.
6) If 5 ok, alter ldf filesize back to new allocated size.

Rgds,
T.

View 6 Replies View Related

Maintenance Plan

Mar 9, 2006

Hi

As per my backup policy I need to do a full backup dialy & transactional backup every 30 minutes , can i use the Maintenance plan to do this

or should I write T-sql statements & create jobs.....

I mean whats the difference between the two methods.


Thanks

View 5 Replies View Related

In Need Of Maintenance Plan

Jul 22, 2006

Hi folks.

Our products are VB6-based interacting with MSDE2000 i.e. none of our clients have EM. We have auto-backups performed twice a day by default and we encourage people to keep it to a least 2 per day.

Yesterday, one of our clients reported a problem. Upon investigation, I did a DBCC CheckDB WITH ALL_ERRORMSGS which returned the following:

Object ID 1461580245, forward row page (1:159), slot 50 points to page (1:234), slot 43. Did not encounter forward row. Possible allocation error.

So after reading a lot of posts and blogs from Paul Randal, I proceeded cautiously to copy the DB then perform a DBCC CheckDB REPAIR_REBUILD which had no effect, then a DBCC CheckDB REPAIR_ALLOW_DATA_LOSS which also had no effect. Then, I determined which table was at fault via DBCC CheckTable and I exported its data to a blank table where I discovered the missing data row and corrected for it manually. End of story.

Not a funny situation. The worst part is that this defect may have been there for a very long time, meaning that restoring the latest backup would not have helped the situation. I now realize that relying on backups alone is a huge no-no.

So, having been scarred into reality, I would like to install an automated maintenance plan. I'm used to doing it on my personal station using EM but, as stated above, I can't do that for the clientele. I was thinking about simply shrinking the databases and then doing a DBCC CheckDB WITH ALL_ERRORMSGS on all of them before performing a backup. Would this be a complete enough procedure or should I be doing something else? My understanding is that this will verify index structure and data integrity, and not attempt to repair anything which is uncovered.

Any thoughts of wisdom would be greatly appreciated.

Thanks!

View 19 Replies View Related

Maintenance Plan

Nov 8, 2007

Hi,

I have created maintenance plan. It was working fine. When I tried to edit it gives me error. How to sollve this error?
Please help me.



Cannot show the editor for this task.

ADDITIONAL INFORMATION:

Value of '11/8/2007 12:00:00 AM' is not valid for 'Value'. 'Value' should be between 'MinDate' and 'MaxDate'.
Parameter name: Value (System.Windows.Forms)

View 1 Replies View Related

Maintenance Plan

Feb 1, 2008

Hi All,
As a part of creating a maintenance plan i want to copy the backfiles from the server to another machine.How can i achieve this .Please help its very urgent.



Thanks in Advance


RKNAIR

View 5 Replies View Related

Maintenance Plan Help

Feb 7, 2008

Hello everyone!

I was wondering if there were any best practices for creating maintenance plans?
Im just getting started into the DBA world and have been delegated the task of creating maintenance plans for our 8 SQL servers.

Right now, our backup policy is Fulls on Saturday, differentials Monday-Friday.

Also, since im new, if you defragment the database and rebuild the index, does that have the possibility of "breaking" anything?

Just looking for some good articles, or anything to get me started on best practices.

Much appreciated.

TCG

View 10 Replies View Related

Maintenance Plan Help

Mar 13, 2008

I am relatively new to SQL Server 2005. I have gone ahead and created a maintenance plan which backs up all our databases. This plan is scheduled to run every night. The problem is that each time the plan runs, new backup files are created which quickly uses up valuable disk space.

How do I set up SQL Server 2005 to only create one set of backup files and overwrite any existing files when the maintenance plan is run? I tried playing with the "backup set will expire" settings, this did not seem to do anything.....

Thanks

View 4 Replies View Related

DB Maintenance Plan

Dec 5, 2006

I have a SQL 2000 server that has a small but very important database (about 5GB). The current maintenance plan does trans logs every hour and full every day. Currently they are to file on the same drive array. I would like to send them to a share on another server just to be really safe.

Would it be better to

1. Redirect the maintenance plan so that trans logs and backups go directly to the share

or

2. Keep the maintenance plan back ups to the current location and write a script that runs every hour and copies the .bak files to the share.

Also, since the database is so small should I just do full backups every hour instead of transaction?

View 4 Replies View Related

Maintenance Plan, Reindexing

Mar 24, 2005

In the Enterprise Manager of SQL Server 2000 I have set up a maintenance plan which rebuilds my indexes. I've stuided the documentation, and from what I've learned what happens behind the curtain is that several DBCC REINDEX commands are being issued.
Question:
If I have 20 tables and 40 indexes: Will SQL Server do the maintance plan in 1 single transaction, or will it divide the it up to eg. 20 or 40 transactions?

-h

View 1 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

Database Maintenance Plan

Mar 12, 2002

Hi there,

We are using a database maintenance plan to backup and reindex our db's. Up until the end of last month this was working perfectly - however now it has stopped deleting the old backups (even though we have checked 'Delete files over 1 day old').

Does anyone have any ideas as to why they are now being deleted - and how we can remove them automatically - has something been corruped? Would it be a case of creating a new maintenance plan?

thanks in advance,
Matt

View 1 Replies View Related

Maintenance Plan ERROR!!!

Apr 27, 2001

Hi,

I am getting the following message from one of my scheduled Maintenance plan, anyone know what this mean.

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


Martin

View 6 Replies View Related

Backups And Maintenance Plan

Aug 9, 2001

I've set up a maintenance plan to back up the database at a certain time of day. But it never seems to work, which I don't understand. I'm the creator of the database as well as the DBA with all rights. I can create a manual backup, and I have full access to the default backup directory on SQL server. I've also tried scheduling automatic backups, but it won't work from there either. I've tried pretty much everything to get this to work. I've checked the Maintenance Plan History for that particular Maintanance Plan, and it shows no evidence of failure--or any history of activity at all--nothing. It just ignores the maintenance plan entirely. What could be the problem here?

View 3 Replies View Related

DB Maintenance Plan Wizard

Sep 14, 2000

I have created the backup plan for all the 40 user databases on one of the production servers.Scheduled to run the backup at Sunday 2.00AM every week on to a different drive on the same server.If all the databases are backed up at the same specified time,will it effect the performance or anything?Under the maintenance plan wizard,there is no option to select different times for different databases.Total size of all the databases will be 10GB.Does it take the backups one after another DB or all at the same time which is specified?Any idea on potential problems?
Thanks!!

View 1 Replies View Related







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