• AlwaysON,  DBA

    Multi subnet sql alwayon cluster not connecting to sql database when application or alwayon failover

    Multi subnet SQL alwayon cluster not connecting to SQL database when application server restarts or alwayon failover. In multi subnet we will have more than two ips, the active IP will be online and other ips will be offline. https://techcommunity.microsoft.com/t5/SQL-Server-Support/Connection-Timeouts-in-Multi-subnet-Availability-Group/ba-p/318334 This Microsoft link will have more information. I just used this to give a workaround for one of our application. The application has MultiSubnetFailover=True. Open powershell as administrator. Run the following and pass the resource name. Get the resource name, it could be AG group name_Listener name – Get-ClusterResource Check the ‘RegisterAllProvidersIP’ value, if it is 1 change to 0 Get-ClusterResource “Cluster Resource Name” | Get-ClusterParameter   Change the ‘RegisterAllProvidersIP’…

  • DBA

    upgrade for database master failed because upgrade step  sqlagent100_msdb_upgrade.sql encountered error 200, state 7, severity 25.

    SQL upgrade from SQL Server 2008 R2 SP3 32 bit to SQL Server 2012 SQL upgrade from 2008 R2 to 2012 Script level upgrade for database ‘master’ failed because upgrade step ‘sqlagent100_msdb_upgrade.sql’ encountered error 200, state 7, severity 25. This is a serious error condition which  might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the ‘master’ database,  it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective  actions and re-start the database so that the script upgrade steps run to completion.   2019-07-30 17:26:10.38 spid8s      Error:…

  • AutoMon

    Data file drive full low space alert notification Automon DBA SPs – AM06

    This script will check the Data file drive low space and notify an alert based on the threshold.   Table: use [DBAdata] drop table tbl_get_datafiles_size --select * from tbl_get_datafiles_size CREATE TABLE [dbo].[tbl_get_datafiles_size]( [servername] [sysname] NULL, [dbname] [sysname] NOT NULL, [filename] [sysname] NOT NULL, [data_size] [int] NULL, [freespace] [varchar](50) NULL, [Drive_letter] [sysname] NULL, ) use [DBAdata_Archive] drop table tbl_get_datafiles_size CREATE TABLE [dbo].[tbl_get_datafiles_size]( [servername] [sysname] NULL, [dbname] [sysname] NOT NULL, [filename] [sysname] NOT NULL, [data_size] [int] NULL, [freespace] [varchar](50) NULL, [Drive_letter] [sysname] NULL, [Upload_date] datetime )   SP: /* use [DBAdata] drop table tbl_get_datafiles_size --select * from tbl_get_datafiles_size CREATE TABLE [dbo].[tbl_get_datafiles_size]( [servername] [sysname] NULL, [dbname] [sysname] NOT NULL, [filename] [sysname] NOT NULL,…

  • AutoMon

    Transaction Log file drive full low space alert notification Automon DBA SPs – AM05

    This script will check the Transaction Log file drive low space and notify an alert based on the threshold. Table: use [DBAdata] go drop table tbl_get_logfiles_size CREATE TABLE [dbo].[tbl_get_logfiles_size]( [servername] [sysname] NULL, [dbname] [sysname] NOT NULL, [filename] [sysname] NOT NULL, [recovery_model] [sysname] NOT NULL, [log_size] [int] NULL, [log_reuse_wait_desc] [sysname] NOT NULL, [freespace] [varchar](50) NULL, [Drive_letter] [sysname] NULL ) use [DBAdata_Archive] drop table tbl_get_logfiles_size go CREATE TABLE [dbo].[tbl_get_logfiles_size]( [servername] [sysname] NULL, [dbname] [sysname] NOT NULL, [filename] [sysname] NOT NULL, [recovery_model] [sysname] NOT NULL, [log_size] [int] NULL, [log_reuse_wait_desc] [sysname] NOT NULL, [freespace] [varchar](50) NULL, [Drive_letter] [sysname] NULL, [Upload_date] [datetime] NULL )   SP: USE [DBAdata] GO /****** Object: StoredProcedure [dbo].[Usp_dba_send_logfiles_size] Script Date:…

  • AutoMon

    Drive space percentage low threshold alert notification Automon DBA SPs – AM04

    This will check all SQL server Drive and notify on the low space percentage based on the threshold. This will enable & disable Ole Automation Procedures, make sure, if you have system to be always enabled Ole Automation Procedures, comment the script based on the requirements. WARNING: It needs Ole Automation Procedures, enable and disable (OR) permanently enable if it already enabled or needed to be enabled for any applications. Table: use DBAdata -- select * from DBAdata.dbo.DBA_All_Server_Space_percentage drop table DBA_All_Server_Space_percentage CREATE TABLE [dbo].[DBA_All_Server_Space_percentage]( [DRIVE] [char](1) NULL, [Lable_NAME] [varchar](50) NULL, [FREE_SPACE_IN_MB] [int] NULL, [used_SPACE_IN_MB] [int] NULL, [Total_SPACE_IN_MB] [int] NULL, [Precentage_free] NUMERIC(9,0) NULL, [SERVER_NAME] [varchar](50) NULL ) /*=====================================*/ -- select *…