Showing posts with label mode. Show all posts
Showing posts with label mode. Show all posts

Saturday, February 25, 2012

Buffer Leaks

I've had this a few times.

Can someone explain what a buffer leak is, and how are they avoided.

I downloaded the ExtraSort demo and in non-debug mode I get loads of errors saying the buffer leaked?

How do I plug the whole? Do I need a big cork?

Simon

Well there are 2 leak messages the buffer manager gives and since you didn't specify the exact message I don't know which one you are getting and they happen in very different scenarios. I will explain them both but they are both a component coding error.

1. This buffer has been orphaned...
This is when the engine is shutting down but a component still has a reference to a buffer. This usually mean the component has actually leaked a buffer since when the engine is shutting down everything else in the dataflow has already finished.

2. A call to ProcessInput unexpectedly kept a reference...
This is when a component calls AddRef on a buffer that it was passed in a process input call. This is not allowed. A component that needs to keep a buffer around that it was passed on process input must call clone on the buffer not addref.

You can't do anything about this problem. The component author must fix their component to resolve these problems.

HTH,
Matt

Thursday, February 16, 2012

Bringing Standby server online when in "no recovery mode"

Hi,

I am trying to set up Log Shipping. Though I have the following problem...
I want to set up LS without any user being able to connect. As I understand, this means I have to select the "No recovery mode" in the "Add Destination Database" window when creating the Log Shipping Maintenance Plan.
This all works fine. I set this up, no user can connect to the database (it shows status: (Loading) ), perfect.

However, the problem I encounter is when I want to bring the Standby server online.
I run the 'sp_change_primary_role' SP on the primary server... works fine.
I run the 'sp_change_secondary_role' on the standby server... errors:

Server: Msg 927, Level 14, State 2, Line 1
Database 'Northwind' cannot be opened. It is in the middle of a restore.
Server: Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Server: Msg 14440, Level 16, State 1, Procedure sp_change_secondary_role, Line 49
Could not set single user mode.

So what am I doing wrong? Am I forgetting something? I think i must do. The only way to get the secondary (standby) online is to do a "detach - attach", as far as I know.
I can not check its Properties or do a restore or backup of this database either.

Any help would be very much appreciated.

Thanks in advance and kind regards,

Jan V.Run the following command, to open the database:

restore database (name of database) with recovery

This will trigger a recovery of the database, and reset the database to "open" from "loading"