Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-24-2008, 06:07 PM
esource
 
Posts: n/a
Default back up jobs, re-index question

We have a db that is accessed by users on the web 24/7. Problem is
when our maintenace job runs users are getting killed with this error:
Database Error: SQL Error #-2147217900
[Microsoft][ODBC SQL Server Driver][SQL Server]Transaction manager has
canceled the distributed transaction.
(Source: Microsoft OLE DB Provider for ODBC Drivers)
(SQL State: 37000)
(NativeError: 1206)

I'm assuming that one of the steps in the maintenance job causes this
because it happens every night at the same time as the job
Here are the steps in our job:
1. differential backup
2. kill users
3. Alter database DBNAME set Recovery BULK_LOGGED
4. reindex all tables
5. Alter database DBNAME set Recovery FULL
6. truncate log
7. shrink log
8. full backup
9. resize database (if needed)

Question is do we need to kill users before a re-index, re-size or
backup occurs? if we don't will it just slow the process up? any
other step that would cause that error?
Ideally we need a different design for a web accessed solution but we
need a quick fix now
thanks in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-25-2008, 12:42 AM
Greg D. Moore \(Strider\)
 
Posts: n/a
Default Re: back up jobs, re-index question

"esource" <darrenpaul@shaw.ca> wrote in message
news:08dc130f-a3ce-44aa-ad62-0c894e423c5c@k13g2000hse.googlegroups.com...
> We have a db that is accessed by users on the web 24/7. Problem is
> when our maintenace job runs users are getting killed with this error:
> Database Error: SQL Error #-2147217900
> [Microsoft][ODBC SQL Server Driver][SQL Server]Transaction manager has
> canceled the distributed transaction.
> (Source: Microsoft OLE DB Provider for ODBC Drivers)
> (SQL State: 37000)
> (NativeError: 1206)
>
> I'm assuming that one of the steps in the maintenance job causes this
> because it happens every night at the same time as the job
> Here are the steps in our job:
> 1. differential backup
> 2. kill users


This is not necessary.

> 3. Alter database DBNAME set Recovery BULK_LOGGED
> 4. reindex all tables
> 5. Alter database DBNAME set Recovery FULL
> 6. truncate log


Why are you doing this step? If you really don't care about the log, set
the DB to simple.

> 7. shrink log


Don't do this at all. It's detrimental.

> 8. full backup
> 9. resize database (if needed)


Same thing, do't do this.

http://www.karaszi.com/SQLServer/info_dont_shrink.asp
>
> Question is do we need to kill users before a re-index, re-size or
> backup occurs? if we don't will it just slow the process up? any
> other step that would cause that error?


It'll slow things down, but if you do it at night and intelligently, you
should be fine.


> Ideally we need a different design for a web accessed solution but we
> need a quick fix now
> thanks in advance




--
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-25-2008, 12:42 AM
Hugo Kornelis
 
Posts: n/a
Default Re: back up jobs, re-index question

On Thu, 24 Apr 2008 07:53:25 -0700 (PDT), esource wrote:

>We have a db that is accessed by users on the web 24/7. Problem is
>when our maintenace job runs users are getting killed with this error:
>Database Error: SQL Error #-2147217900
>[Microsoft][ODBC SQL Server Driver][SQL Server]Transaction manager has
>canceled the distributed transaction.
>(Source: Microsoft OLE DB Provider for ODBC Drivers)
>(SQL State: 37000)
>(NativeError: 1206)
>
>I'm assuming that one of the steps in the maintenance job causes this
>because it happens every night at the same time as the job
>Here are the steps in our job:
>1. differential backup
>2. kill users
>3. Alter database DBNAME set Recovery BULK_LOGGED
>4. reindex all tables
>5. Alter database DBNAME set Recovery FULL
>6. truncate log
>7. shrink log
>8. full backup
>9. resize database (if needed)
>
>Question is do we need to kill users before a re-index, re-size or
>backup occurs? if we don't will it just slow the process up? any
>other step that would cause that error?
>Ideally we need a different design for a web accessed solution but we
>need a quick fix now
>thanks in advance


Hi esource,

And here are some other comments that do not address your question:

1: Why do you reindex all tables? Is just reorganizing or rebuilding the
most fragmented indexes not sufficient in your case?

2: Why do you shrink the log? It slows down performance later (as it has
to grow the log again) and will cause your log file to become
fragmented. See http://www.karaszi.com/SQLServer/info_dont_shrink.asp.

3: Same goes for "resizing" the database. Growing it before autogrow
kicks in is a good thing; shrinking it is not. Especially not right
after reindexing, since the shrinkprocess will cause your indexes to
become fragmented again...

--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:26 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145