Wednesday, November 26, 2014

Set DEADLOCK_PRIORITY to update Database in Single_User mode


If you need to access a Database in Single_user mode, to either take it offline or change to MULTI_USER, change the DEADLOCK_PRIORITY so your process does not get picked as deadlock victirm.

SET DEADLOCK_PRIORITY HIGH
--KILL 58   -- kill the session using the database
ALTER DATABASE [DB_NAME] SET OFFLINE WITH ROLLBACK IMMEDIATE
--ALTER DATABASE [DB_NAME] SET MULTI_USER WITH ROLLBACK IMMEDIATE
SET DEADLOCK_PRIORITY NORMAL

Wednesday, August 13, 2014

Unable to manage cluster using failover cluster manager = Start the Server service

I had trouble connecting to my cluster in Failover Cluster Manager today and Google found me this

Easy resolution
Open services console and start the Server service.

Unable to manage cluster using failover cluster manager. Error Received: "Connection to the cluster is not allowed since you are not an administrator on the clu...

Changing the default SQL Server backup folder, using SSMS Facet

I found out that I cannot input a file share location during SQL Server 2014 installation, under Database Engine Configuration -> Data Directories tab -> Backup directory (I could do it in 2008 for sure)
e.g. \\fileserver\sql_backup

Therefore I had to input a local Backup path, and change the setting after install

I always thought I had to hack the registry (something like changing the key value in Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQLServer, value: BackupDirectory)

But instead there's an easier way, by using SSMS -> right-click and choose "Facet"

Source:
The old registry way - Changing the default SQL Server backup folder
The NEW Facet way - Changing the default SQL Server backup folder