Watch the companion webinar at: http://forms.embarcadero.com/5StepsToBeingATopDBA
Being a DBA is a tough job. There are screaming users, requests and leering managers to contend with on a daily basis. Sometimes it can feel like you are balancing plates spinning on needles in attempts to get stuff done and keep users going.
Sound familiar? How are you handling those ever-present challenges of troubleshooting and managing databases across your environments? Join Joseph D’Antoni, SQL expert and evangelist and Scott Walz, Director of Embarcadero Software Consultants as they provide techniques that help you reduce the amount of manual effort in your job and keep you three steps ahead of your users.
In this presentation, you will learn:
+ Fully automating SQL Server installations
+ Automating performance monitoring
+ Syncing jobs and logins between Availability Group members
+ Patching SQL Servers automatically
+ Other techniques for process automation
This session will benefit junior and senior DBAs, as well as anyone who wants to automate themselves into a promotion.
2. EMBARCADERO TECHNOLOGIES
Joey D’Antoni
• Joey has over 15 years of experience with a wide variety of data platforms, in both Fortune 50
companies as well as smaller organizations
• He is a frequent speaker on database administration, big data, and career management
• He is the co-president of the Philadelphia SQL Server User’s Group
• MSCE, Business Intelligence
• He wants you to make sure you can restore your data
Joeydantoni.com
10. EMBARCADERO TECHNOLOGIES
DOS
DOS is still alive
Mainly because I
haven’t ported all
of my code to
PowerShell
Can still be
useful—especially
if on older
Windows releases
10
11. EMBARCADERO TECHNOLOGIES
Dynamic SQL and Concatantion
11
--Create the files
WHILE @number_of_files > 0
BEGIN
if @number_of_files = 1 -- main tempdb file, move and re-size
BEGIN
SELECT @sql_statement = 'ALTER DATABASE tempdb MODIFY FILE (NAME = tempdev, SIZE = '+
convert(nvarchar(25), @individ_file_size) + ', filename =
'+nCHAR(39)+@data_file_path+'tempdb.mdf'+nCHAR(39)+',MAXSIZE = '+ convert(nvarchar(25),
@individ_file_size) + ', FILEGROWTH = 100MB);';
END
ELSE -- numbered tempdb file, add and re-size
BEGIN
SELECT @sql_statement = 'ALTER DATABASE tempdb ADD FILE (NAME = tempdev0' + convert(nvarchar(25),
@number_of_files)+',filename = '+nCHAR(39)+@data_file_path+'tempdb0' + convert(nvarchar(25),
@number_of_files)+'.ndf'+nCHAR(39)+', SIZE = '+ convert(varchar(25), @individ_file_size) + ', MAXSIZE =
'+ convert(nvarchar(25), @individ_file_size) + ', FILEGROWTH = 100MB);';
END
EXEC sp_executesql @statement=@Sql_Statement
PRINT @sql_statement
14. EMBARCADERO TECHNOLOGIES
Demo--SQL Server Install and Best Practices
Default SQL Servers installs are a bad
thing
Every time someone leaves cost
threshold for parellelism at 5, a
kitten dies
Let’s fix this..
14
15. EMBARCADERO TECHNOLOGIES
Demo--SQLCMD Dynamic SQL for Backups
This is a simple demo of the combination
of some dynamic SQL and SQLCMD
Just an example—still schedule as an
agent job
Or just use Ola’s script
15
16. EMBARCADERO TECHNOLOGIES
Demo--Patching SQL Server
Will use a combination of
commands and PowerShell
for CU automation
Use PowerShell to verify
patch successful and notify
admin
16
18. EMBARCADERO TECHNOLOGIES
Automation
With these tools the only limits are your imagination
Any repetitive tasks can and should be automated
Take advantage of scripting tools
Test, Test, Test and Test some more
18
19. EMBARCADERO TECHNOLOGIES
Summary
I didn’t say DevOps—but this is kind of what DevOps is like
Automation makes you a better DBA—you can focus on
value added activities like query tuning
Start small (installations) and build your skills to advanced
techniques like patching and code deployments
19
20. EMBARCADERO TECHNOLOGIES
Thank you for attending!
Connect with us
20
Read Joey’s Blog
Community.embarcadero.com
Take our word for
it & try it out!
http://www.embarcadero.co
m/products/DBArtisan
Take our survey
Located in the chat window
https://www.surveymonkey.com/s/TopDBA
Community.embarcadero.com