Posts

Showing posts from February, 2021

Understanding Logging and Recovery in SQL Server

The below information provided by Paul S Randal for understanding the Logging and Recovery   Understanding Logging and Recovery

How to run Diagnostic tool provided by Microsoft.

Image
  1)        From a workstation that has internet, download TSS tool from this link, this is a set of scripts that will gather the System and SQL logs that I need  http://aka.ms/getTSS 2)        Move the file to the server having the issue, in this case, you will need to copy the file into all the nodes involved. 3)        Open CMD.EXE as Administrator inside tss_tools folder. 4)        Run TSS SDP:SQLBase 5)        The collection will start: 6)   7)        When it finishes, you will see a folder called MS_DATA in C drive. Inside that folder you should see a .zip file, upload that file to the following link Kindly run the command below to collect the Cluster Logs:                              PowerShell: Get-ClusterLog -UseLocalTime -Destination c:\temp\ 8)        Kindly upload all the logs to link( this will provide by link)

User object level permissions at database in Azure SQL Database.

Select the database name from dropdown as USE command does not work in Azure SQL Databse. SELECT DISTINCT pr.principal_id, pr.name AS [UserName], pr.type_desc AS [User_or_Role], pr.authentication_type_desc AS [Auth_Type], pe.state_desc, pe.permission_name, pe.class_desc, o.[name] AS 'Object' FROM sys.database_principals AS pr JOIN sys.database_permissions AS pe ON pe.grantee_principal_id = pr.principal_id LEFT JOIN sys.objects AS o on (o.object_id = pe.major_id) Which user belong to which database role go SELECT ServerName =@@ servername,dbname = db_name(),DP1.name AS DatabaseRoleName, isnull (DP2.name, 'No members' ) AS DatabaseUserName FROM sys.database_role_members AS DRM RIGHT OUTER JOIN sys.database_principals AS DP1 ON DRM.role_principal_id = DP1.principal_id LEFT OUTER JOIN sys.database_principals AS DP2 ON DRM.member_principal_id = DP2.principal_id WHERE DP1. type = 'R' ORDER