SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Reading SQL Server's Transaction Log


Reading SQL Server's Transaction Log

Author
Message
Kraig Kerr
Kraig Kerr
SSC Journeyman
SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)

Group: General Forum Members
Points: 82 Visits: 265
Comments posted to this topic are about the item Reading SQL Server's Transaction Log
TRACEY-320982
TRACEY-320982
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3272 Visits: 1014
With this information would you be able to replicate the data to another database. Most of the software we use does not have primary keys so SQL Replication is not an option.

Mirroring, snapshots not an option as the reporting database needs to be up 24 /7 and not down whilst snapshots run or log transactions are built on the reporting database.

Just curious
Kraig Kerr
Kraig Kerr
SSC Journeyman
SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)

Group: General Forum Members
Points: 82 Visits: 265
Do the tables in question have any clustered indexes? If not you'd be dealing with "Heaps" and your only recourse would be to run a whole lot of DBCC Page commands or explore using %%phyloc%%. [url=http://sqlfool.com/2009/09/undocumented-function-in-sql-2008/][/url]

Also dealing with updates is a lot more complex than dealing with inserts.
faboudib
faboudib
SSC Rookie
SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)

Group: General Forum Members
Points: 36 Visits: 46
Nice article,

However, would you mind specifying on which versions of Sql Server this works? If this works only on Sql Server 2000, and that is your target platform, you might want to look into RedGate's free product SQL Log Rescue (http://www.red-gate.com/products/SQL_Log_Rescue/index.htm) for similar functioanlity. Otherwise great work...

Regards,
Lowell
Lowell
SSC Guru
SSC Guru (76K reputation)SSC Guru (76K reputation)SSC Guru (76K reputation)SSC Guru (76K reputation)SSC Guru (76K reputation)SSC Guru (76K reputation)SSC Guru (76K reputation)SSC Guru (76K reputation)

Group: General Forum Members
Points: 76700 Visits: 41002
I believe the target schema is 2008; it worked just fine for me...the object id of my table was actually exactly the same as the article.
in 2005 Express, i get a couple of minor syntax issues, but after i look deeper, i'm sure it'll be obvious what to tweak.

Thanks for the great article.
faboudib (11/22/2010)
Nice article,

However, would you mind specifying on which versions of Sql Server this works? If this works only on Sql Server 2000, and that is your target platform, you might want to look into RedGate's free product SQL Log Rescue (http://www.red-gate.com/products/SQL_Log_Rescue/index.htm) for similar functioanlity. Otherwise great work...

Regards,


Lowell
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Mike C
Mike C
SSCertifiable
SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)

Group: General Forum Members
Points: 6751 Visits: 1172
I'd like to stress a point the author mentioned in passing: this function is UNDOCUMENTED. What does that really mean? Well, to summarize:

1) Microsoft does not support the function. If you run into issues in production with this function, the first solution you will probably get is to remove the dependency on this function. Apart from that you're probably pretty much on your own.

2) It could have undesirable side effects. Blocking comes immediately to mind for this function.

3) It may not be available/accessible in the next release. That is, it can be pulled at any time, including major release, minor release, or even service pack. Sp_makewebtask anyone?

You mentioned Paul Randall, Kimberly Tripp and Isaac Kunen in your article, but I've never seen a recommendation from them to use this in production. Every time I've seen them use this it has been to demo one-off troubleshooting. You may want to clarify this before people start asking how they can use this to do things like create their own transaction log monitoring or home-baked custom replication systems in production environments. Nobody wants to waste money on a CSS call only to find out the code they've written using undocumented functionality is not supported.
Francis Apel
Francis Apel
Old Hand
Old Hand (306 reputation)Old Hand (306 reputation)Old Hand (306 reputation)Old Hand (306 reputation)Old Hand (306 reputation)Old Hand (306 reputation)Old Hand (306 reputation)Old Hand (306 reputation)

Group: General Forum Members
Points: 306 Visits: 542
Nice Article.

Thank you for taking the time to lay this out.

Francis
-----------------
SQLRanger.com
knoopix
knoopix
Grasshopper
Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)

Group: General Forum Members
Points: 21 Visits: 9
Very nice article ! Waiting the next one now Wink
Phil Brammer
Phil Brammer
Old Hand
Old Hand (399 reputation)Old Hand (399 reputation)Old Hand (399 reputation)Old Hand (399 reputation)Old Hand (399 reputation)Old Hand (399 reputation)Old Hand (399 reputation)Old Hand (399 reputation)

Group: General Forum Members
Points: 399 Visits: 640
However, if our table had been a HEAP this method works nicely because the data remains with the [Page ID] and [Slot ID] for the life of the HEAP.


That's not quite correct. Data will move in heaps and hence change page numbers. Updates to rows that cause the row to no longer fit on the page will cause it to move. When this happens a forwarding pointer is left in the original page, pointing to the new page. ALTER TABLE ... REBUILD will also renumber your pages and allocation_unit_ids.
Phil Brammer
Phil Brammer
Old Hand
Old Hand (399 reputation)Old Hand (399 reputation)Old Hand (399 reputation)Old Hand (399 reputation)Old Hand (399 reputation)Old Hand (399 reputation)Old Hand (399 reputation)Old Hand (399 reputation)

Group: General Forum Members
Points: 399 Visits: 640
The link to the MGM Mirage article does not work. I'm still trying to decifer what your reasons for reading the log are. Also, what version of SQL are you using for this demo?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search