SELECT
@@SERVERNAME as Server_Name,
DB_NAME(database_id) as Database_Name,
mirroring_state_desc,
mirroring_role_desc,
mirroring_safety_level_desc
FROM
sys.database_mirroring
WHERE
mirroring_role IS NOT NULL
Friday, 3 September 2021
Check Mirroring Status in SQL Server 2012
We can check mirroring status of the SQL Server 2012 using below command.
Getting free space information in SQL Server VM
We can get freespace information in a SQL Server VM using below TSQL command.
SELECT DISTINCT
CONVERT(CHAR(100), SERVERPROPERTY('Servername')) AS Server,
volume_mount_point [Disk],
file_system_type [File System],
logical_volume_name as [Logical Drive Name],
CONVERT(DECIMAL(18,2),total_bytes/1073741824.0) AS [Total Size in GB], ---1GB = 1073741824 bytes
CONVERT(DECIMAL(18,2),available_bytes/1073741824.0) AS [Available Size in GB],
CAST(CAST(available_bytes AS FLOAT)/ CAST(total_bytes AS FLOAT) AS DECIMAL(18,2)) * 100 AS [Space Free %]
FROM sys.master_files
CROSS APPLY sys.dm_os_volume_stats(database_id, file_id)
Subscribe to:
Posts (Atom)
How to Handle SSIS Database movement from one environment to another
Below are the steps to follow the movement of SSISDB from one environment to another: -- opening the existing Database master key in S...
-
We are using Azure Data Factory to load data from Azure storage blobs to SQL Server on-premises. During data loading, we faced SQL Error: ...
-
Hello World, Through this blog, I am going to ruminate over lots of technical stuff around databases. Hoping to provide quality conten...
-
Below are the steps to follow the movement of SSISDB from one environment to another: -- opening the existing Database master key in S...