Showing posts from March, 2019

Things DBA's get asked during a day on Job

Things people ask to DBA's during a day on his\her Job:
Why this query is running slow?Why this query is running slow from app but not from ssms?Why this query is not picking up \using the right indexes?Why this query is using right indexes when running from ssms and not when executed from app?Why this query is running fast as SQL statement but running slow when same query is wrapped as a stored procedure?Why query is timing out and in result application is throwing 50* errors?Do we have proper indexes?Can we create index on this column of that table?How much time will it take to defragment the index?Are index fragmented?Can we rebuild the index now without downtime ?Can we reorganize indexes without downtime ? How much time will it take ?Why server is slow ?(When Backup and Update stats are running)Can you make query use right index but not make use of option(recompile) or any other query hint at the same time?Why people are unable to login ?Why people are not able to change passw…

Script to delete the files older then 2 days from All Available Drives On Servers:\AnyDirectory

Script below can be used to delete the files which are older then 2 days from All Available Drives On Servers:\AnyDirectory.If you want to filter files with some particular extension please add the following handle to the script :/m (searchmask) Searches files according to the specified search mask. The default search mask is *.\*.More information about parameters and variables available can be found here @ECHO off Rem=================================================================================================================== Rem AUTHOR: SHIVAM KUMAR | Rem VERSION: 1.0 Rem DESCRIPTION: Script to delete the files which are older then 2 days from "All_Available_Drives_On_Servers:\AnyDirectory" directory Rem How to use: Select the servers from hpsa and right click and run script,no user input is required. Rem Disclaimer: The script has to be run on proper timings after the backup or what ever patching activity else you might loose d…