October 2, 2008 at 3:58 am
I have a Database which was not properly detached from the SQL Server.
When I open the Database (read/write) with osql and sp_attach_db I get the Message:
20 transactions rolled forward in database 'xxx' (6).
0 transactions rolled back in database 'xxx' (6).
The Problem is, that I have to open this Database write protected. In this case the transactions are not 'rolled forward' and some Data is missing.
How can I find out if there are transactions which are not 'rolled forward'.
Regards
Mulenker
October 2, 2008 at 4:15 am
do you mean transactions that have not been commited or rolled back if that is the case have you tried the
select @@trancount
function to check what is outstanding
October 2, 2008 at 4:42 am
Neil Gelder (10/2/2008)
do you mean transactions that have not been commited or rolled back if that is the case have you tried theselect @@trancount
function to check what is outstanding
select @@trancount says 0.
I think that the Transactions are committed in the log file, but the Data has not been written to the Databasefile.
October 14, 2008 at 1:08 am
It is not advisable to forcefully deattach and then reattach the DB. You are right data is not there in the data file. You should have a good backup plan which will help you in this kind of scenario.
"More Green More Oxygen !! Plant a tree today"
October 14, 2008 at 1:34 am
Attach the database read-write, let it recover properly. Detach it again and then you should be able to attach it read-only without problems.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 14, 2008 at 1:48 am
Thanks Gila. Thats a new thing I learnt today.
"More Green More Oxygen !! Plant a tree today"
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply