Category: Administration
-
Queries to see rapidly what your MySql is doing NOW
Those queries are useful to admin MySQL instances using mysql client. 1) Check active processes/connections running mysql> show processlist; the previous statement doesn’t show all queries text running. To see the complete statements running use: mysql> show processlist; –or– mysql> show full processlist G; the running queries statements could bee quite long. Use the “G”…
-
SQL Jobs Monitoring: check last run datetime and duration
A simple query to check rapidly your job’s status and duration. Useful for fast monitoring on many instances. No more thing s to say: this is the code based on msdb..sysjobs and msdb..sysjobhistory. It’s easy if necessary filtering a single job id or jobs durations too long. select job_id, job_name, run_datetime, SUBSTRING(run_duration, 1, 2) +…
-
How to make your databases smaller and faster: find unused indexes
It’s a boring job but sometimes a good DBA has to do it. Applications change and you have to understand what become unuseful in your databases: we are talking about unused indexes. In any SQL server database indexes take up a lot of space and have to be updated every time an application runs an…
-
Queries to see rapidly what your SQL Server is doing NOW
1) Blocked And Blocking queries. If this query returns no rows you have no blocked queries in this moment. Run it more then once to see any few-seconds blocking queries. NOTE: This exclude ONLY problems with long-locking running queries. Cumulative short-term locking contentions need other kinds of debug (see point 2) SELECT ‘BLOCKING STATUS’ as…