Skip to content

Instantly share code, notes, and snippets.

Douglas Correa sqlpadwan

Block or report user

Report or block sqlpadwan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View token
e84fdb8f7ea293023754c9ef12a01914ea6cfc06
View Send-S3Files.ps1
function Send-S3Files {
<#
.SYNOPSIS
Send the files from a local path to AWS S3
.DESCRIPTION
The function will copy all files from a specific path to AWS S3
.EXAMPLE
Send-S3Files -BucketName 'backups' -Region 'sa-east-1' -AKey '####' -SKey '####' -LocalSource 'c:\temp' , 'd:\backups'
#>
[CmdletBinding()]
View waits.sql
-- Clear Wait Stats
-- DBCC SQLPERF('sys.dm_os_wait_stats', CLEAR);
-- Isolate top waits for server instance since last restart or statistics clear (Query 32) (Top Waits)
-- New SQL Server 2012-2014 specific version
-- QDS_PERSIST_TASK_MAIN_LOOP_SLEEP is new for SQL Server 2014
-- QDS_CLEANUP_STALE_QUERIES_TASK_MAIN_LOOP_SLEEP is new for SQL Server 2014
-- WAIT_XTP_HOST_WAIT is new for SQL Server 2014
-- WAIT_XTP_OFFLINE_CKPT_NEW_LOG is new for SQL Server 2014
@sqlpadwan
sqlpadwan / buffer_descriptors.sql
Created Mar 11, 2018
DMV to get information about how the buffer pool is.
View buffer_descriptors.sql
SELECT
OBJECT_NAME ([p].[object_id]) AS [ObjectName],
[p].[index_id],
[i].[name],
[i].[type_desc],
[au].[type_desc],
[DirtyPageCount],
[CleanPageCount],
[DirtyPageCount] * 8 / 1024 AS [DirtyPageMB],
[CleanPageCount] * 8 / 1024 AS [CleanPageMB]
@sqlpadwan
sqlpadwan / sp_AllocationMetadata.sql
Created Mar 11, 2018
Paul Randal procedure to see inside storage data
View sp_AllocationMetadata.sql
/*============================================================================
File: sp_AllocationMetadata.sql
Summary: This script cracks the system tables to provide top-level
metadata about a table or index
SQL Server Versions: 2005 onwards
------------------------------------------------------------------------------
Written by Paul S. Randal, SQLskills.com
@sqlpadwan
sqlpadwan / job_history.sql
Last active Mar 11, 2018
Getting the last 5 days job history
View job_history.sql
SELECT
name,
steps.step_name,
command,
steps.server,
database_name,
hist.run_date,
hist.run_time,
hist.run_duration,
hist.run_status,
@sqlpadwan
sqlpadwan / alerts.sql
Last active Apr 4, 2018
DMVs most used
View alerts.sql
-- Get SQL Server Agent Alert Information (Query 5) (SQL Server Agent Alerts)
SELECT name
, event_source
, message_id
, severity
, [enabled]
, has_notification
, delay_between_responses
, occurrence_count
You can’t perform that action at this time.