SQL ServerManagement2008Sandra Shinsandyshin@msn.com
1SQL Server vsFront End Applications
Front End (Client) 	Server SideAccessSQL ServerPowerful RDBMS
Features Interactive Forms to display and manipulate dataSupports ODBC connectivity
Has basic security features
Does not provide transactional functionality
Very basic backup functionality
Does not support multi-user operation
Works with 1 database at a time
Extremely powerful RDBMS
No client-usable Forms
Supports ODBC connectivity
Has robust, layered security features
Provides transactional functionality
Comprehensive backup functionality
Supports multi-user operation
Oversees multiple databases at a time2TransactionA unit of work containing several commands to access, manipulate, store and extract data from a database..
Transaction ACID RequirementsAAtomicity- The transaction must complete all of the commands in their entirety or none of them.CConsistency- The transaction cannot break the integrity rules of the databaseIIsolation- The transaction must be entirely self-contained, changes it makes must not be readable by any other transactionDDurability- The results of a committed transaction must persist even if there's a system failure
Types of TransactionsImplicit – an action code block  which runs completely when executed (SQL default) – cannot be rolled backensuring atomicityExplicit– code within a transaction block which contains code to CONTROL rollback and COMMITBEGIN TRANSACTIONT SQL commandsInsert SAVEPOINT, if needed, to mark a rollback stop pointEitherCOMMIT TRANSACTION 	 or ROLLBACK TRANSACTIONAtomicity is ensured by the requirement that all commands withingth code block be completed before thr changes are committed
3Server Architecture
SNIis a protocol layer that establishes network connection between the client and the server containing a set of APIs that are used by both the database engine and the SQL Server Native Client (SNAC) .SQL Server supports the following protocolsShared memory - the default protocol is to connect from a client running on the same computer as SQL Server. TCP/IP- the most common access protocol enables connection using an IP address and port number Named pipes - were developed for local area networks and can be inefficient across slower networks such WANsVIA  - Virtual Interface Adapter enables high-performance communication between two systems require specialized hardware at both ends and a dedicated connectionSQL Server network interface (SNI)
Protocol Layers Establish Connection Regardless of the protocol. Once a connection is established , SNI creates a secure connection to a  Tabular Data Stream (TDS) end point on the server which is used to send requests and receive data.
There is one TDS endpoint  for each protocol and one reserved for the use by the Dedicated Administrator Connection (DAC)Select Request - Protocol LayerThe SQL Server ‘s protocol layer Receives a TDS packet
Unwraps the package Reversing the SNI’s client packet preparation process)
Determines the request contents. 	When the requested READ is complete,Packages the results and status messages to send back to the client as TDS messagesTDS
SQL Server ComponentsRelational Engine (Query Processor) Primary function: to optimize queries and execution. Command ParserChecks query syntax and prepares query tree
Query Optimizer Determines the execution plan
Query Executor Runs the codeSQL Server ComponentsStorage engine Responsible for managing all I/O to the dataAccess MethodHandles I/O requests for rows, indexes, pages, allocations and row versionsBuffer Manager Deals with SQL’s main memory consumer, the Buffer PoolTransaction ManagerHandles locking of data to ensure ACID properties and manages the transactions law

Sql Server

  • 1.
  • 2.
    1SQL Server vsFrontEnd Applications
  • 3.
    Front End (Client) Server SideAccessSQL ServerPowerful RDBMS
  • 4.
    Features Interactive Formsto display and manipulate dataSupports ODBC connectivity
  • 5.
  • 6.
    Does not providetransactional functionality
  • 7.
    Very basic backupfunctionality
  • 8.
    Does not supportmulti-user operation
  • 9.
    Works with 1database at a time
  • 10.
  • 11.
  • 12.
  • 13.
    Has robust, layeredsecurity features
  • 14.
  • 15.
  • 16.
  • 17.
    Oversees multiple databasesat a time2TransactionA unit of work containing several commands to access, manipulate, store and extract data from a database..
  • 18.
    Transaction ACID RequirementsAAtomicity-The transaction must complete all of the commands in their entirety or none of them.CConsistency- The transaction cannot break the integrity rules of the databaseIIsolation- The transaction must be entirely self-contained, changes it makes must not be readable by any other transactionDDurability- The results of a committed transaction must persist even if there's a system failure
  • 19.
    Types of TransactionsImplicit– an action code block which runs completely when executed (SQL default) – cannot be rolled backensuring atomicityExplicit– code within a transaction block which contains code to CONTROL rollback and COMMITBEGIN TRANSACTIONT SQL commandsInsert SAVEPOINT, if needed, to mark a rollback stop pointEitherCOMMIT TRANSACTION or ROLLBACK TRANSACTIONAtomicity is ensured by the requirement that all commands withingth code block be completed before thr changes are committed
  • 20.
  • 22.
    SNIis a protocollayer that establishes network connection between the client and the server containing a set of APIs that are used by both the database engine and the SQL Server Native Client (SNAC) .SQL Server supports the following protocolsShared memory - the default protocol is to connect from a client running on the same computer as SQL Server. TCP/IP- the most common access protocol enables connection using an IP address and port number Named pipes - were developed for local area networks and can be inefficient across slower networks such WANsVIA - Virtual Interface Adapter enables high-performance communication between two systems require specialized hardware at both ends and a dedicated connectionSQL Server network interface (SNI)
  • 23.
    Protocol Layers EstablishConnection Regardless of the protocol. Once a connection is established , SNI creates a secure connection to a Tabular Data Stream (TDS) end point on the server which is used to send requests and receive data.
  • 24.
    There is oneTDS endpoint for each protocol and one reserved for the use by the Dedicated Administrator Connection (DAC)Select Request - Protocol LayerThe SQL Server ‘s protocol layer Receives a TDS packet
  • 25.
    Unwraps the packageReversing the SNI’s client packet preparation process)
  • 26.
    Determines the requestcontents. When the requested READ is complete,Packages the results and status messages to send back to the client as TDS messagesTDS
  • 27.
    SQL Server ComponentsRelationalEngine (Query Processor) Primary function: to optimize queries and execution. Command ParserChecks query syntax and prepares query tree
  • 28.
    Query Optimizer Determinesthe execution plan
  • 29.
    Query Executor Runsthe codeSQL Server ComponentsStorage engine Responsible for managing all I/O to the dataAccess MethodHandles I/O requests for rows, indexes, pages, allocations and row versionsBuffer Manager Deals with SQL’s main memory consumer, the Buffer PoolTransaction ManagerHandles locking of data to ensure ACID properties and manages the transactions law