This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select * | |
from sys.dm_db_session_space_usage spu | |
join sys.dm_exec_sessions s on s.session_id = spu.session_id | |
join sys.dm_exec_requests r on s.session_id = r.session_id | |
cross apply sys.dm_exec_sql_text(sql_handle) t | |
order by internal_objects_alloc_page_count desc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ; | |
WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/2004/07/showplan'), | |
core AS ( | |
SELECT | |
eqp.query_plan AS [QueryPlan], | |
ecp.plan_handle [PlanHandle], | |
q.[Text] AS [Statement], | |
n.value('(@StatementOptmLevel)[1]', 'VARCHAR(25)') AS OptimizationLevel , | |
ISNULL(CAST(n.value('(@StatementSubTreeCost)[1]', 'VARCHAR(128)') as float),0) AS SubTreeCost , |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Get Top 100 executed SP's ordered by execution count | |
SELECT TOP 100 qt.text AS 'SP Name', qs.execution_count AS 'Execution Count', | |
qs.execution_count/DATEDIFF(Second, qs.creation_time, GetDate()) AS 'Calls/Second', | |
qs.total_worker_time/qs.execution_count AS 'AvgWorkerTime', | |
qs.total_worker_time AS 'TotalWorkerTime', | |
qs.total_elapsed_time/qs.execution_count AS 'AvgElapsedTime', | |
qs.max_logical_reads, qs.max_logical_writes, qs.total_physical_reads, | |
DATEDIFF(Minute, qs.creation_time, GetDate()) AS 'Age in Cache' | |
FROM sys.dm_exec_query_stats AS qs | |
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sp_MSforeachtable 'alter index all on ? reorganize' | |
go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dir /b /ad /o-n %systemroot%\Microsoft.NET\Framework\v?.* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
appcmd.exe list site /xml | appcmd delete site /in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git rm $(git ls-files --deleted) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- find object usage in stored procedures and functions | |
select * from INFORMATION_SCHEMA.ROUTINES e | |
where OBJECT_DEFINITION(OBJECT_ID(e.SPECIFIC_SCHEMA + '.' + e.SPECIFIC_NAME)) LIKE '%ObjectName%'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by Yuri on 04.08.2015. | |
*/ | |
object Utils { | |
def mapClassToSeq(mes: AnyRef) = { | |
mes.getClass.getDeclaredFields.map(f => { | |
f.setAccessible(true) | |
camelToUnderscores(f.getName) -> f.get(mes) | |
}).toSeq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create ~/.ssh/config с указанием хоста: | |
Host my_host.ru | |
ForwardAgent yes | |
ssh-add -K ~/.ssh/id_rsa |
OlderNewer