DAT332 Database Administration For Developers Stephen Wynkoop SQL Server Worldwide User’s Group

Slides:



Advertisements
Similar presentations
SQL-BackTrack for Sybase
Advertisements

Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Advanced SQL Schema Customization & Reporting Presented By: John Dyke As day to day business needs become more complex so does the need for specifically.
Burt King We will cover: Essentials --No command line needed here (mott) What is SQL Server How does it come to life What are the.
2 Copyright © 2005, Oracle. All rights reserved. Installing the Oracle Database Software.
Common Mistakes Developers Make By Bryan Oliver SQL Server Mentor at SolidQ.
Moving Data Lesson 23. Skills Matrix Moving Data When populating tables by inserting data, you will discover that data can come from various sources.
Database Optimization & Maintenance Tim Richard ECM Training Conference#dbwestECM Agenda SQL Configuration OnBase DB Planning Backups Integrity.
MCTS Guide to Microsoft Windows Server 2008 Network Infrastructure Configuration Chapter 11 Managing and Monitoring a Windows Server 2008 Network.
CS27510 Commercial Database Applications. Maintenance Maintenance Disaster Recovery Disaster Recovery.
DEV450 Visual Studio: Best Practices For Debugging Managed Applications Habib Heydarian Scott Nonnenberg Program Managers Microsoft Corporation.
AGENDA Tools used in SQL Server 2000 Graphical BOL Enterprise Manager Service Manager CLI Query Analyzer OSQL BCP.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
A Technical Overview of Microsoft SQL Server 2005 Melville Thomson IT Pro Evangelist (UK)
1 Chapter Overview Transferring and Transforming Data Introducing Microsoft Data Transformation Services (DTS) Transferring and Transforming Data with.
DB Audit Expert v1.1 for Oracle Copyright © SoftTree Technologies, Inc. This presentation is for DB Audit Expert for Oracle version 1.1 which.
Chapter 2 Administrating DB Engine. Database Engine  The Database Engine is the core service for storing, processing, and securing data.  It provides.
Module 16: Software Maintenance Using Windows Server Update Services.
Today’s Agenda Chapter 12 Admin Tasks Chapter 13 Automating Admin Tasks.
Copyright © 2007 Quest Software The Changing Role of SQL Server DBA’s Bryan Oliver SQL Server Domain Expert Quest Software.
SQL Server 2008 Implementation and Maintenance Chapter 7: Performing Backups and Restores.
Module 8: Server Management. Overview Server-level and instance-level resources such as memory and processes Database-level resources such as logical.
Chapter 10 : Designing a SQL Server 2005 Solution for High Availability MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design.
Maintaining a Microsoft SQL Server 2008 Database SQLServer-Training.com.
1 Chapter Overview Creating a User Database Setting Database Options Managing User Database Size Placing Database Files on Multiple Disks.
SSIS Over DTS Sagayaraj Putti (139460). 5 September What is DTS?  Data Transformation Services (DTS)  DTS is a set of objects and utilities that.
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 3 Administration of Users.
Copyright ®xSpring Pte Ltd, All rights reserved Versions DateVersionDescriptionAuthor May First version. Modified from Enterprise edition.NBL.
Maintaining a Mirrored Database Tips and Tricks by Paul G. Hiles.
Informix IDS Administration with the New Server Studio 4.0 By Lester Knutsen My experience with the beta of Server Studio and the new Informix database.
Learningcomputer.com SQL Server 2008 – Administration, Maintenance and Job Automation.
IT 456 Seminar 5 Dr Jeffrey A Robinson. Overview of Course Week 1 – Introduction Week 2 – Installation of SQL and management Tools Week 3 - Creating and.
Page 1 SQL Server Myths XV ENCONTRO DA COMUNIDADE SQLPORT Rui Ribeiro MCITP 2011/08/16.
Module 16: Performing Ongoing Database Maintenance
1 Chapter Overview Preparing to Upgrade Performing a Version Upgrade from Microsoft SQL Server 7.0 Performing an Online Database Upgrade from SQL Server.
1 Chapter Overview Performing Configuration Tasks Setting Up Additional Features Performing Maintenance Tasks.
A Brief Documentation.  Provides basic information about connection, server, and client.
By Shanna Epstein IS 257 September 16, Cnet.com Provides information, tools, and advice to help customers decide what to buy and how to get the.
SQL Server 2000 Sys Admin Jeremiah Curtis Engineering Services
MISSION CRITICAL COMPUTING Siebel Database Considerations.
Visual Basic for Application - Microsoft Access 2003 Finishing the application.
Module 6: Administering Reporting Services. Overview Server Administration Performance and Reliability Monitoring Database Administration Security Administration.
Praveen Srivatsa Director| AstrhaSoft Consulting blogs.asthrasoft.com/praveens |
Log Shipping, Mirroring, Replication and Clustering Which should I use? That depends on a few questions we must ask the user. We will go over these questions.
SQL SERVER MAINTENANCE PLANS Kat
SQL Server Security The Low Hanging Fruit. Lindsay Clark Database Administrator at American Credit Acceptance
11 Copyright © 2004, Oracle. All rights reserved. Performing a Migration Using Oracle Migration Workbench (Part II)
SQL Advanced Monitoring Using DMV, Extended Events and Service Broker Javier Villegas – DBA | MCP | MCTS.
3 Copyright © 2006, Oracle. All rights reserved. Designing and Developing for Performance.
You Inherited a Database Now What? What you should immediately check and start monitoring for. Tim Radney, Senior DBA for a top 40 US Bank President of.
Microsoft SMS 2003 Management Pack. For More SMS Information The public SMS Web site –
Blog.eardley.org.uk SharePoint Databases What you need to know Alan Eardley SQL Saturday Exeter 25 April 2015.
Lecture 19 Page 1 CS 236 Online 6. Application Software Security Why it’s important: –Security flaws in applications are increasingly the attacker’s entry.
ProgressBook Suite Maintenance
SQL Database Management
Chapter Objectives In this chapter, you will learn:
You Inherited a Database Now What?
Tips for SQL Server Performance and Resiliency
Curacao SQL Saturday June 11, 2016
Performance Management
A Technical Overview of Microsoft® SQL Server™ 2005 High Availability Beta 2 Matthew Stephen IT Pro Evangelist (SQL Server)
Introduction to SQL Server Management for the Non-DBA
SQL Server May Let You Do It, But it Doesn’t Mean You Should
Tips for SQL Server Performance and Resiliency
Tips for SQL Server Performance and Resiliency
Re-Indexing - The quest of ultimate automation
You Inherited a Database Now What?
Sql Saturday Philadelphia
6. Application Software Security
Presentation transcript:

DAT332 Database Administration For Developers Stephen Wynkoop SQL Server Worldwide User’s Group

Agenda Learn about key features that you should be aware of Backup, Restore Performance Tips Indexes, Tuning, Cursors Available Tools Q&A

Overall Goal Get in Get what you need Get out NEVER: SELECT * FROM mytable Be fast Be recoverable Data-wiseBackup/recover-wise

Multiple Instance Support Why is this interesting? There is typically a default instance (but not required) Instances can “talk” to one-another Instances can be administered separately Good for splitting environments, collation issues, testing, learning

Recovery Models Yes, it’s your job to work with the DBA Different Models FullSimpleBulk-logged Point in time, or “marker” recovery (drop anchor…) DO NOT wait until disaster strikes to find out the wrong measures are in place “Backups are not important Restoration/recovery is”

Recovery Models Database, Properties, Options….

Recovery Model: Full Full transaction log restore Restore the baseline db Restore the transaction logs in order Restored up to last tran. log backup Watch the transaction log physical devices Beware total reliance on tran. log Best production environment option

Recovery Model: Simple Backup/restore at the database level Good for development environments Disaster recovery, but not transaction recovery since the last backup “All or nothing” restore

Recovery Model: Bulk_logged Better for bulk operations Select into, etc. Good for a migrating database If the data exists elsewhere Can be rebuilt from other source Good for DTS move operations – control log size build-up Restore to last transaction log backup Re-bulk-operation to get current again Switch to better model for production

Other Recovery Options Lumigent Log Explorer BMC SQL Back-Track Allow you to potentially recover a dropped table, a specific transaction, etc.

SQL Server Backup Backup types/models – know them! Full (Complete) Differential Transaction log File or file group File differential Different impacts on the system Change based on production versus test environment

Copy/Move Database Wizard Uses sp_detach_db/sp_attach_db Beware: objects, scripting, dependencies Test, test, test Check for tasks that copy, system-level operations Check for jobs, logins, etc. Good for moving to production

Moving A Database To Production DTS: If you use it, be cautious and check your work JobsViews Don’t forget “system-level objects” – anything outside the db. Won’t transfer If you don’t tell it to replace data – it will append, duplicating your data

Creating SQL Agent Tasks Use these to automate database processes Examples: Grouping of data Creating stat summary tables Resetting counters SQL Server Agent: select Jobs, New Document your agent jobs

Creating A Task…

Maintenance Plans Sets of instructions carried out regularly Database backup Integrity check, etc.

Database Maintenance Plan Creates a job for the backup Creates a job for the transaction log backups Creates a job for other database maint. Tasks Re-orgShrinkEtc. Management >> SQL Server Agent >> Jobs…

Most Important Tabs… Backup and Tran. Log Backup Warning: disk files can get really large…

Shrinking The Database Right click on the db All tasks Shrink database… Can be a big performance boost Can be a big budget saver!

Traditional ASP Tuning Put your connection STRINGS in the global.asa Application variables (not session) NOT other variables unless you absolutely need to NOT connections themselves – very bad Remove non-essential info from the global.asa Beware SESSION versus Application

Global.asa(x) – Hacker’ s Dream Access = access to SQL server Consider how your application accesses the db – Read-only UIDs Move admin functions – don’t use global for their security info? Never multi-database use for an ID Live behind a physical firewall… Encrypt passwords/info

Stored Procedures If you’re using a SELECT over and over – consider stored procedures Compiled on the server Based on data modeling Optimized Can be encrypted Central admin Fights injection All DB interaction should go through an SP if possible

Indexing EXTREMELY IMPORTANT If you’re not indexing, you’re not close to full performance “Covered” queries Clustered versus not… Examine your SELECT statements Order in the SELECT

Using The Tuning Tools Captures the SQL statements by connection Runs remotely Tune to specific database

Tuning… Let profiler work with your workload Save the workload Play it back through the performance wizard Watch the cursors (resources) Watch the open connections (memory) Watch the DB growth Auto-grow is nice, but… …Out of disk space!

Index Tuning Wizard Use the Profiler tool Capture activity to a file Re-run that activity through the profiler index tuning wizard Implement, review or document the suggestions

More Performance Ideas Select count(*) – Table Scan Execution plans How to get them How to read them Query Analyzer >> ctrl-K or “results in grid” drop down – Show Execution Plan

Example Plan

Additional Performance Tips SET NOCOUNT ON in stored procedures Stops “10 rows affected…” Query Analyzer – What operation is faster? Set up statements to compare Run with showplan Shows relative execution times

More Performance Tips Check for indexes on… JOINsViews Keep statistics updated (esp. after mass updates) sp_updatestats Also “auto update statistics” at database level

Script And Schema Control Save your scripts offline Don’t rely on the DBA for your backups Version control applied to scripts Script out the entire db after major changes

Scripting Objects

Security Don’t have all developers login with the same UID Don’t use the DBA UIDs for developers Do keep UIDs confidential Don’t let an application use a developer/user/dba login

SQL Injection Can provide alarming access Select * from myTable where lname=‘” request.form(“lastname”) & “’” Form input ’ or ‘a’=‘a Result: select * from mytable where lname=‘’ or ‘a’=‘a’ How to protect against it Stored procedures Watching quotes Control statement generation Parameter queries Best Description: Don’t let someone else write your code… - Steve Kass

Other Points To Consider Web site: session timeout Defaults to 20 minutes Web site: HTTP keep-alives Forces IIS to keep around information on the connection (memory) Cursors versus more simple SELECTs Storing summary information versus detail for later calculation Move reporting support to a different server

Use Available Tools Query Analyzer Enterprise Manager SQL Agent Scripting Engine Wizards! Profiler – use it as first line of investigation Import/Export/Move Tools – but with caution

Online Resources Sswug.orgSqlServerCentral.comMSSQLserver.comSql-Server-Performance.comSQLSecurity.comSQLTeam.comSQLJunkies.com

Third-Party Tools Imceda – compressed/faster backups Idera – monitoring, management tools BMC – recovery tools Sonasoft – automated disaster recovery Sql Power Tools – low-impact monitoring Red-Gate – schema comparison, synchronization

Q1:Overall satisfaction with the session Q2:Usefulness of the information Q3:Presenter’s knowledge of the subject Q4:Presenter’s presentation skills Q5:Effectiveness of the presentation Please fill out a session evaluation on CommNet

Questions… ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? Stephen Wynkoop (be sure to grab a performance tips poster from The SQL Server booth in the exhibit hall)