Latest Posts
📅 2019-05-10
✍️ Bart Schelstraete
Running a DBCC CHECKDB can take a lot of time, and in case of corruption you really want to see the progress. You can use the T-SQL statement below to find the progress. Remember to replace…
Read more →
📅 2019-04-29
✍️ Bart Schelstraete
Step 1: If block corruption was found, first find the corrupted blocks: SQL> select * from V$DATABASE_BLOCK_CORRUPTION; FILE# BLOCK# BLOCKS CORRUPTION_CHANGE# CORRUPTIO CON_ID ---------- ----------…
Read more →
📅 2019-02-16
✍️ Bart Schelstraete
If you do a df , and you compare those values with du , it is possible that the values don't match. There are multiple reasons why this can happen, and one of those reasons is that files were…
Read more →
📅 2019-02-11
✍️ Bart Schelstraete
The code below will list the transactions on the instance, and it will also include the size of the log which is used for that transaction. The output is ordered by log size. Select transaction_id,…
Read more →
📅 2019-02-11
✍️ Bart Schelstraete
You can use the default trace in SQL Server in order to track CREATE/DELETE/ALTER DDL operations. The T-SQL code below will show the CREATE/DELETE/ALTER DDL operations visible in the default trace.…
Read more →
📅 2019-02-11
✍️ Bart Schelstraete
Backups/restores can take a lot of time, but while they are running, you want to see the progress. By executing the handy T-SQL code below, you can see the progress of the backups/restores on your…
Read more →
📅 2019-02-11
✍️ Bart Schelstraete
If you copy (backup/restore) a database from system A to system B, it is possible that the SQL users won't be able to login, and this is because the GUID/SID of the users on system A doesn't match…
Read more →
📅 2019-02-11
✍️ Bart Schelstraete
Not all SQL scripts should be short ;) The T-SQL code below will list the SQL Agent job history. SET NOCOUNT ON --Checking for SQL Server verion IF…
Read more →
📅 2019-02-11
✍️ Bart Schelstraete
SQL Server is of course caching data in order to minimize access to disks. Sometimes you want to clear that memory, for testing purposes for example. You can use DBCC commands in order to clear the…
Read more →
📅 2019-02-11
✍️ Bart Schelstraete
When you are looking for the creation date/time of certain tables, you can easily find that in the sys.tables. You can use the code below to list all tables and the creation date of those tables.…
Read more →