Thinking outside the Box,
learning a little about a lot


  Mark Broadbent
  SQL Server DBA


  http://tenbulls.co.uk
  @r...
Agenda

Become a DBA 2.5
SQL Instance Enterprise name resolution strategies
D.I.Y. Virtual SAN
D.I.Y. Virtual Cluster
Fail...
Generalist vs Specialist

  Generalist
  “Jack of all trades” (...master of none), versatile
  Unfocused, unproductive

  ...
Generalist (the reality)




                
Specialist (the reality)




                 
Generalizing Specialist
  Agile
  Productive
  Can see larger picture
  Focused
  Versatile
  Take responsibility
  Less R...
Generalizing Specialist (the reality)




                
DBA Life­cycle

    unskilled            skilled     professional




        specialist


                         “DBA 2...
"A human being should be able to change a diaper, plan an invasion, 

butcher a hog, conn a ship, design a building,write ...
How to become a DBA 2.5 part I

  Understand your the environment
  Get out of your comfort zone
  Visit the server room!!...
How to become a DBA 2.5 part II
  From a technical level
  Use Personal Virtualization
  Understand hardware, RAID Levels ...
How to become a DBA 2.5 part III
  From a personal level
  Invest time
  Maintain standards
  Produce documentation and no...
Demo




       Virtualization – the basics




                 
Name Resolution

 Service Based             Machine Based

         DNS          DNS name
                                ...
Using DNS
               sqlbits.com.




               AUTHORITIVE
                 POSITIVE
                REFERRAL
  ...
Using SQL Native Client
            Lookup sqlbits1




   Connect to
  vserver1sql




                        
Updating SQL Native Client by 
Group Policy




              
Demo


       Redirecting an instance 
       using SQL Native Client
          and Group Policy



                
Using application based redirection

  DBMirroring Failover partner in connection string
          .NET 2.0 upwards
  Appl...
What is a SAN?
 ..Storage Area Network
 Works at the block level
 Scalable
 Highly available
 Remote
 Highly Accessible (U...
Preparing for our Virtual SAN
  Virtual Hardware
  Disk/s for Operating System and iSCSI targets
  Network Card

  Install...
Demo



       Setup our Virtual SAN
        and Virtual Cluster




               
Clustering solution version 1
   cluster1                                           cluster2

  server2   server3         ...
Clustering solution version 2
   cluster1                 Enterprise                  cluster2
                           ...
Demo



       Failing Groups across 
              Clusters




               
Using the CLR

 Calling Assemblies
 Call through SQLCLR
 Call through xp_cmdshell
 Directly/ scheduled tasks
 Integration ...
Using the CLR
using sql = Microsoft.SqlServer.Server;
using io = System.IO;

public class IO {
    [sql.SqlFunction()]
   ...
Using the CLR
using sql = Microsoft.SqlServer.Server;
using io ASSEMBLY SQLCallAssembly
  CREATE = System.IO;
       FROM ...
Using the CLR
using sql = Microsoft.SqlServer.Server;
using io ASSEMBLY SQLCallAssembly
  CREATE = System.IO;
    CREATE '...
Using the CLR
using sql = Microsoft.SqlServer.Server;
using io ASSEMBLY SQLCallAssembly
  CREATE = System.IO;
    CREATE '...
Summary #1
 DBA 2.5
 Widen your skillset but still stay focused 
 Talk to other teams and get involved
 Get your own Virtu...
Summary #2
 Virtual SAN and Virtual Cluster
 Easy to setup, great for testing

 Failing over Cluster Groups across Cluster...
Further Resources


http://tenbulls.co.uk/sqlbits/references
                   or
         http://bit.ly/a27KPH



      ...
Questions




      
Thinking outside the Box,
learning a little about a lot


  Mark Broadbent
  SQL Server DBA


  http://tenbulls.co.uk
  @r...
Upcoming SlideShare
Loading in...5
×

Thinking outside the box, learning a little about a lot

653

Published on

Being a SQL specialist is not enough. Windows and the interfaces SQL consumes are becoming ever more complex. Being aware of these technologies and beyond can make you a better DBA. You will learn how to become a DBA 2.5, SQL Enterprise name resolution strategies, create your own private VSAN & VCluster, fail instances BETWEEN separate clusters and use the CLR to manage the OS from SQL.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
653
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Thinking outside the box, learning a little about a lot"

  1. 1. Thinking outside the Box, learning a little about a lot Mark Broadbent SQL Server DBA http://tenbulls.co.uk @retracement    
  2. 2. Agenda Become a DBA 2.5 SQL Instance Enterprise name resolution strategies D.I.Y. Virtual SAN D.I.Y. Virtual Cluster Failing Cluster Groups between independent Clusters Using the CLR to expose and manage the OS    
  3. 3. Generalist vs Specialist Generalist “Jack of all trades” (...master of none), versatile Unfocused, unproductive Specialist Attention to detail, very productive, take responsibility A risk, inflexible, bottleneck    
  4. 4. Generalist (the reality)    
  5. 5. Specialist (the reality)    
  6. 6. Generalizing Specialist Agile Productive Can see larger picture Focused Versatile Take responsibility Less Risk    
  7. 7. Generalizing Specialist (the reality)    
  8. 8. DBA Life­cycle unskilled skilled professional specialist “DBA 2.5” 2.5 generalizing specialist    
  9. 9. "A human being should be able to change a diaper, plan an invasion,  butcher a hog, conn a ship, design a building,write a sonnet, balance accounts,  build a wall, set a bone, comfort the dying, take orders, give orders,  cooperate, act alone, solve equations, analyze a new problem,  pitch manure, program a computer, cook a tasty meal,  fight efficiently, die gallantly.  Specialization is for insects!" Robert A. Heinlein.    
  10. 10. How to become a DBA 2.5 part I Understand your the environment Get out of your comfort zone Visit the server room!!! Talk to people! Research Talk some more Get involved and take an interest    
  11. 11. How to become a DBA 2.5 part II From a technical level Use Personal Virtualization Understand hardware, RAID Levels and Storage  Understand TCP/IP and networking ...and know when to use ping, nslookup, netstat etc Use other Operating Systems and Database Engines Program a .NET language to a competent level Have an arsenal of tools and scripts    
  12. 12. How to become a DBA 2.5 part III From a personal level Invest time Maintain standards Produce documentation and notes Don't be afraid to say NO – you are responsible Don't be afraid to ask questions Surround yourself with brilliant people    
  13. 13. Demo Virtualization – the basics    
  14. 14. Name Resolution Service Based Machine Based DNS DNS name .NET SQLClient cache SQL Browser SQL Native Local hostname Service Client netbios name lmhosts NBNS (WINS) cache Active netbios hosts Directory broadcast    
  15. 15. Using DNS sqlbits.com. AUTHORITIVE POSITIVE REFERRAL NEGATIVE Lookup sqlbits1_alias vserver1.sqlbits.com. Connect to IP and instance 10.0.3.1sql1    
  16. 16. Using SQL Native Client Lookup sqlbits1 Connect to vserver1sql    
  17. 17. Updating SQL Native Client by  Group Policy    
  18. 18. Demo Redirecting an instance  using SQL Native Client and Group Policy    
  19. 19. Using application based redirection DBMirroring Failover partner in connection string .NET 2.0 upwards Application based error handling Inline Configuration files Virtualization?    
  20. 20. What is a SAN? ..Storage Area Network Works at the block level Scalable Highly available Remote Highly Accessible (Universal Storage Connectivity) High performance    
  21. 21. Preparing for our Virtual SAN Virtual Hardware Disk/s for Operating System and iSCSI targets Network Card Installation Media FreeNAS ISO or CD (alternatives such as Openfiler) Configuration Considerations IP address, subnet mask, g/w, memory Active Directory    
  22. 22. Demo Setup our Virtual SAN and Virtual Cluster    
  23. 23. Clustering solution version 1 cluster1 cluster2 server2 server3 server4 server5 vserver1 virtual server vserver1 vserver2 names shared vserver2 vserver3 vserver3 vserver4 vserver4 LUNS LUNS SAN based mirroring    
  24. 24. Clustering solution version 2 cluster1 Enterprise cluster2 Redirection server2 server3 server4 server5 vserver1 Unique virtual vserver1f vserver2f server names vserver2 vserver3 vserver3f vserver4f vserver4 LUNS LUNS SAN based mirroring    
  25. 25. Demo Failing Groups across  Clusters    
  26. 26. Using the CLR Calling Assemblies Call through SQLCLR Call through xp_cmdshell Directly/ scheduled tasks Integration Services Packages Powershell    
  27. 27. Using the CLR using sql = Microsoft.SqlServer.Server; using io = System.IO; public class IO { [sql.SqlFunction()] public static sqltype.SqlInt64 DriveFree(sqltype.SqlString drive){ io.DriveInfo di; try { di = new System.IO.DriveInfo(drive.ToString()); return di.TotalFreeSpace; } catch { return -1; } } ....... }    
  28. 28. Using the CLR using sql = Microsoft.SqlServer.Server; using io ASSEMBLY SQLCallAssembly CREATE = System.IO; FROM 'H:SQLCallAssembly.DLL' WITH PERMISSION_SET = EXTERNAL_ACCESS public class IO { GO [sql.SqlFunction()] public static sqltype.SqlInt64 DriveFree(sqltype.SqlString drive){ CREATE io.DriveInfo di; FUNCTION dbo.udf_drivefree(@drive NVARCHAR(1)) RETURNS BIGINT try { EXTERNAL NAME SQLCallAssembly.IO.DriveFree; di = new System.IO.DriveInfo(drive.ToString()); GO return di.TotalFreeSpace; CREATE }FUNCTION dbo.udf_driveused(@drive NVARCHAR(1)) ... catch { return -1; } CREATE FUNCTION dbo.udf_drivesize(@drive NVARCHAR(1)) } .......... } CREATE FUNCTION dbo.udf_drivefreepercent(@drive NVARCHAR(1)) ... CREATE FUNCTION dbo.udf_driveusedpercent(@drive NVARCHAR(1)) ... GO    
  29. 29. Using the CLR using sql = Microsoft.SqlServer.Server; using io ASSEMBLY SQLCallAssembly CREATE = System.IO; CREATE 'H:SQLCallAssembly.DLL' FROM VIEW vw_drivespace AS public SELECTIO { class 1 as 'seq', WITH PERMISSION_SET = EXTERNAL_ACCESS GO [sql.SqlFunction()] drive, 'system' as public 'C' as sqltype.SqlInt64 DriveFree(sqltype.SqlString drive){ static 'letter', [dbo].[udf_drivefreepercent]('c') AS [%free], CREATE io.DriveInfo di; FUNCTION dbo.udf_drivefree(@drive NVARCHAR(1)) RETURNS BIGINT [dbo].[udf_driveusedpercent]('c')as [%used], try { EXTERNAL NAME SQLCallAssembly.IO.DriveFree;AS [capacity(MB)], [dbo].[udf_drivesize]('c')/1048576 di = new System.IO.DriveInfo(drive.ToString()); GO [dbo].[udf_drivefree]('c')/1048576 AS [free(MB)], return di.TotalFreeSpace; CREATE } [dbo].[udf_driveused]('c')/1048576 as [used(MB)] FUNCTION dbo.udf_driveused(@drive NVARCHAR(1)) ... UNION { return -1; } catch CREATE FUNCTION dbo.udf_drivesize(@drive NVARCHAR(1)) } .......... ..... } CREATE FUNCTION dbo.udf_drivefreepercent(@drive NVARCHAR(1)) ... SELECT ..... CREATE FUNCTION dbo.udf_driveusedpercent(@drive NVARCHAR(1)) ... GOGO    
  30. 30. Using the CLR using sql = Microsoft.SqlServer.Server; using io ASSEMBLY SQLCallAssembly CREATE = System.IO; CREATE 'H:SQLCallAssembly.DLL' FROM VIEW vw_drivespace AS public SELECTIO { class 1 as 'seq', WITH PERMISSION_SET = EXTERNAL_ACCESS GO [sql.SqlFunction()] drive, 'system' as public 'C' as sqltype.SqlInt64 DriveFree(sqltype.SqlString drive){ static 'letter', [dbo].[udf_drivefreepercent]('c') AS [%free], CREATE io.DriveInfo di; FUNCTION dbo.udf_drivefree(@drive NVARCHAR(1)) RETURNS BIGINT [dbo].[udf_driveusedpercent]('c')as [%used], try { EXTERNAL NAME SQLCallAssembly.IO.DriveFree;AS [capacity(MB)], [dbo].[udf_drivesize]('c')/1048576 di = new System.IO.DriveInfo(drive.ToString()); GO [dbo].[udf_drivefree]('c')/1048576 AS [free(MB)], return di.TotalFreeSpace; CREATE } [dbo].[udf_driveused]('c')/1048576 as [used(MB)] FUNCTION dbo.udf_driveused(@drive NVARCHAR(1)) ... UNION { return -1; } catch CREATE FUNCTION dbo.udf_drivesize(@drive NVARCHAR(1)) } .......... ..... } CREATE FUNCTION dbo.udf_drivefreepercent(@drive NVARCHAR(1)) ... SELECT ..... CREATE FUNCTION dbo.udf_driveusedpercent(@drive NVARCHAR(1)) ... GOGO    
  31. 31. Summary #1 DBA 2.5 Widen your skillset but still stay focused  Talk to other teams and get involved Get your own Virtual Environment Name Resolution Useful for abstracting from the host name Not suitable for every situation, good for applications    
  32. 32. Summary #2 Virtual SAN and Virtual Cluster Easy to setup, great for testing Failing over Cluster Groups across Clusters Effective, but element of risk Ensure strict guidelines and standards are followed Using the CLR Useful for the DBA too! Many uses and ways of calling assemblies    
  33. 33. Further Resources http://tenbulls.co.uk/sqlbits/references or http://bit.ly/a27KPH    
  34. 34. Questions    
  35. 35. Thinking outside the Box, learning a little about a lot Mark Broadbent SQL Server DBA http://tenbulls.co.uk @retracement    
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×