Latest Posts
📅 2021-10-05
✍️ Bart Schelstraete
You can monitor TEMPDB usage by using the following SQL statement. SELECT COALESCE(T1.session_id, T2.session_id) [session_id] , T1.request_id , COALESCE(T1.database_id, T2.database_id) [database_id],…
Read more →
📅 2021-09-29
✍️ Bart Schelstraete
The code below can be used to query the linked servers & the user assigned to them. select s.name, p.principal_id, l.remote_name from sys.servers s join sys.linked_logins l on s.server_id =…
Read more →
📅 2021-09-28
✍️ Bart Schelstraete
This guide, coming from Google, explains how to use a dynamic IPsec VPN tunnel with strongSwan on Linux. Step 1 : Configure BIRD /etc/bird/bird.conf # Config example for bird 1.6 #debug protocols…
Read more →
📅 2021-09-01
✍️ Bart Schelstraete
With this command you can check the number of transactions in the distribution database. SELECT count(*) FROM [distribution].[dbo].[MSrepl_transactions] where entry_time > '2021-08-31…
Read more →
📅 2020-07-17
✍️ Bart Schelstraete
The SQL statement below will kill all sessions from a specific user that were not active in the last hour. Of course, change 'my_user' with your preferred user ID. If you want, you can also uncomment…
Read more →
📅 2020-07-16
✍️ Bart Schelstraete
Automatic seeding for SQL Always On is nice, but in the case of big databases this can take some time. Of course, it can be annoying if something is running and you don't see the status of it. The…
Read more →
📅 2020-03-25
✍️ Bart Schelstraete
On the distribution database, you can execute the statement below to get the sizes of the internal replication-specific tables USE distribution GO SELECT Getdate() AS CaptureTime,…
Read more →
📅 2020-03-25
✍️ Bart Schelstraete
You can use the code below on your distributor in order to check the backlog of the replication. SELECT (CASE WHEN mdh.runstatus = '1' THEN 'Start - '+cast(mdh.runstatus as varchar) WHEN…
Read more →
📅 2020-02-17
✍️ Bart Schelstraete
You can use the T-SQL code to resume/suspend all databases from the Always On group. The code below will resume SQL data movement for all databases: declare @cmd varchar(max) declare @cmd_suspend…
Read more →
📅 2019-08-26
✍️ Bart Schelstraete
In a SQL Always On setup, the SQL agent jobs are not synced between the different nodes. This means you need to manually create them on the other nodes. For read-write jobs, you can only run them on…
Read more →