블로그 이미지
보미아빠

카테고리

보미아빠, 석이 (530)
밥벌이 (16)
싸이클 (1)
일상 (1)
Total
Today
Yesterday

달력

« » 2025.10
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

공지사항

최근에 올라온 글



--2019
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED 
SELECT '01' OrderKey,'OS_MEMORY_TOTAL' MemType, physical_memory_kb PagesKB FROM SYS.DM_OS_SYS_INFO
UNION ALL 
SELECT '02' OrderKey,'SQL_VISIBLE_TARGET_KB' MemType, visible_target_kb PagesKB FROM SYS.DM_OS_SYS_INFO
UNION ALL 
SELECT '03' OrderKey,'SQL_COMMITTED_KB' MemType, committed_kb PagesKB FROM SYS.DM_OS_SYS_INFO
UNION ALL 
SELECT '04' OrderKey,'OS_MEMORY_CLERKS_TOTAL' MemType, SUM(pages_kb) + sum(virtual_memory_committed_kb)+sum(awe_allocated_kb)+sum(shared_memory_committed_kb) PagesKB FROM SYS.DM_OS_MEMORY_CLERKS
UNION ALL 
SELECT * 
FROM 
( 
SELECT TOP 20 '04' OrderKey, type MemType, SUM(pages_kb)  +sum(virtual_memory_committed_kb)+sum(awe_allocated_kb)+sum(shared_memory_committed_kb) PagesKB  FROM SYS.DM_OS_MEMORY_CLERKS
GROUP BY TYPE 
ORDER BY 3 DESC 
) A 
ORDER BY 1,3 DESC


-- lpim check
SELECT a.memory_node_id, node_state_desc, a.locked_page_allocations_kb
FROM sys.dm_os_memory_nodes a
INNER JOIN sys.dm_os_nodes b ON a.memory_node_id = b.memory_node_id


-- old version 
--SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED 

--SELECT '01' OrderKey,'OS_MEMORY_TOTAL' MemType, physical_memory_in_bytes/1024 PagesKB FROM SYS.DM_OS_SYS_INFO
--UNION ALL 
--SELECT '02' OrderKey,'SQL_VISIBLE_TARGET_KB' MemType, bpool_visible * 8 PagesKB FROM SYS.DM_OS_SYS_INFO
--UNION ALL 
--SELECT '03' OrderKey,'SQL_COMMITTED_KB' MemType, bpool_committed * 8 PagesKB FROM SYS.DM_OS_SYS_INFO
--UNION ALL 
--SELECT '04' OrderKey,'OS_MEMORY_CLERKS_TOTAL' MemType, SUM(single_pages_kb) + sum(multi_pages_kb) + sum(virtual_memory_committed_kb)+sum(awe_allocated_kb)+sum(shared_memory_committed_kb) PagesKB FROM SYS.DM_OS_MEMORY_CLERKS
--UNION ALL 
--SELECT * 
--FROM 
--( 
--SELECT TOP 20 '04' OrderKey, type MemType, SUM(single_pages_kb) + sum(multi_pages_kb) +sum(virtual_memory_committed_kb)+sum(awe_allocated_kb)+sum(shared_memory_committed_kb) PagesKB  FROM SYS.DM_OS_MEMORY_CLERKS
--GROUP BY TYPE 
--ORDER BY 3 DESC 
--) A 
--ORDER BY 1,3 DESC
Posted by 보미아빠
, |
$WShell = New-Object -com "Wscript.Shell"
while($true)
{
    $WShell.sendkeys("{SCROLLLOCK}")
    $WShell.sendkeys("{SCROLLLOCK}")
    $date = Get-Date -Format "dddd MM/dd/yyyy HH:mm:ss"
    Write-Host $date + " No sleep with scroll lock"
    Start-Sleep -Seconds 100
}




Add-Type -AssemblyName System.Windows.Forms
Add-Type @"
using System;
using System.Runtime.InteropServices;

public class MouseClicker {
    [DllImport("user32.dll", CharSet=CharSet.Auto, CallingConvention=CallingConvention.StdCall)]
    public static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo);

    public const int MOUSEEVENTF_MIDDLEDOWN = 0x0020;
    public const int MOUSEEVENTF_MIDDLEUP   = 0x0040;
}
"@

$WShell = New-Object -com "Wscript.Shell"

while ($true)
{
    $pos = [System.Windows.Forms.Cursor]::Position

    for ($i = 0; $i -le 200; $i += 5) {
        $newPos = [System.Drawing.Point]::new($pos.X + $i, $pos.Y)
        [System.Windows.Forms.Cursor]::Position = $newPos
        #Start-Sleep -Milliseconds 10
    }

    for ($i = 200; $i -ge 0; $i -= 5) {
        $newPos = [System.Drawing.Point]::new($pos.X + $i, $pos.Y)
        [System.Windows.Forms.Cursor]::Position = $newPos
        #Start-Sleep -Milliseconds 10
    }

    [MouseClicker]::mouse_event([MouseClicker]::MOUSEEVENTF_MIDDLEDOWN, 0, 0, 0, 0)
    Start-Sleep -Milliseconds 100
    [MouseClicker]::mouse_event([MouseClicker]::MOUSEEVENTF_MIDDLEUP, 0, 0, 0, 0)
    
    $WShell.sendkeys("{SCROLLLOCK}")
    $WShell.sendkeys("{SCROLLLOCK}")
    $date = Get-Date -Format "dddd MM/dd/yyyy HH:mm:ss"
    Write-Host $date + " No sleep with scroll lock"

    Start-Sleep -Milliseconds 120000
}

 

Posted by 보미아빠
, |

at time zone

카테고리 없음 / 2023. 6. 23. 18:35
; with cte 	
as	
(	
	select [timestamp] at time zone 'Korea Standard Time' kst, * 
	from t230614
) 	
select cast(duration / 1000. as int) milisec, * 	
from cte	
where kst >= '2023-06-14 00:00:00.0000000 +09:00'	
	and statement like '%text%'
	and name = 'sp_statement_completed'
order by kst 	


; with cte 	
as	
(	
	select [timestamp] at time zone 'Korea Standard Time' kst, * 
	from t230614
) 	
select cast(duration / 1000. as int) milisec, * 	
from cte	
where kst >= '2023-06-14 00:00:00.0000000 +09:00'


; with cte 	
as	
(	
	select [timestamp] at time zone 'Korea Standard Time' kst, * 
	from [im0802]
) 	
, a as 
(select cast(duration / 1000. as int) milisec, * 	
from cte	
where kst >= '2024-08-02 09:00:26.4842673 +09:00'
	and kst <= '2024-08-02 09:00:59.5437674 +09:00'
	and  name in (
        'wait_info'
        ,'wait_info_external'
        )
)
select wait_type, sum(duration) sum_duration 
from a 
group by wait_type 
order by 2 desc 

; with cte 	
as	
(	
	select [timestamp] at time zone 'Korea Standard Time' kst, * 
	from [im0802]
) 	
select cast(duration / 1000. as int) milisec, * 	
from cte	
where kst >= '2024-08-01 08:00:26.4842673 +09:00'
	and kst <= '2024-08-02 11:00:59.5437674 +09:00'
	and  name in (
        'rpc_completed'
        ,'sql_batch_completed'
        ,'sp_statement_completed'
        ,'sql_statement_completed'
        )
	and statement like '%aaa%'
order by 2

 

Posted by 보미아빠
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함