How To Configure A Job For Maintenance Plan?
Nov 28, 2004hello, everyone:
I have a maintenane plan to backup user database daily, How to configure a job to execute this plan daily? Thanks
zyt
hello, everyone:
I have a maintenane plan to backup user database daily, How to configure a job to execute this plan daily? Thanks
zyt
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.
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!
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
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
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
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
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
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
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.
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
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!
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)
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
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
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
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?
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
Are there any known issues using Maintenance Plans to backup DBs in SQL Server 7.0
Thanks
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
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
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 RelatedI 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!!
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 RelatedI currently have a db setup to do full backups nightly with log backups scheduled to occur every two hours during the day. The plan was running fine until yesterday when I got the full backup and then one log, the next log file failed...the message I received is:
sqlmaint.exe failed [SQLSTATE 42000](Error 22029). The step failed
I am unable to find anything related to error 22029.
Any help would be appreciated.
I have set up a db maintenance wizard to back up all of our databases at
night, and also our transaction logs through the day
the db backups has worked once and the transaction back ups several times then this morning when I arrived I got the following
message in the history for both of the back ups
sqlmaint.exe failed. [SQLSTATE 42000] (Error 22029). The step failed.
I can't understand why, I haven't changed anything and nothing else was
running at the time
anybody got any ideas?
As one steps through the creation of a maintenance plan using the wizard provided,
various steps allow for a schedule specification.
If all schedule specifications are for the same time/dates, then:
1. Are all steps created executed?
2. In what sequence are the individual steps run?
I realize that there is little value to running a full backup and a transaction log backup back to back.
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
I am using SMTP to send out an email notification to inform me whether my backups were successful or not. The problem I have is that xp_sqlmaint does not set a return code. Without a return code to test, I do not know whether to send a success or unsuccessful message. Does any one have an idea on how to accomplish this?
Thanks,
Ken Nicholson
I have a weird one. I have 3 maintenance plans that were working for months and now suddenly are sort of not working. The jobs start and then take forever. I stop them from QA (EM doesn't appear to stop them). When I look at the Application log in the event viewer there are no errors because the jobs appeared to freeze. When I look at the maintenenace plan history it says the jobs completed in the usual short amount of time. When I look at the application log it says it did the backups of the data and transaction logs, etc. When I look on the server in the d:SQL ServerMSSQLLog directory for that maintenance plan, it says it completed the backups. So, essentially, EM is telling me the jobs haven't completed and everything else tells me the jobs did complete. But I won't feel secure until EM tells me the jobs have actually finished.
I did do a manual backup of one of the databases and then ran that maintenance plan for that database. I canceled the maintenance plan job after a few minutes (how long the job would usually take) and then looked at the size of the .BAK files. They were both exactly the same size.
I'd greatly appreciate any help!
Hi,
i am mid transfer from old to new server, how do you move a Maintenance Plan? I have moved the jobs using a DTS package but some of them are failing and it appears to be the ones that were created via the Maintenance Plan wizard. so two questions really:
1 - are they failing because the Maintenance Plan doesnt wexist on the new server?
2 - If so, how do i copy the Plan from the old server ?
TIA
FatherJack
I am trying to find information about SQL Server 2000 maintenance plan re-orgs (optimizations). Are these online? Offline? I have checked Books online, but don't find anything to answer this questions. Does anyone have a resource that could provide the answer for me?
Thanks.
I've just created a new maintenance plan (sql2k sp2) and attempted to re-enter it to make a change. right click - choose properities (or double click)...I see the dialog box 'flash' very briefly but it's not making itself available for editing.
I've deleted and recreated the plan ... same result.
I _should be able to edit it, shouldn't I?
thankx
--steve...