• DBA

    No sysadmin access Microsoft SQL server error 18461

    Login failed for user reason single user mode only one administrator can connect at this time Microsoft SQL server error 18461   You might get a situation that no sysadmin access to SQL server and server installed by someone. Breaking SQL server and adding SA sysadmin of yourself by SQLCMD. You should be OS administrator.   First find out ‘Binn’ folder where it is installed C or D drive. Better search in my computer. Open a CMD with administrator Type: cd /d E:\Program Files\Microsoft SQL Server\130\Tools\Binn (OR) 1.Stop the SQL server service 2.Start the service in Single user mode by adding ‘;-mSQLCMD’ to the parameters from SQL server configuration manager…

  • AutoMon

    CPU high alert notification Automon DBA SPs – AM14

    This script will check the CPU usage and notify an alert when the it reaches the threshold. Table: use dbadata go DROP TABLE tbl_CPU_usgae CREATE TABLE [dbo].[tbl_CPU_usgae]( [servername] [varchar](100) NULL, [SQL_CPU_utilization] [int] NULL, [Idel] [int] NULL, [other_process] [int] NULL, [rundate] [datetime] NULL --,[Upload_date] [datetime] NULL ) use dbadata_archive go DROP TABLE tbl_CPU_usgae CREATE TABLE [dbo].[tbl_CPU_usgae]( [servername] [varchar](100) NULL, [SQL_CPU_utilization] [int] NULL, [Idel] [int] NULL, [other_process] [int] NULL, [rundate] [datetime] NULL, [Upload_date] [datetime] NULL )   SP: /* use dbadata go DROP TABLE tbl_CPU_usgae CREATE TABLE [dbo].[tbl_CPU_usgae]( [servername] [varchar](100) NULL, [SQL_CPU_utilization] [int] NULL, [Idel] [int] NULL, [other_process] [int] NULL, [rundate] [datetime] NULL --,[Upload_date] [datetime] NULL ) use dbadata_archive go DROP TABLE…

  • DBA

    The Cluster service failed to bring clustered service or application completely online or offline. One or more resources may be in a failed state.

    Recently, one of alwaysON cluster had issue, cause of file share witness box down and we brought up the box online.   Errors: The Cluster service failed to bring clustered service or application completely online or offline. One or more resources may be in a failed state. This may impact the availability of the clustered service or application. Cluster resource ‘File Share Witness’ of type ‘File Share Witness’ in clustered role ‘Cluster Group’ failed Based on the failure policies for the resource and role, the cluster service may try to bring the resource online on this node or move the group to another node of the cluster and then restart…

  • AutoMon

    AlwaysON availability group status alert notification Automon DBA SPs – AM13

    This script are used to collect SpServerDiagnostics results on target server, when AG is not working. Additional SP: Sp1 USE [DBAdata] GO /****** Object: StoredProcedure [dbo].[usp_SpServerDiagnostics_new] Script Date: 15-04-2017 14:29:39 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO /* CREATE TABLE [dbo].[SpServerDiagnostics]( [create_time] [datetime] NULL, [component_type] [sysname] NOT NULL, [component_name] [sysname] NOT NULL, [state] [int] NULL, [state_desc] [sysname] NOT NULL, [data] [nvarchar](max) NULL ) */ --DROP PROC [dbo].[usp_SpServerDiagnostics] alter proc [dbo].[usp_SpServerDiagnostics_new] (@Server_name varchar(50)) --with Encryption as begin EXEC('Exec ['+@Server_name+'].MASTER.DBO.usp_SpServerDiagnostics') END GO Sp2 USE [DBAdata] GO /****** Object: StoredProcedure [dbo].[usp_SpServerDiagnostics] Script Date: 15-04-2017 14:29:31 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO /* CREATE TABLE [dbo].[SpServerDiagnostics]( [create_time] [datetime] NULL,…

  • AutoMon

    AlwaysON availability group status alert notification Automon DBA SPs – AM12

    This script will check the always ON group and database status and notify an alert when the AG or database is not online and disconnected.   Table: use DBAdata go CREATE TABLE [dbo].[tbl_alwayson_monitoring]( [replica_server_name] [nvarchar](256) NOT NULL, [Group_name] [nvarchar](256) NOT NULL, [role_desc] [nvarchar](60) NULL, [operational_state_desc] [nvarchar](60) NULL, [recovery_health_desc] [nvarchar](60) NULL, [synchronization_health_desc] [nvarchar](60) NULL, Upload_date datetime ) use DBAdata_archive go CREATE TABLE [dbo].[tbl_alwayson_monitoring]( [replica_server_name] [nvarchar](256) NOT NULL, [Group_name] [nvarchar](256) NOT NULL, [role_desc] [nvarchar](60) NULL, [operational_state_desc] [nvarchar](60) NULL, [recovery_health_desc] [nvarchar](60) NULL, [synchronization_health_desc] [nvarchar](60) NULL, Upload_date datetime ) SP: /* --drop table tbl_alwayson_monitoring select * from tbl_alwayson_monitoring use DBAdata go CREATE TABLE [dbo].[tbl_alwayson_monitoring]( [replica_server_name] [nvarchar](256) NOT NULL, [Group_name] [nvarchar](256) NOT NULL, [role_desc] [nvarchar](60)…