IT Toolbox
Menu
HomeSQL / Databases Center
Guide

SQL / Databases Center

SQL Server, MySQL and PostgreSQL diagnostics for connections, authentication, blocking, performance, backups, logs and storage.

TopicIT resources → About 2 min read

Separate database service, connectivity, authentication, workload and storage issues before changing SQL Server, MySQL, MariaDB or PostgreSQL.

  • For connection failures, record the engine, instance, endpoint, authentication method and complete error.
  • For blocking or high load, identify the session, transaction and execution context before interrupting work.
  • For backup or capacity incidents, examine the backup chain, logs, data files and underlying storage.

Command examples

Adapt placeholders, permissions and target systems before using an example. These examples are documentation; no command runs from this page.

SELECT * FROM sys.dm_exec_requests WHERE blocking_session_id <> 0;
SELECT name,state_desc,recovery_model_desc,log_reuse_wait_desc FROM sys.databases;
RESTORE VERIFYONLY FROM DISK='D:\Backup\DB.bak';
SELECT pid,usename,state,query FROM pg_stat_activity;
SELECT pg_size_pretty(pg_database_size(current_database()));

Check the database endpoint

Use the actual listener or instance port. TCP 1433, 3306 and 5432 are common defaults for SQL Server, MySQL and PostgreSQL, but instance configuration can differ.

Collect SQL Server evidence

Record service and database state, active requests, blocking and free space. Querying a diagnostic view may require additional monitoring permissions.

Verify and test backups

RESTORE VERIFYONLY checks backup completeness and readability; it does not restore the database or fully verify the data structure. Complete a restore test in an appropriate environment.

Preserve database files

Do not manually remove MDF, LDF, WAL or binary-log files to create free space. Follow the engine’s supported retention and recovery process.

Understand blocking first

Identify the blocking session, its transaction and the impact of rollback before terminating it.

Assess execution evidence

Review the workload and execution plan before adopting a suggested index. An index can change write cost and storage requirements.

Include storage performance

Correlate database waits and response time with storage latency and I/O activity.

Use appropriate privileges

An access error should be diagnosed against the required permission and scope rather than resolved by granting unrestricted administrative access.

Support the development of BAOI Hosting, domains and new IT resources.
❤️ Support BAOI

My favorites