Skip to content

Instantly share code, notes, and snippets.

View Alex-Yates's full-sized avatar

Alex Yates (Personal) Alex-Yates

View GitHub Profile
-- Attribution to Ivan Donev
-- Details:
-- http://www.mssqlinsider.com/2013/09/check-databases-part-replication/
-- Requires SA
IF IS_SRVROLEMEMBER ('sysadmin') = 1
print 'Current user''s login is a member of the sysadmin role'
ELSE IF IS_SRVROLEMEMBER ('sysadmin') = 0
THROW 50001, 'ERROR: Current user''s login is NOT a member of the sysadmin role.', 1
ELSE IF IS_SRVROLEMEMBER ('sysadmin') IS NULL
DevOps Flow Series, part 1 of 4
Title:
DevOps 101 for Data Folks
Abstract:
DevOps has fundamentally changed the way we manage IT. Those practicing DevOps well aren't just outpacing their competitors, they are annihilating them.
DevOps brings a whole host of new practices, tools and buzzwords. It has made some roles and tasks redundant, while new opportunities have been created.
DevOps Flow Series, part 3 of 4
Title:
Solving the dev database problem with GitHub, Docker and dbaclone
Abstract:
DevOps promotes self-service access to usable, production-like dev/test
environments – but so many data folks are encumbered with shared
development databases which are often inconsistent with production. It’s
difficult to isolate the development of different features, so they are
<#
Queries the Octopus Deploy API to determine the state of a specific RunbookRun.
Possible states include:
- Queued
- Executing
- Success
- Failed
- TimedOut
- Cancelling
Title:
tSQLt explained, by the maintainer
Abstract:
Back when you released quarterly, you might have got away with week-long manual testing cycles. However, DevOps has highlighted the risk associated with long lead times and large, complex deployments. Most of us understand the need to move much faster.
Unfortunately, continuous delivery, without continuous testing, is simply a more efficient way to deliver new bugs to production. It's all very well being able to deploy 10 times a day, but if you can't test 10 times a day, you are entering a Russian Roulette tournament without an exit strategy. It's no surprise that "DevOps Transformations" that skip the testing tend to fail.
We'll start with a bit of theory. What types of tests should you be writing? How many tests should you be writing? When should you be running the tests? How should you approach legacy databases? How is the role of the tester evolving?
<#
Required variables:
$DLM_PackageStep
$DLM_ServerInstance
$DLM_Database
Optional variables (include for SQL Auth, exclude for WinAuth):
$DLM_Username
$DLM_Password
#>
<#
Required variables:
$DLM_PackageStep
$DLM_DeployStep
$DLM_ServerInstance
$DLM_Database
Optional variables (include for SQL Auth, exclude for WinAuth):
$DLM_Username
$DLM_Password
# These are the states that an EC2 VM can be in
# (I'm doing it this way to ensure I've considered all possible states. If it ever becomes possible for an instance
# to be in a different state, and one of my instance enters that state, this script should throw and error)
[array]$expectedStates = "pending","running","shutting-down","terminated","stopping","stopped"
# Asking EC2 what VMs I have running
$states = @()
Get-EC2Instance | ForEach-Object {
$_.RunningInstance | ForEach-Object {
$instanceId = (Get-EC2Instance $_.InstanceId).Instances.InstanceId
"No mater what they tell you, it's always a people problem."
Gerald Weinberg
DevOps, DevSecOps, BizDevOps, DataOps, KittenOps...
It's over a decade since Andrew Clay Shafer first described the "wall of confusion" between development and operations. By now many of us have been hacking away at it for years, and in some places we've made progress. However, at the same time the wall has been sprouting new limbs and reinforcing itself, further dividing our organisations into warring tribes and, ultimately, conquering them.
In this session we'll start by staging a debate between an ex- "wild west" "DevOps-ist" and an ex-grumpy DBA as a case study to explore the reasons why most of us, unintentionally, are predisposed to reinforce the walls rather than tear them down.
This is a session about trust, vulnerability, unconscious biasses and politics. We'll also touch on ITIL, Agile and risk management, but we are here first and foremost to talk about people, collaboration and teamwork.
Function Get-Script{
param (
[Parameter(Mandatory=$true)][string]$script, # the name of the file (needs to be in repo root, otherwise tweak this function)
[string]$owner = "my-username", # repo owner (github username)
[string]$repo = "my-repo", # name of repo
[string]$branch = "master",
[string]$outputDir = ""
)
# the raw page for the script