Do More With Less: SQL Central Management Server and Multi-Server Administration
-
Upload
mike-hillwig -
Category
Technology
-
view
758 -
download
1
Transcript of Do More With Less: SQL Central Management Server and Multi-Server Administration
![Page 1: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/1.jpg)
Do More With Less:
Inside SQL Central Management Server and Multi-Server Administration
![Page 2: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/2.jpg)
Mike Hillwig
SQL Server DBA Working with SQL Server since SQL 7 Resume includes Acme Packet Oracle, Shawmut Design and Construction,
Equitable Resources, Weirton Steel
![Page 3: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/3.jpg)
![Page 4: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/4.jpg)
Mike Hillwig
Owned by Two Pugs Avid Cook Lover of Blue Cheese And Bacon Geek at Heart
![Page 5: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/5.jpg)
Obligatory Social Networking Slide
mikehillwig.com sqlserverpedia.com twitter.com/mikehillwig anysocialnetworkingsite/mikehillwig
![Page 6: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/6.jpg)
Housekeeping
Don’t let me talk too fast. Blog post at mikehillwig.com/go/domore Please send feedback to [email protected]
![Page 7: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/7.jpg)
April 18, 2015Microsoft, Cambridge, MA
![Page 8: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/8.jpg)
Beware of the Blogs
There is some amazing advice out there. But…
Anybody can put bad advice on the internet
Trust people you know
Assume I’m an idiot I don’t trust people who say
“ALWAYS” or “NEVER” Test everything in your own test
environment first.
![Page 9: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/9.jpg)
Before I start…
This crowd scares the crap out of me. Seriously. You’re one of the most technical user groups I’ve ever seen.
![Page 11: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/11.jpg)
Slides and Blog Post
mikehillwig.com/go/domore
![Page 12: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/12.jpg)
Tonight’s Topics
Central Management Server SQL Agent Multi Server Administration
![Page 13: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/13.jpg)
Central Management Server
Catalog of Servers Allows you to synchronously query multiple servers
![Page 14: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/14.jpg)
SQL Agent Multi Server
Centralize your SQL Agent Jobs It’s a Master/Target relationship for the SQL Agent
![Page 15: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/15.jpg)
LET’S DIG IN
![Page 16: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/16.jpg)
About My Infrastructure
Using a single VM named SLATE with seven instances You wouldn’t do that. These tools require AD authentication. I’m too lazy to configure a domain controller
![Page 17: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/17.jpg)
Seven Instances
Fred Wilma Barney Betty Pebbles BamBam Bedrock
![Page 18: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/18.jpg)
Central Management Server
It’s a catalog of servers Allows you to break your servers into categories There is nothing fancy about this technology Yet it’s a great time saver The tool you won’t appreciate until you really need it Allows you to query multiple servers synchronously at once…
without PowerShell.
![Page 19: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/19.jpg)
Why would I Use this?
Audits (Getting lists of things on multiple servers) Deployments Security functions
Creating logins Disabling logins
Anything that you need to run on multiple servers
![Page 20: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/20.jpg)
Demo
![Page 21: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/21.jpg)
Important Tables
sysmanagement_shared_server_groups Contains the groups/folders
sysmanagement_shared_registered_servers Contains the servers we’ve registered.
![Page 22: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/22.jpg)
Important Procedures
sp_sysmanagement_add_shared_server_group Adds a new group/folder
sp_sysmanagement_add_shared_registered_server Adds a new server to a group
![Page 23: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/23.jpg)
A Note on Connectivity
The Central Management Server is just the catalog. The machine where you’re running SSMS makes the
connections to each server. If your machine can’t see a server, your connection will fail.
![Page 24: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/24.jpg)
A Note on Security
Unless you specifically configure it to use SQL authentication, AD authentication will use YOUR login and not the server’s service account.
![Page 25: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/25.jpg)
One more thing…
Your statements and scripts will run synchronously Do NOT expect your results to come back in a specific order The order of results appears to be the order of completion
![Page 26: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/26.jpg)
Multi-Server Administration
Incredibly cool Incredibly powerful The most unsexy technology to come out of Redmond since
Microsoft Bob Has a few quirks Does have a few serious caveats Caveats do have workarounds
![Page 27: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/27.jpg)
Benefits
Allows you to keep consistency with SQL Agent jobs across multiple servers
It’s a huge time saver when you need to change a script that you regularly run in your environment, such as backup scripts or index/statistics maintenance
When a job is deployed from the master server to targets, they are locked on the target. This enforces consistency.
![Page 28: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/28.jpg)
Pitfalls
It can be quirky Be careful with security It’s a complete culture shift When you push a job to target servers, it pushes all of the
properties, including the schedules. Be careful with IO-intensive jobs!
![Page 29: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/29.jpg)
Turning That Around
You can still deploy the job without a schedule Then create a job that uses msdb.dbo.sp_start_job This allows you to leverage the benefits of a centrally
managed server while using the schedule of a local job
![Page 30: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/30.jpg)
Demo
![Page 31: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/31.jpg)
Notable Tables
sysjobs – All of the jobs you have defined, both local and Multi-Server Jobs
systargetservers – Shows all of your target servers sysjobservers – Shows what jobs are deployed to what
servers
![Page 32: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/32.jpg)
Notable Procedures
sp_help_targetserver – Run from the master, shows all of your target servers Status of 5 means you have a process that is preventing you from
downloading instructions Shows much of the data in systargetservers
![Page 33: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/33.jpg)
A Note on Connectivity
This uses the connectivity between servers, not your machine’s connectivity
The pushing of SQL Agent job updates is done on a regularly scheduled polling process
![Page 34: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/34.jpg)
A Note on Security
Be very careful with security on this If you do this wrong, you could set yourself up for issues If users can manage SQL Agent jobs on your master servers,
they can deploy jobs to your target server, even if they don’t have access to that server
Jobs on the target run in the context of the target server’s service account
If you have segregation of duty issues, be very careful who you give access to your master server
![Page 35: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/35.jpg)
Wrapping Up
CMS and MSX are very different technologies Different capabilities Different use cases Combining the two gives you a great set of tools
![Page 36: Do More With Less: SQL Central Management Server and Multi-Server Administration](https://reader035.fdocuments.in/reader035/viewer/2022062514/55ba8c40bb61eb250a8b46e7/html5/thumbnails/36.jpg)
One more thing…
Neither CMS and MSX allow the main server to manage themselves
Put both of these tools on an independent box