Problems with Transactions which are not 'rolled forward'

  • 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

  • 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

  • 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 the

    select @@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.

  • 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"

  • 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

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • 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