Posts

SQL Jobs Report

Hilighter On The Page SQL Jobs Report Code Below. SELECT DISTINCT [sJOB].[name] AS [JobName] , [sDBP].[name] AS [JobOwner] , CASE [sJOB].[enabled] WHEN 1 THEN 'Yes' WHEN 0 THEN 'No' END AS [IsEnabled] , CASE [sJHIS].run_status WHEN 0 THEN 'Failed' WHEN 1 THEN 'Succeeded' WHEN 2 THEN 'Retry' WHEN 3 THEN 'Cancelled' WHEN 4 THEN 'In Progress' END AS [LastRunOutcome] ,COALESCE(SUBSTRING(CAST([sJHIS].run_date AS CHAR(8)), 1, 4) + '/' + SUBSTRING(CAST([sJHIS].run_date AS CHAR(8)), 5, 2) + '/' + SUBSTRING(CAST([sJHIS].run_date AS CHAR(8)), 7, 2), '') AS [LastRun] ,COALESCE(SUBSTRING(CAST([sJOBSCH].next_run_date AS CHAR(8)), 1, 4) + '/' + SUBSTRI...

Check last 100 database backups

Check last 100 database backups Check last 100 database backups By Himalaya Dua SELECT TOP 100 s.database_name, m.physical_device_name, CAST(CAST(s.backup_size / 1000000 AS INT) AS VARCHAR(14)) + ' ' + 'MB' AS bkSize, CAST(DATEDIFF(second, s.backup_start_date, s.backup_finish_date) AS VARCHAR(4)) + ' ' + 'Seconds' TimeTaken, s.backup_start_date, CAST(s.first_lsn AS VARCHAR(50)) AS first_lsn, CAST(s.last_lsn AS VARCHAR(50)) AS last_lsn, CASE s.[type] WHEN 'D' THEN 'Full' WHEN 'I' THEN 'Differential' WHEN 'L' THEN 'Transaction Log' END AS BackupType, s.server_name, s.recovery_model FROM msdb.dbo.backupset s INNER JOIN msdb.dbo.backupmediafamily m ON s.media_set_id = m.media_set_id --WHERE s.database_name = DB_NAME() -- Remove this line for all the database ORDER BY backup_start_date DESC, backup_finish_date GO

TLS/SSL Settings

Arduino TLS/SSL Settings Applies To: Windows Vista, Windows Server 2008, Windows 7, Windows 8.1, Windows Server 2008 R2, Windows Server 2012 R2, Windows Server 2012, Windows 8 This reference topic for the IT professional contains registry setting, Group Policy, and network port information for the Windows implementation of the Transport Layer Security (TLS) protocol and the Secure Sockets Layer (SSL) protocol through the Schannel Security Support Provider (SSP). This topic is divided into the following sections: Schannel SSP registry entries Group Policy settings Schannel SSP registry entries The following registry subkeys and entries can help you administer and troubleshoot the Schannel SSP, specifically the TLS and SSL protocols. CertificateMappingMethods Ciphers CipherSuites ClientCacheTime FIPSAlgorithmPolicy Hashes IssuerCacheSize IssuerCacheTime KeyExchangeAlgorithm MaximumCacheSize PCT 1.0 SendTrustedIssuerList ServerCa...

Change owner of all SQL jobs to SA

Change owner of all SQL jobs to SA Change owner of all SQL jobs to SA By Himalaya Dua DECLARE @name_holder VARCHAR(1000) DECLARE My_Cursor CURSOR FOR SELECT [name] FROM msdb..sysjobs OPEN My_Cursor FETCH NEXT FROM My_Cursor INTO @name_holder WHILE (@@FETCH_STATUS -1) BEGIN exec msdb..sp_update_job @job_name = @name_holder, @owner_login_name = 'sa' FETCH NEXT FROM My_Cursor INTO @name_holder END CLOSE My_Cursor DEALLOCATE My_Cursor

Cleanly Uninstalling Stubborn SQL Server Components

Image
Problem There are scenarios where SQL Server is difficult or impossible to uninstall, upgrade, or replace (and these can block you from installing a new version or using a specific named or default instance): An expired Evaluation Edition: Evaluation period has expired. For information on how to upgrade your evaluation software please go to http://www.microsoft.com/sql/howtobuy An expired Management Studio: Your Microsoft SQL Server Management Studio evaluation period has expired. You can get a key to extend your trial by registering this copy of Microsoft Management Studio online. You may also purchase a key to activate the product. Unsupported operating system (after an OS upgrade): The operating system on this computer does not meet the minimum requirements for SQL Server xxxx. Missing MSI files, e.g.: Slp: Target package: "C:\...\sql_engine_core_inst.msi" Slp: InstallPackage: MsiInstallProduct returned the result code 2. ...

Subnetting

Image
Subnetting is a process of dividing large network into the smaller networks based on layer 3 IP address. IP-> 32bi t decimal number.  written as four numbers between 1 and 255. divided into 5 classes .  0 [Zero] is reserved and represents all IP addresses. 127 is a reserved address and is used for testing, like a loop back on an interface. 255 is a reserved address and is used for broadcasting purposes.  IP address has following parts- First 16 bits : NETWORK ID Next 8 bits : SUBNET ID Next 8 bits : HOST ID Subnet mask Subnet mask is a 32 bits long address used to distinguish between network address and host address in IP address. Subnet mask has only one purpose, to identify which part of an IP address is network address and which part is host address. Subnetting is a process of breaking large network in small networks known as subnets. Subnetting happens when we extend default boundary of subnet mask. Basically we borrow host bits...

Configure alerts for CPU utilization higher than 80% for more than 5mins

SET NOCOUNT ON DECLARE @TimeNow bigint SELECT @TimeNow = cpu_ticks / convert(float, ms_ticks) from sys.dm_os_sys_info -- Collect Data from DMV Select record_id, dateadd(ms, -1 * (@TimeNow - [timestamp]), GetDate())EventTime, SQLSvcUtilization, SystemIdle, (100 - SystemIdle - SQLSvcUtilization) AS OtherOSProcessUtilization into #tempCPURecords from ( select record.value('(./Record/@id)[1]', 'int')record_id, record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]','int')SystemIdle, record.value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]','int')SQLSvcUtilization, timestamp from ( select timestamp, convert(xml, record)record from sys.dm_os_ring_buffers where ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR' and record like '%<SystemHealth>%')x )y  order by record_id desc To send detailed sql server session reports consuming high cpu  For a dedicated SQL Serve...