Author: Jugal Shah

  • How to find database restore history from MSDB?

    MSDB database is used by SQL Server Agent for scheduling alerts and jobs and by other features such as Service Broker and Database Mail. Again SQL Server is using MSDB for storing the history of backup, restore, log-shipping details and more…

    You can query the MSDB as below to get the details about the SQL Server restore history.

    SELECT TOP 10 *
    FROM restorehistory WITH (nolock)WHERE (destination_database_name = 'Database Name')ORDER BY restore_date DESC
    All Databases
    
    SELECT TOP 10 * FROM restorehistory WITH (nolock)ORDER BY restore_date DESC
    
  • How to improve communication skills & Support Service

    As DBA comes under the support industry, it is extremely important for DBAs to improve communication skills. As we are working production servers and backend, it is extremely important for us to communicate properly. 

    • Please take care of the below points to improve your written communication skill. 
    •  When you reply all, make sure to move names from TO to CC and CC to TO list according to whom you are writing emails
    • Be concise and to the point. Use simple English.
    • Avoid the use of slang words/abbreviations
    • Use proper spelling, grammar & punctuation
    • Do not write in CAPITALS. CAPITALS indicate that we are shouting.
    • Numbers should be expressed as words when the number is less than 10 or is used to start a sentence (example: Ten years ago, my brother and I…). The number 10, or anything greater than 10, should be expressed as a figure (example: My brother has 13 Matchbox cars.)
    • You should just mention the name instead of Hi Jugal.As we are working as support team, use `We` instead of `I`. For example; Jugal instead of Hi Jugal
    • You should change the text in the Subject line during reply emails if it is not relevant.
    • If you are asking for something in the email, you should ask them first and then mention why you need that.
    • Don’t write open ended email to user
    • If you are not sure for any support request, please ask end user for more inputs on particular request.
    • Inform your team regarding any conversation with client through chat or voice call
    • Update your work log every day
    • If you are not sure for any resolution steps, discuss it with your team and then provide it to client
    • When sending large attachments, always “zip” or compress them before sending.
    • Always include subject in your mail body.
    • Don’t send email to any account using your client account
    • Discuss as much as possible with your client
    • Grab as much as possible knowledge of the client process/environment
  • How to improve TempDB performance?

    How to improve TempDB performance? 

    1) TempDB file size and physical placement on harddrive can affect the performance of a system

    2) Set the tempdb recovery model to simple 

    3) Do the capacity planning of the TempDB database and pre allocate the appropriate size to MDF files, which will improve performance for allocating size 

    4) Put TempDB on fast I/O System 

    5) Create as many tempdb data files by considering the number of cpu 

    6) make all the tempdb data file size same

  • Troubleshoot Suspect Database Issue

    Problem

    How to troubleshoot suspect database problem? How to bring it back online? What are the do you need to perform once the database is online?

    Solution

    Step 1: Bring the database online using below script

    USE Master

    GO

     

    — Determine the original database status

    SELECT [Name], DBID, Status

    FROM master.dbo.sysdatabases

    GO

     

    — Enable system changes

    sp_configure ‘allow updates’,1

    GO

    RECONFIGURE WITH OVERRIDE

    GO

     

    — Update the database status

    UPDATE master.dbo.sysdatabases

    SET Status = 24

    WHERE [Name] = ‘SuspectedDatabaseName’

    GO

     

    — Disable system changes

    sp_configure ‘allow updates’,0

    GO

    RECONFIGURE WITH OVERRIDE

    GO

     

    — Determine the final database status

    SELECT [Name], DBID, Status

    FROM master.dbo.sysdatabases

    GO

    Step 2: Check for database corruption. This is very important step please execute it.

    • DBCC CHECKDB – Validate the overall database integrity
    • DBCC CHECKCATALOG – Validate the system catalog integrity
    • DBCC CHECKTABLE – Validate the integrity for a single table

    Step 3: To resolve the corruption issue, please execute below commands

    • Drop and Recreate Index(es)
    • Move the recoverable data from an existing table to a new table
    • Update statistics
    • DBCC UPDATEUSAGE
    • sp_recompile

    Step 4: Repeat Step 2 to validate all the corruption occurred