• DBA

    Database suspect mode SQL server

    Database suspect mode One of my database went into suspect mode, it is not a critical one and small sized database. There was no backup 🙂 How to recovery the suspect database?   Paul Randal’s post https://www.sqlskills.com/blogs/paul/creating-detaching-re-attaching-and-fixing-a-suspect-database/ If you don’t have any backups, then the only way to get into the database is to use EMERGENCY mode. This lets you into the database but you need to be aware that recovery has not completed so the contents of the database are transactionally (and possibly structurally) inconsistent. I’m going to choose to repair the database using EMERGENCY-mode repair. See CHECKDB From Every Angle: EMERGENCY mode repair – the very, very last…

  • AlwaysON

    Always on group missing disappeared SQL server database automatically

    I just had an issue, after a CAU automatic patch, the AG always On group disappeared on secondary node, it was missing. A quick fix — Restart the cluster service. You can try to add the group back by T-SQL, you can try to add a dummy database and you can suspend one DB and resume. It just a test, this might work.   Error log: A connection timeout has occurred on a previously established connection to availability replica ‘Primary Server’ with id [F58F54A2-F919-4BCF-9DB7-CBD2B10981BF]. Either a networking or a firewall issue exists or the availability replica has transitioned to the resolving role. Always On Availability Groups connection with primary database…

  • AutoMon

    Automon linked server working status report alert notification Automon DBA SPs – AM25

    This script will check the Automon linked server status and notify an alert, when it is not running.   SP: /* use [DBAdata] drop table tbl_Linked_Server_Status go CREATE TABLE [dbo].[tbl_Linked_Server_Status]( [servername] varchar(200), error_no bigint, errors varchar(2000), Date datetime ) */ -- select * from tbl_Linked_Server_Status use [DBAdata] go -- Exec [DBAdata].[dbo].[Usp_Linked_server_Status_Check] --DROP PROC [Usp_Linked_server_Status_Check] alter PROCEDURE [dbo].[Usp_Linked_server_Status_Check] /* Summary: Check the SQL agent stats Contact: Muthukkumaran Kaliyamoorhty SQL DBA Description: Check the SQL agent stats ChangeLog: Date Coder Description 2013-jan-21 Muthukkumaran Kaliyamoorhty Updated the 2012 functionality */ --WITH ENCRYPTION AS BEGIN SET nocount ON -- select * from dbadata.dbo.tbl_Linked_Server_Status Truncate table dbadata.dbo.tbl_Linked_Server_Status DECLARE @server_name SYSNAME DECLARE @DESC SYSNAME --DECLARE @sql…

  • AutoMon

    Agent SQL service status report alert notification Automon DBA SPs – AM24

    This script will check the SQL server agent service status and notify an alert, when it is not running.   SP: /* use [DBAdata] drop table tbl_agent_Status go CREATE TABLE [dbo].[tbl_agent_Status]( [servername] varchar(200) not null primary key, instance_name varchar(200), Edition varchar (50), Status varchar (50), Date datetime, ) */ -- select * from tbl_agent_Status use [DBAdata] go -- Exec [DBAdata].[dbo].[Usp_Agent_Status] --DROP PROC [Usp_Agent_Status] alter PROCEDURE [dbo].[Usp_Agent_Status] /* Summary: Check the SQL agent stats Contact: Muthukkumaran Kaliyamoorhty SQL DBA Description: Check the SQL agent stats ChangeLog: Date Coder Description 2013-jan-21 Muthukkumaran Kaliyamoorhty Updated the 2012 functionality */ --WITH ENCRYPTION AS BEGIN SET nocount ON -- select * from dbadata.dbo.tbl_agent_Status Truncate table…