Posts

Starting SQL Server in safe mode if engine does not start

Starting SQL Server In Safe Mode (if engine does not start) If SQL Server Engine Does Not Start - for debugging there are other ways of starting SQL Server If the SQL Server service will not start try running in safe mode Can go to c:\program files\microsoft sql server\mssql10.mssqlserver\mssql\binn\ via command prompt sqlservr -c -f (this gives a verbose output to screen when starting to help diagnose) OR add -f to start parameters on microsoft sql server services screen to run safe mode as a service Starting SQL Server In Single User Mode (used for recovering master database) MSSQL Server can be run in single user mode by using the -m startup parameter on the mssqlserver service.  Use configuration manager - SQL Server Services - SQL Server - Advanced - Startup Parameters and apend -m; to start of parameters. No spaces between this and what follows.  In SQL Server 2012 and 2008 R2 add -m into Startup parameters as a seperate line (Startup parameters not underne...

Always on Groups Clusters and Quorum Configuration

Before we set up always on availability groups we need our windows servers clustered and configured according to the design of the cluster and number of nodes. When a cluster is created you must assign it a cluster configuration mode.  These are defined below and recommendation is based on factors such as number of nodes, geographical location and shared storage, Odd number of nodes Node Majority Even number of nodes (but not a multi-site cluster) Node and Disk Majority Even number of nodes, multi-site cluster Node and File Share Majority Even number of nodes, no shared storage Node and File Share Majority Our most basic setup for this will be two nodes with one node in either site.  Therefore Node and File Share Majority is the recommended cluster mode. The Quorum provides a majority number of votes to stay alive.  In this model if we lose two out of the three votes provided by Node1,Node2 and the Fileshare then we lose the quorum and the clus...

SQL Server Mirroring How to

SQL Server Mirroring Modes High Performance (asynchonus) - Commit changes on primary and then transfer them to the mirror Cannot use manual or automatic failover because these require guaranteed consistency between the primary and the mirror. If the mirror server instance goes down, the principal server instance is unaffected and runs exposed (that is without mirroring the data). transactions commit without waiting for the mirror server to write the log to disk Have to use force service which can cause data loss. http://msdn.microsoft.com/en-us/library/ms189270.aspx ALTER DATABASE <database_name> SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS Requires SQL Server Enterprise Edition to use High Safety without automatic failover (syncronous) - Always commit changes at both the primary and mirror. Will allow manual failover via mirroring/failover button. As soon as the databases are synchronized, a transaction is committed on both partners , at the cost of increased tr...

SQL Server Attach Database

All, Today morning I had an call from supplier that they need to get attached their files to the database . As SQL Server amazingly does this for us using SSMS , but i decided to give brain some food. Here it goes syntaxtically . Open  SQL QUERY Session and apply the following as shown below . CREATE DATABASE Transearch_KE       ON (FILENAME = 'D:\data\MSSQL14.KPHQTSRCH01SQP_1\MSSQL\Data\Transearch_KE.mdf'),       (FILENAME = 'L:\logs\MSSQL14.KPHQTSRCH01SQP_1\MSSQL\Log\Transearch_KE_log.ldf')       FOR ATTACH; Messages Converting database 'Transearch_KE' from version 852 to the current version 869. Database 'Transearch_KE' running the upgrade step from version 852 to version 853. Database 'Transearch_KE' running the upgrade step from version 853 to version 854. Database 'Transearch_KE' running the upgrade step from version 854 to version 855. Database 'Transearch_KE' running the upgrade step from ve...