Showing posts with label MSSQL. Show all posts
Showing posts with label MSSQL. Show all posts

Wednesday, September 4, 2013

SQL Mirroring: Removing Mirroring



MS SQL server mirroring remove end points master key

You can create a master key in your SQL server


create master key encryption bypassword = 'abc123!!';


If you get below error

There is already a master key in the database. Please drop it before performing this statement.


you can remove existing master key

Drop Master key


If you ge below errorCannot drop master key because certificate 'HOST_B_cert' is encrypted by it.

You need to delete that end points.

You can get list of All end Points by executing below query

Use Master
select * from sys.EndPoints


Drop endpoint endpoint_mirroring

Now, you can drop the Certificates associated with that endPointDrop certificateHost_My_certificate_name

Then you can drop Master Key


Drop Master key





If you create new Master Key using encryption by passowd, you may receive below error.


"An error occurred during decryption"You can fix this by force fully auto generating the key using Force option and later generate your own key

ALTER SERVICE MASTER KEY FORCEREGENERATE


The alter database for this partner config values may only be initiated on the current principal server for database "DBNAMe".Means you need to set partner for witness on current Principal server

Sunday, July 7, 2013

MSSQL: Updating permission setting for folder failed / SeSecurityPriviledge is required


I encountered these 2 errors while doing installation on a server in a domain.

These 2 errors are probably caused by the user account been not having enough access right to the server.

I am having these error even though I am using an account under the Administrator group. By referring to Microsoft websites, the rights needed to complete the installation are:
1. Backup files and directories
2. Debug Programs
3. Manage auditing and security log

These rights need to be set under the local policy on the server as suggest by Microsoft document http://support.microsoft.com/kb/2000257.

Saturday, July 6, 2013

MSSQL: Reseed identity of table

DBCC CHECKIDENT (yourtable, reseed, 0)