Linux: “du” values don’t match “df” values.

bschelst/ February 16, 2019/ Linux/ 0 comments

If you do a df, and you compare those values with ‘du’, it is possible that those values don’t match. There are multiple reasons why this can happen, and one of those reasons if that files where deleted, but that the files are still in use by an application.In that case, it is possible that you need to stop/restart the

Read More

T-SQL: List transactions & log used

bschelst/ February 11, 2019/ SQL-Server/ 0 comments

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. You can also use the below to find more info regarding a transaction

T-SQL: Check progress of backup/restore

bschelst/ February 11, 2019/ SQL-Server/ 0 comments

Backups/restores can take a lot of time, but when it’s running, you want so see the progress.By executing the handy T-SQL code below, you can see the progress of the backups/restores on your system.

T-SQL: Remap SQL users

bschelst/ February 11, 2019/ SQL-Server/ 0 comments

If you copy (backup/restore) a database from system A to system B, it is possible that the SQL users won’t be able login and this because the GUID/SID of the users on system A doesn’t match the GUID/SID of system B. It is using the EXEC sp_change_users_login ‘Auto_Fix’, which inks a user entry in the sys.database_principals system catalog view in

Read More

T-SQL: Flush memory cache for testing purposes

bschelst/ February 11, 2019/ SQL-Server/ 0 comments

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 system / proc / session cache. See the SQL below:

T-SQL: Creation date/time of tables

bschelst/ February 11, 2019/ SQL-Server/ 0 comments

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 in order to list all tables, and the creation date of those tables.