1.19k likes | 1.6k Views
David Henson dhenson@certifiednetworks.com www.certifiednetworks.com. Microsoft SQL Server Administration. Logistics. Class Days: 10 Class Hours: 6:30pm – 10:00pm Notes/Handouts Demos Slack Channel. Recommended Reading. Microsoft SQL Server(TM) 2005 Administrator's Pocket Consultant
E N D
David Henson dhenson@certifiednetworks.com www.certifiednetworks.com Microsoft SQL Server Administration
Logistics • Class Days: 10 • Class Hours: 6:30pm – 10:00pm • Notes/Handouts • Demos • Slack Channel
Recommended Reading • Microsoft SQL Server(TM) 2005 Administrator's Pocket Consultant (Pro-Administrator's Pocket Consultant) • Microsoft Press
Module 1: Overview • Course Outline • Lab Setup • Definitions • Tools • What is SQL Server • SQL Language Basics • SQL Server Network Integration
Course Outline – Day 1 • Module 1: Overview • Module 2: Installation • Module 3: Objects and Securables • Module 4: Security And Principals
Course Outline – Day 2 • Module 5: Backup • Module 6: Restore
Course Outline – Day 3 • Module 7: Web and Email Integration • Module 8: Automation and Job Scheduling • Module 9: Transferring Data • Module 10: Replication
Lab Setup • Windows Server • SQL Server 2016 • Standard, or Enterprise • Computer Names • IP Addresses
SQL SMO(Formerly DMO) SQL Instance Principal Securable Definitions • Relational Database • DBA • Server • Client • Transact SQL • Login • User • Role • Database
Tools • SQL Management Studio • Visual Studio .Net Current Version • SQL Server Configuration Manager • Command Prompt • SQLCMD • Ping, telnet, nslookup, net use • Database Tuning Advisor • Full-FeaturedText Editor • Notepad++(Free) • UltraEdit • Textpad • Profiler
What is SQL Server? • Client Server Relational Database Operating System • Windows Service That Manages Database Files, Security and Concurrency
SQL Language Basics • SELECT • INSERT • UPDATE • DELETE
SQL Server Network Integration • Network oriented protocols • TCP/IP disabled on SQL Express by default • DNS • Windows Domain/Active Directory • Firewall Settings
Lab 1A – Tools • In this instructor led lab, you will: • Preview SQL Management Studio • Preview Database Engine Tuning Advisor • Preview Profiler
Module 2: Installation • Software Requirements • Hardware Requirements • SQL Server Versions • Licensing • Capacity Planning • SQL Services • Installation
Requirements • Operating System • Windows • Linux/Mac/Docker for SQL 2017 • Hosted (AWS, Azure)
SQL Server Licensing • Enterprise • Standard • Developer • Express • License Options • Core based • Server plus CAL (Client Access License)
Capacity Planning • Drive Space • CPU • Memory • I/O Subsystem
I/O Subsystem • RAID 0, 1, 5 or 10 • Logical Drive Structure • Physical Drive Structure • Considerations: • Performance • Ease and Cost of Management • Disaster Planning
SQL Services • Service Names: • SQL Server (MSSQLServer) • SQL Server Agent (MSSQLServer) • SQL Server Browser • SQL Traffic director, allows Dedicated Admin Connection (DAC) • SQL Server Integration Services • SQLIS.com • SQL Server Fulltext Search • SQL Server Analysis Services • SQL Server Reporting Services • Starting/Stopping
Service Accounts • LocalSystem • Local Account • Domain Account • Automatic Startup
Installation • Options • SQL Server • Up to 16 instances • SQL Server Management Studio • SQL Server Data Tools (SSDT) • Administrative Rights
What is an Object? • Type Of Objects: • Table • View • Stored Procedure • Trigger • DataType • Function (UDF) • Index • Constraint
Synonyms • Allows an alias for a securable • New CREATE SYNONYM syntax
Creating Objects • CREATE Statement • Example: CREATE TABLE Customers( CustomerID int identity, CustomerEmail varchar(50) )
Altering Objects • ALTER Statement • Example: ALTER TABLE Customers ADD CustomerPhone varchar(40)
Dropping Objects • DROP Statement • Example: DROP TABLE Customers
Getting Metadata • Information Schema • Sysobjects table • Sp_helptext
Setting Permissions • GRANT Statement • Example: GRANT SELECT ON Customers TO Public
Surface Area Configuration • Best practice – reduce the “surface area” exposure of your system to minimum • Off By Default • Microsoft .NET Framework, • SQL Service Broker Network Connectivity, and • HTTP connectivity in Analysis Services • Xp_cmdshell • Ad Hoc Remote Query • Database Mail • Native XML Web Service • See Server Facets Tool in Enterprise Manager
Levels of Security • Login – Server Level • User – Database Level • Object – Permissions to Access Objects • Application Security • Network Access • Encryption
Windows Workgroup Model • Distributed Accounts • Each machine has locally maintained user and group database • Windows Server Not Required
Windows Domain Model • Centralized Accounts • Active Directory is a single source for users and groups • Single Sign-On • Access all resources after logging in only once • Auditing
Active Directory • Extension of the Domain Model • Leverages DNS Name Resolution • Better Security Protocols • Better Fault Tolerance • More Extensible • Group Policy
Logins • Types: • Windows (Integrated) • SQL (Standard) • Tools • SQL Management Studio • Scripts
Users • Tools: • SQL Management Studio • Scripts
Roles • Role Is A Group of users • Purpose – Ease Permission Management • Role Types: • Standard • Application Role • Tools: • SQL Management Studio • Scripts
Permissions • User Defined: • Action • Object Access • Object Execution • Tools: • SQL Management Studio • Scripts
Reasons for Data Loss • Accidental Update • Hardware Failure • Improper Application Design • Transactions Not Used • Other User Error • Intentional Distruction • Hackers • Viruses
SQL Server Backup • Online Backup • Users can access data during backup • Types: • Full • Differential • Log • COPY_ONLY option • Does not disturb normal backups, truncate logs, or reset any flags • Use of Filegroups
Increasing Backup Performance • Set appropriate BLOCKSIZE parameter • -2048 good for cdrom stored backups • With default setting, restore uses buffered io which is more flexible and slower • Stripe backup devices
Restricted Activities During Backup • Modifying Database Properties • Autogrowth • Managing Indexes • Nonlogged Operations
Backup Statement • Example: BACKUP DATABASE Lab3A To Disk=‘c:\Lab3A.bak’ WITH INIT, BLOCKSIZE=2048