0101_sql server 2005 architecture

Upload: sureshprk

Post on 03-Jun-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 0101_SQL Server 2005 Architecture

    1/36

    SQL Server 2005 Yukon Ascend

  • 8/12/2019 0101_SQL Server 2005 Architecture

    2/36

    SQL Server 2005 Architecture

    Engine architecture Metadata (Catalog) Interface

    Resource Database

    sys schema

    Catalog views

    Catalog security

  • 8/12/2019 0101_SQL Server 2005 Architecture

    3/36

    SQL Server Relational EngineHigh-Level Architecture

    Storage Engine (Access Methods, Database Page

    Cache, Locking, Transactions, )

    SQL-OS (Schedulers, Buffer Pool, Memory

    Management, Synchronization Primitives, )

    Query Optimization

    (Plan Generation, View

    Matching, Statistics,

    Costing)

    Query Execution

    (Query Operators,

    Memory Grants,

    Parallelism)

    Language Processing (Parse/Bind,

    Statement/Batch Execution, Plan Cache

    Management)Utilities

    (DBCC

    ,

    Bac

    kup/Restore,B

    CP,)

    Met

    adata,

    Typesystem,

    Ex

    pressionService

    s

  • 8/12/2019 0101_SQL Server 2005 Architecture

    4/36

    SchedulerMemory ManagerDeadlock Monitor

    Buffer PoolLock Manager

    SQL CLR Hosting Layer

    Synchronization

    Services

    SQL Messages RPC MessagesHTTP messages

    SQL OS

    Algebraizer

    T-SQL

    Compiler

    P

    A

    R

    S

    ER

    Query

    Optimizer

    SQL

    Manager

    T-SQL

    Execution

    CLR

    QueryExecution

    Expression

    Service

    Execution Environment

    Storage Engine

    Results

    METADATA Interface

  • 8/12/2019 0101_SQL Server 2005 Architecture

    5/36

  • 8/12/2019 0101_SQL Server 2005 Architecture

    6/36

    Metadata (Catalog) Interface

    Catalog Views - new interface to SQL catalog Only interface that supports all new features

    This is a new API

    Permissions-based metadata access You only see metadata for objects you own or can access

    Changes to applications that directly access System Tables DMVs - Views and Functions that dynamically show system state

    Dynamic Management Views and Functions

    Views over persisted catalog metadata Catalog Views (new in Microsoft SQL Server 2005)

    Compatibility Views (replace System Tables)

    INFORMATION_SCHEMA Views (ANSI SQL-99)

  • 8/12/2019 0101_SQL Server 2005 Architecture

    7/36

    The introduction of the sys schema

    No more direct base table access - Use Catalog views!

    Catalog Views - strive to be close to the DDL sys.labels, sys.procedures, sys.views, sys.assemblies

    The System Tables in SQL 2000 are now views

    They are deprecated

    Permissions-based metadata access

    Metadata (Catalog) Interface

  • 8/12/2019 0101_SQL Server 2005 Architecture

    8/36

    Resource Database

    Read-only database contains code for system: procedures, views, functions, assemblies, etc.

    Resource database is to compiled System SQL code as DLLsare to compiled C++ code

    Does not show in sys.databases view

    %\MSSQL.n\MSSQL\DATA\mssqlsystemresources.mdf System objects are no longer persisted into master

    Now in a resource database

    Makes for faster service pack upgrades

    Easier Rollbacks

  • 8/12/2019 0101_SQL Server 2005 Architecture

    9/36

    Resource Database

    Think of it as a code deployment mechanism

    A pluggable database, a file copy

    No more scripts to run at hot fix or service pack time

    System catalog metadata persists in the resource database

    Server-level data persisted in master

    Per-database data persisted into each database

    Master and user databases derive system objectsmetadata from resource database

    System objects shipped in the resource database not in

    master System objects appears in the sys schema of every

    database sys.sp_help, sys.tables, sys.objects,

  • 8/12/2019 0101_SQL Server 2005 Architecture

    10/36

    Resource Database (cont.)

  • 8/12/2019 0101_SQL Server 2005 Architecture

    11/36

    The sys schema

    The schema that contains all the engines system objects The catalog views, compatibility views, stored procedures,

    functions, etc

    The sys schema appears in every database

    Metadata describing user objects is materialized through

    catalog views in the sys schema select * from sys.objects

    Metadata describing the system ob jects themselvesismaterialized through other catalog views in the sysschema

    select * from sys.system_objects

    Similar concept to INFORMATION_SCHEMA

  • 8/12/2019 0101_SQL Server 2005 Architecture

    12/36

    Object Types

    SQL Server 2000 object types:

    C = CHECK constraint

    D = Default or DEFAULT constraint

    F = FOREIGN KEY constraint

    FN = Scalar function

    IF = Inlined table-function

    K = PRIMARY KEY or UNIQUE cons traint

    L = Log

    P = Stored procedure

    R = RuleRF = Replication filter stored procedure

    S = System table

    TF = Table function

    TR = Trigger

    U = User table

    V = View

    X = Extended stored procedure

    SQL Server 2005 object types:

    AF = Aggregate Function (CLR)

    C = Check constraint

    D = Default (constraint or stand-alone)

    F = Foreign-key constraint

    PK = Primary-key con straint

    P = SQL Stored-Procedure

    PC = Assemb ly (CLR) Stored-Procedu re

    FN = SQL Scalar-FunctionFS = Assemb ly (CLR) Scalar-Func tion

    FT = Assemb ly (CLR) Table-valued Func tion

    IF = SQL Inlined Table-valued Function

    R = Rule (old-style, stand-alone)

    RF = Replication-filter-procedure

    SN = Synonym

    SQ = Service Queue

    TA = Ass embly (CLR) DML Trigger

    TF = SQL Table-valued-FunctionTR = SQL DML Trigger

    U = Table (User-defined)

    UQ = Unique con straint

    V = View

    X = Extended Stored Procedure

  • 8/12/2019 0101_SQL Server 2005 Architecture

    13/36

    Catalog Security

    You only see metadata for objects you can access sa still sees everything in the system dbo still sees everything in the database

    Row-level filtering automatically applied to every

    catalog access select * from sys.objects only shows me metadata for

    objects I own or have been grantedsome permissionon

    If you do not have permission: You will not see the row, may return an empty set!

  • 8/12/2019 0101_SQL Server 2005 Architecture

    14/36

    Catalog Security (cont.)

    The one class of object that SQL 2005 treats more

    strictly are things like check constraints, security

    expressions, and triggers

    These kinds of things constitute the business

    logic of the application, so only the owners orhighly privileged roles get to see that metadata

    In other words, GRANTing someone SELECT on

    your table doesnt entitle them to see the SQL

    source text of the triggers

  • 8/12/2019 0101_SQL Server 2005 Architecture

    15/36

    Catalog Security Examples

    sys.databases => only shows the databases you have

    access to

    sys.tables => only shows tables you own or have somepermissions on

    sys.database_permissions => only shows permissions forwhich you are the grantee or grantor

    sys.check_constraints => only visible to the owner or

    privileged roles

    sys.procedures => only visible to the owner or privilegedroles

  • 8/12/2019 0101_SQL Server 2005 Architecture

    16/36

    Permission-based access

    VIEW DEFINITION is a permission to be granted to non-owners

    Allows the grantee to see metadata (SP_HELP tablename) but NOT the data Unless SELECT permission is already present

    VIEW ANY DEFINITION GRANT-ed @ server scope Grantee sees metadata for ANYthing in the server

    VIEW DEFINITION GRANT-ed @ database scope Grantee sees metadata for everything in the database

    VIEW DEFINITION GRANT-ed @ schema scope Grantee sees metadata for everything in the schema

    VIEW DEFINITION GRANT-ed @ object scope Grantee sees metadata for the specific object

    GRANT VIEW DEFINITION ON XML SCHEMA COLLECTION::dbo.MySC TO

    schemaUser

  • 8/12/2019 0101_SQL Server 2005 Architecture

    17/36

    Questions?

  • 8/12/2019 0101_SQL Server 2005 Architecture

    18/36

    Tools and Proactive Management

  • 8/12/2019 0101_SQL Server 2005 Architecture

    19/36

    Installation

    Ease of use: Windows Installer-based installation

    System Configuration Checker for verifying target

    machine

    Command-line utilities for performing unattended

    and remote installation

    Ability to add and remove SQL Server 2005

    components through Add and Remove

    Improved error logging and failure reporting

  • 8/12/2019 0101_SQL Server 2005 Architecture

    20/36

    Computer Manager

    The Computer Manager combines the functionality of the following

    SQL Server tools in the previous versions: Server Network Utility,Client Network Utility and Server Manager

    The following services are managed by the Computer Manager:

    SQL Server

    SQL Server Agent

    SQL Server Analysis Services Report Server

    Microsoft Search

    Distributed Transaction Coordinator (DTC)

    Full Text Search

    The Computer Manager uses the WMI to view and change the server

    settings and is part of the Microsoft Management Console (MMC)

  • 8/12/2019 0101_SQL Server 2005 Architecture

    21/36

    SQL Server Management Studio

    Provides an integrated centralized environment formanagement of multiple servers, tasks and services

    Features include: Object Explorer

    Assisted Editors

    Summary Window

    Extensions to Query Editor for SQLCMD

    Template Explorer Better error handling

    Project management (Solution Explorer)

    Non-modal dialog boxes

    Better scripting and scheduling abilities

  • 8/12/2019 0101_SQL Server 2005 Architecture

    22/36

    Object Explorer

    Displays the SQL components in a graphical tree

    hierarchy

    Allows the user to expand multiple nodes of the

    tree simultaneously

    Allows the user to filter a node based on one ormultiple filtering criteria

    Provides a friendly user interface for management

  • 8/12/2019 0101_SQL Server 2005 Architecture

    23/36

    Project Management

    Solution Explorer is a project management tool

    The functionality available to manage the project is:

    Organize related scripts into a single script project

    Maintain version control on scripts. (If VSS is

    available) Store connection and result options with each script

  • 8/12/2019 0101_SQL Server 2005 Architecture

    24/36

    Query Editor

    Allows execution of T-SQL scripts and statements against SQL

    Server and SQL Server Mobile Edition, multidimensionalexpressions (MDX), data mining expression (DMX) and XMLA

    The ability to write scripts in a disconnected mode

    Dynamic help

    Improved display for XML results. Results in XML form, whenusing the XML column or XML functions for Transact-SQL

    Improved readability by use of color-coding

    Graphical representation of the showplan information,presenting the execution plan of a T-SQL statement

    Extensions to support SQLCMD commands interactively

  • 8/12/2019 0101_SQL Server 2005 Architecture

    25/36

    Query Editor

    SQLCMD mode

    Allows the user to write operating system actions

    Replacement for isqlw, osql and xp_cmdshell

    Allows OS commands to be executed interactively

    Can enable a dedicated administrator connection toaccess a running server even if the server is not

    responding or is otherwise unavailable

    The user needs to execute the SQLCMD utilityat the command prompt by using

    the -Aswitch to specify a dedicated connection

  • 8/12/2019 0101_SQL Server 2005 Architecture

    26/36

    Assisted Editors & Templates

    Assisted Editors for authoring SQL Server objects with

    text properties like stored procedures, triggers and

    functions

    Example to access Assisted Editors: Open SQL Server Management Studio

    Explore Object Browser. Select SQL Instance Databases

    Programmability Stored Procedures

    Right click on Stored Procedures New Stored Procedure

    This will open the assisted editor with header information for

    creating the stored procedure

  • 8/12/2019 0101_SQL Server 2005 Architecture

    27/36

    Maintenance Plans

    Benefits in SQL Server 2005:

    Wizard and custom T-SQL available for ease of

    creation of typical plans

    Better manageability: User can introduce a hierarchy

    for maintenance plans. Each plan can have subplans

    which allow the user to create workflows and can be

    scheduled at different times

    Enhanced security: Maintenance plans are supported

    using only Windows Authentication

    Data Transformation

  • 8/12/2019 0101_SQL Server 2005 Architecture

    28/36

    Data Transformation

    Services (DTS)

    The DTS architecture consists of four parts: The DTS Service tracks DTS packages that are running and manages the

    storage of packages

    The DTS run-time engine stores package layout, executes packages,controls flow between tasks and provides run-time services such asdebugging, logging, event handling and management of connections,variables and transactions

    The DTS Data flow engine provides the capability to provide fast,flexible, extensible and dependable data movement as it has beenoptimized for high performance data movement and transformation

    This engine supports multiple sources, multiple transformations andmultiple destinations in one fast, flexible data flow

    The DTS clients include the tools, wizards and command line utilities that

    DTS provides as well as custom applications which allow the DBAs todevelop, deploy and execute DTS packages

  • 8/12/2019 0101_SQL Server 2005 Architecture

    29/36

    DTS

    The Business Intelligence Development Studio provides an

    environment similar to Visual Studio which is familiar to thedevelopers for designing packages

    SQL Server Management Studio provides tools required to manageand execute the DTS package

    DTS provides easy deployment of packages and their dependencies.DTS packages include package configurations which can be used toload configuration values at runtime

    Command line utilities:

    dtexec utility

    dtutil utility

    The user can execute the DTS package from DTS Designer in

    Business Intelligence Development Studio, in the DTS Import/ExportWizard and using command-line utility: dtexecui

  • 8/12/2019 0101_SQL Server 2005 Architecture

    30/36

    DTS Migration

    The tasks which have not been supported in SQL Server

    2005 are: Analysis Services Processing

    Copy SQL Server Object

    Data Driven Query

    Data Mining Prediction

    Dynamic Properties Execute Package task

    Transfer Databases

    Transfer Error Messages

    Transfer Jobs

    Transfer Master Stored Procedure

    Transfer Logins

    Transform Data Replaced by Data Flow Tasks and data flowcomponents

  • 8/12/2019 0101_SQL Server 2005 Architecture

    31/36

    SQL Server Agent

    Service is off by default Only sysadmins have access to SQL Server Agents bydefault

    Two new roles have been introduced to create and managejobs and schedules

    SQLAgentUserRole

    MaintenanceUserRole

    Components

    JobsSteps are divided into various subsystems for bettermanageability

    Alerts

    Operators

    ProxiesDefine the security context for the subsystems to runexcept T-SQL scripts

  • 8/12/2019 0101_SQL Server 2005 Architecture

    32/36

    SQL Profiler

    Better Replay feature

    Profiler uses an XML-based definition that allowsusers to easily capture events from different typesof servers and programming interfaces

    Correlate Performance Monitor counters with

    SQL Server or Analysis events Support for events like Deadlock in a graphical

    format

    Profiler supports and captures events pertaining to

    Analysis Services and DTS

  • 8/12/2019 0101_SQL Server 2005 Architecture

    33/36

    SQL Profiler

    Trace results can be saved in XML, ANSI,

    UNICODE and OEM formats

    Can choose an aggregate option and select a key

    for aggregation

    This allows viewing the column on which theaggregation was performed, along with a count for the

    number of rows that make up the aggregate value

  • 8/12/2019 0101_SQL Server 2005 Architecture

    34/36

    SQLiMail

    Uses SMTP to send mail. No Outlook or Extended

    MAPI needed

    Runs out-of-process from SQL Server forreliability

    Provides background and asynchronous deliveryfor scalability

    Multiple failover SMTP accounts, profiles andmail host database allowed

    Cluster and 64-bit compatibility

  • 8/12/2019 0101_SQL Server 2005 Architecture

    35/36

    SQLiMail

    Service is off by default

    Enforces security for user profiles

    Attachments size can be configured and

    only verified file extensions allowed to beattached

    Logs activity to SQL Server and

    performance monitors for monitoring

  • 8/12/2019 0101_SQL Server 2005 Architecture

    36/36

    Questions?