How do I find the .NET version
There is an easier way to get the exact version .NET version installed on your machine from a cmd prompt. Just follow the following instructions;
1. Open the command prompt (i.e Windows + R → type "cmd").
2. Type the following command, all on one line:
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP"
(This will list all the .NET versions.)
3. If you want to check the latest .NET 4 version.
4. Type following instruction, on a single line:
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\full" /v version
or type the following in the command line: dir /b /ad /o-n %systemroot%\Microsoft.NET\Framework\v?.*
patching SQL Server with Availability Group and Secondary Replica
Make sure you have full backups of your databases.
On the primary replica node, change the failover mode to manual
Refresh the databases and check if MSSQL reports any errors
Apply fix - CU0x service pack Perform an update for all databases until all fixes are uploaded.
After uploading patches and restarting MSSQL, check if the cluster is in good condition. P
erform an update for the Primary server.
After uploading all patches, check if the cluster is in good condition.
If there are no errors, change the switching mode from manual to automatic.
recreate agents jobs in MS SQL
After the server failure, I lost access to the database copies and to the configured agents. How to recreate agents jobs.
Within the MSDB database, jobs are stored in a tables called dbo.sysjobs. This joins to a table called dbo.sysjobsteps that stores details of the individule steps. The schedules are stored in dbo.sysjobschedules and the History is stored in dbo.sysjobhistory.
MSDB will also contain other instance level objects such as alerts, operators and SSIS packages.
A script that shows us where and how SQL Server stores SQL jobs.
-- List of all the SQL Jobs on a server with steps
SELECT
job.job_id,
notify_level_email,
name,
enabled,
description,
step_name,
command,
server,
database_name
FROM
msdb.dbo.sysjobs job
INNER JOIN
msdb.dbo.sysjobsteps steps
ON
job.job_id = steps.job_id
WHERE 1=1
--AND job.enabled = 1 -- uncomment this to see enabled SQL Jobs
and next example
also gets the category name and filters out the report server jobs.
SELECT sysjobs.name 'Job Name',
syscategories.name 'Category',
CASE [description]
WHEN 'No Description available.' THEN ''
ELSE [description]
END AS 'Description'
FROM msdb.dbo.sysjobs
INNER JOIN msdb.dbo.syscategories ON msdb.dbo.sysjobs.category_id = msdb.dbo.syscategories.category_id
WHERE syscategories.name <> 'Report Server'
ORDER BY sysjobs.name
Jobs are stored in the msdb database. You will have to restore this.
recreate agents jobs in MS SQL
After the server failure, I lost access to the database copies and to the configured agents. How to recreate agents jobs.
Within the MSDB database, jobs are stored in a tables called dbo.sysjobs. This joins to a table called dbo.sysjobsteps that stores details of the individule steps. The schedules are stored in dbo.sysjobschedules and the History is stored in dbo.sysjobhistory.
MSDB will also contain other instance level objects such as alerts, operators and SSIS packages.
A script that shows us where and how SQL Server stores SQL jobs.
-- List of all the SQL Jobs on a server with steps
SELECT
job.job_id,
notify_level_email,
name,
enabled,
description,
step_name,
command,
server,
database_name
FROM
msdb.dbo.sysjobs job
INNER JOIN
msdb.dbo.sysjobsteps steps
ON
job.job_id = steps.job_id
WHERE 1=1
--AND job.enabled = 1 -- uncomment this to see enabled SQL Jobs
and next example
also gets the category name and filters out the report server jobs.
SELECT sysjobs.name 'Job Name',
syscategories.name 'Category',
CASE [description]
WHEN 'No Description available.' THEN ''
ELSE [description]
END AS 'Description'
FROM msdb.dbo.sysjobs
INNER JOIN msdb.dbo.syscategories ON msdb.dbo.sysjobs.category_id = msdb.dbo.syscategories.category_id
WHERE syscategories.name <> 'Report Server'
ORDER BY sysjobs.name