Hi,
I have a server log shipping to a second server. Whenever i try to perform a role reversal, the promote secondary jobs fails 90% of the time. It gives the error that exclusive access to the database cannot be obtained. When i get this error, I check the current activity and there is no connections to the database i'm trying to bring up.
This is the script i'm using:
use master
go
exec msdb.dbo.sp_change_secondary_role
@db_name = <DBNAME>,
@do_load = 1,
@force_load = 1,
@final_state = 1,
@access_level = 1,
@terminate = 1,
@keep_replication = 0,
@stopat = null
go
If i continue to try running it, the script may execute successfully but there doesn't seem to be an answer as to why it would work once and not all the other times.
Any help would save me a lot of headaches.
Thanks
I have a server log shipping to a second server. Whenever i try to perform a role reversal, the promote secondary jobs fails 90% of the time. It gives the error that exclusive access to the database cannot be obtained. When i get this error, I check the current activity and there is no connections to the database i'm trying to bring up.
This is the script i'm using:
use master
go
exec msdb.dbo.sp_change_secondary_role
@db_name = <DBNAME>,
@do_load = 1,
@force_load = 1,
@final_state = 1,
@access_level = 1,
@terminate = 1,
@keep_replication = 0,
@stopat = null
go
If i continue to try running it, the script may execute successfully but there doesn't seem to be an answer as to why it would work once and not all the other times.
Any help would save me a lot of headaches.
Thanks