Wednesday, March 28, 2012

How to create maintenance plan without Northwind and Pubs

When creating a new database maintenance plan, there are four
different sets of databases to select:
o All databases
o All system databases (master, model, and msdb)
o All user databases (all databases other than master, model, and
msdb)
o These databases ...
I think that the most useful choice would be "All user databases
(excluding Northwind and Pubs)". But there are no such choice. Why?
How can I exclude the two demo databases from "user databases"? I know
I can delete them or mark them offline, but do I have to? I still want
to use them sometimes and therefor keep online.
So far I have used the "These databases" choice but it's sometimes
hard to keep track of all new and deleted (and offlined) databases.
The "All user databases (excluding Northwind and Pubs)" would be a
perfect solutions.
If I backup all user databases INCLUDING Northwind and Pubs, how can I
make some kind of trigger to detect a new backup file on disk and
delete it? The deletion should occur before the file would be written
to tape.
MarkkuAnswering on your last paragraph.
You can add one more CmdExec step to the backup job:
if exist c:\backup\pubs*.bak del c:\backup\pubs*.bak
if exist c:\backup\Northwind*.bak del c:\backup\Northwind*.bak
Bart Simpson
On 2 Mar 2004 01:25:24 -0800, google@.netti.fi (Markku Vainio) wrote:
>When creating a new database maintenance plan, there are four
>different sets of databases to select:
> o All databases
> o All system databases (master, model, and msdb)
> o All user databases (all databases other than master, model, and
>msdb)
> o These databases ...
>I think that the most useful choice would be "All user databases
>(excluding Northwind and Pubs)". But there are no such choice. Why?
>How can I exclude the two demo databases from "user databases"? I know
>I can delete them or mark them offline, but do I have to? I still want
>to use them sometimes and therefor keep online.
>So far I have used the "These databases" choice but it's sometimes
>hard to keep track of all new and deleted (and offlined) databases.
>The "All user databases (excluding Northwind and Pubs)" would be a
>perfect solutions.
>If I backup all user databases INCLUDING Northwind and Pubs, how can I
>make some kind of trigger to detect a new backup file on disk and
>delete it? The deletion should occur before the file would be written
>to tape.
>Markku|||Bart Simpson <bartsimpson000@.yahoo.com> wrote in message news:<jvk940d4b2nrqud5gtn0bk2gjnfusgc96f@.4ax.com>...
> Answering on your last paragraph.
> You can add one more CmdExec step to the backup job:
> if exist c:\backup\pubs*.bak del c:\backup\pubs*.bak
> if exist c:\backup\Northwind*.bak del c:\backup\Northwind*.bak
Thanks for your thoughts, but my Enterprise Manager says, that "It is
not recommended that jobs created by the maintenance plan be modified
in any way." I think there are a good reason for this.
It seems that there isn't any good solution for the demo database
backup maintenance problem. I think it would be best to just avoid
using the "All user databases" choice. Selecting all needed databases
one by one is the safest choice.
Markku|||I always delete the demo databases from production machines. Why do you want
to litter the machine with those databases? IF you need it for some test or
so, you can always create them from the script files.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Markku Vainio" <google@.netti.fi> wrote in message
news:2a683d86.0403050940.4022d634@.posting.google.com...
> Bart Simpson <bartsimpson000@.yahoo.com> wrote in message
news:<jvk940d4b2nrqud5gtn0bk2gjnfusgc96f@.4ax.com>...
> > Answering on your last paragraph.
> > You can add one more CmdExec step to the backup job:
> >
> > if exist c:\backup\pubs*.bak del c:\backup\pubs*.bak
> > if exist c:\backup\Northwind*.bak del c:\backup\Northwind*.bak
> Thanks for your thoughts, but my Enterprise Manager says, that "It is
> not recommended that jobs created by the maintenance plan be modified
> in any way." I think there are a good reason for this.
> It seems that there isn't any good solution for the demo database
> backup maintenance problem. I think it would be best to just avoid
> using the "All user databases" choice. Selecting all needed databases
> one by one is the safest choice.
> Markku|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message news:<OQSfbpuAEHA.628@.TK2MSFTNGP10.phx.gbl>...
> I always delete the demo databases from production machines. Why do you want
> to litter the machine with those databases? IF you need it for some test or
> so, you can always create them from the script files.
Actually deleting the demo db's is the most straightforward idea. I
didn't earlier know how they can be rebuilt so I didn't want to lose
them ;-). Now I know. Thanks!
Markku

No comments:

Post a Comment