Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Database maintenance plan? good or bad

Author  Topic 

pearsont74
Starting Member

27 Posts

Posted - 2007-02-21 : 15:27:48
ok...just want to get a oppion on this. looks like it could be useful to me but i also thought the auto shrink look like a good feature lol
pro and cons and setting that are recommended.
goal is to trim the size of the db as much as possible. we ahve a db we import new datasets to monthlyand its gettin huge...not to mention the log is too....thanks

Kristen
Test

22859 Posts

Posted - 2007-02-21 : 15:34:37
"but i also thought the auto shrink look like a good feature"

OK, so you are willing to learn ...

"goal is to trim the size of the db as much as possible"

bad idea. If the database needs xGB to get through the week then give it X to work with. If you give it some smaller number it will have to extend it during the week, and shrink it back again at some point. That will consume loads of resources, and fragment the file.

Work on preventing "exceptional" growth of the files. Make TLog backups as often as possible (every 10 minutes is good), worry about processes that extent the TLog hugely (Reindex for example) and split them into smaller process were prudent.

if you have enough disk space, and the Log Size is tolerable, then just Live With It.

"we ahve a db we import new datasets to monthlyand its gettin huge...not to mention the log is too"

Consider importing, minimally-logged, into a staging database, and then from there "optimally" into the real database.

Optimally might mean:

"In small batches" so that TLog backup gets a chance to backup regularly - rather than just once at the end of the job

"Where changed" - use a more slinky process:

1. DELETE if no-longer-in-the-import-file
2. UPDATE if in-the-file-but-changed-in-at-least-one-column
3. INSERT if not-in-the-file

Kristen
Go to Top of Page

pearsont74
Starting Member

27 Posts

Posted - 2007-02-21 : 16:10:35
absolutely im willing to learn :)
ok...so run the back up the tlog often...should the db maintenance plan be used for this?
everthing else we basically do...
one question, if reindexing is a tlog filler...how do we get around having to do this. i was told somewhere along the line that when i do imports its best to drop the indexes...is this true?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-02-21 : 16:36:05
I don't use maintenance plans for anything except log shipping.

Here's what I use:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx

Tara Kizer
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-02-21 : 16:39:09
"should the db maintenance plan be used for this?"

My "take" would be:

The "serious" folk here don;t use Maintenance Plans
However, they probably took countless hours coming up with "better mousetraps"

So, unless you have the time & inclination the Maintenance Plans are a good place to start.
However, be prepared to discover their shortcomings and build your own replacements

"if reindexing is a tlog filler...how do we get around having to do this"

You could use INDEXDEFRAG instead; the relevant WhitePaper suggests that this is pretty much as good as a REINDEX. Particularly in combination with DBCC SHOWCONTIG so that you ONLY rebuild the indexes which are sufficiently fragmented to warrant it. For my money it keeps the MDF smaller (and the LDF of course), and that reduces the overall size of the "elbow room" for the database, which in turn means that a restore is quicker (this is more so under SQL 2000 than SQL 2005)

"i was told somewhere along the line that when i do imports its best to drop the indexes...is this true?"

If you are reimporting ALL the data (or maybe MOST of it) then yes.

DROP INDEXES
TRUNCATE TABLE
IMPORT DATA
CREATE INDEXES

is going to be more efficient than:

CREATE INDEXES
TRUNCATE TABLE
IMPORT DATA

However, it would probably be best to:

1. Have the Clustered Index in pace during the Import
2. Make sure that the import data is pre-sorted in Cluster Index order
3. Provide the appropriate "hint" to the Bulk Import that the import data is pre-sorted

Kristen
Go to Top of Page
   

- Advertisement -