Database Configuration and Maintenance Database Configuration and Maintenance Exam 70-432 1 / 30.

Slides:



Advertisements
Similar presentations
Maintaining and Automating SQL Server
Advertisements

Oracle Architecture. Instances and Databases (1/2)
Module 4 Working with Databases. Module Overview Overview of SQL Server Databases Working with Files and Filegroups Moving Database Files.
FlareCo Ltd ALTER DATABASE AdventureWorks SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS Slide 1.
SharePoint and SQL Server integration Demo: SQL Server Optimizing Configurations SQL Server 2014 for SharePoint 2013 Avoiding ginormous transaction.
A Guide to SQL, Seventh Edition. Objectives Create a new table from an existing table Change data using the UPDATE command Add new data using the INSERT.
Introduction to Structured Query Language (SQL)
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
Introduction to Structured Query Language (SQL)
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Module 7: Restoring Databases. Overview SQL Server Recovery Process Preparing to Restore a Database Restoring Backups Restoring Databases from Different.
Module 6: Backing Up Databases. Overview Preventing Data Loss Setting and Changing a Database Recovery Model SQL Server Backup When to Back Up Databases.
Module 5 Understanding SQL Server 2008 R2 Recovery Models.
Backup and Recovery Part 1.
Working with SQL and PL/SQL/ Session 1 / 1 of 27 SQL Server Architecture.
Optimizing SQL Server 2012 for SharePoint 2013 SharePoint Saturday/Friday, Honolulu March 27, 2015.
Session 7 Creating and Managing Databases. RDBMS and Data Management/ Session 7/2 of 27 Session Objectives Describe the system and user-defined databases.
Chapter 2 Administrating DB Engine. Database Engine  The Database Engine is the core service for storing, processing, and securing data.  It provides.
Transactions and Locks Lesson 22. Skills Matrix Transaction A transaction is a series of steps that perform a logical unit of work. Transactions must.
Building Highly Available Systems with SQL Server™ 2005 Vineet Gupta Evangelist – Data and Integration Microsoft Corp.
SQL Server 2008 Implementation and Maintenance Chapter 7: Performing Backups and Restores.
1 Chapter Overview Creating a User Database Setting Database Options Managing User Database Size Placing Database Files on Multiple Disks.
Chapter 4 SQL. SQL server Microsoft SQL Server is a client/server database management system. Microsoft SQL Server is a client/server database management.
Chapter 2: Designing Physical Storage MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design Study Guide (70-443)
Chapter 11: Designing a Data Recovery Solution for a Database MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design Study.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Module 3: Managing Database Files. Overview Introduction to Data Structures Creating Databases Managing Databases Placing Database Files and Logs Optimizing.
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
CSE 781 – DATABASE MANAGEMENT SYSTEMS Introduction To Oracle 10g Rajika Tandon.
Agenda for Today Chapter 5 –Skip Lesson 2 Review questions Midterm Chapter 6 Review questions.
Databases Lesson 5.
Architecture Rajesh. Components of Database Engine.
Rajib Kundu Agenda Definitions Failover Cluster Database Snapshots Log shipping Database Mirroring.
Module 6 Backup of SQL Server 2008 R2 Databases. Module Overview Backing up Databases and Transaction Logs Managing Database Backups Working with Backup.
Managing Disks and Drives Chapter 13 powered by dj.
Discovering Computers Fundamentals Fifth Edition Chapter 9 Database Management.
Module 16: Performing Ongoing Database Maintenance
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
1 Chapter Overview Preparing to Upgrade Performing a Version Upgrade from Microsoft SQL Server 7.0 Performing an Online Database Upgrade from SQL Server.
11/7/2012ISC329 Isabelle Bichindaritz1 Transaction Management & Concurrency Control.
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
Transactions and Locks A Quick Reference and Summary BIT 275.
7 Copyright © 2005, Oracle. All rights reserved. Managing Undo Data.
Week 7 : Chapter 7 Agenda SQL 710 Maintenance Plan:
Database structure and space Management. Segments The level of logical database storage above an extent is called a segment. A segment is a set of extents.
1 Chapter Overview Defining Operators Creating Jobs Configuring Alerts Creating a Database Maintenance Plan Creating Multiserver Jobs.
Session 1 Module 1: Introduction to Data Integrity
A Guide to SQL, Eighth Edition Chapter Six Updating Data.
Backup and Recovery - II - Checkpoint - Transaction log – active portion - Database Recovery.
Data Disaster Recovery Planning Greg Fibiger 1/7/2016.
A Guide to MySQL 6. 2 Objectives Create a new table from an existing table Change data using the UPDATE command Add new data using the INSERT command.
Hands-On Microsoft Windows Server 2008 Chapter 7 Configuring and Managing Data Storage.
Praveen Srivatsa Director| AstrhaSoft Consulting blogs.asthrasoft.com/praveens |
SQL SERVER MAINTENANCE PLANS Kat
Agenda for Today  DATABASE Definition What is DBMS? Types Of Database Most Popular Primary Database  SQL Definition What is SQL Server? Versions Of SQL.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
SQL Database Management
Database Recovery Techniques
Database Administration
Inside transaction logging
Database structure and space Management
A Technical Overview of Microsoft® SQL Server™ 2005 High Availability Beta 2 Matthew Stephen IT Pro Evangelist (SQL Server)
Designing Database Solutions for SQL Server
Chapter Overview Understanding the Database Architecture
Inside transaction logging
Chapter 10 Transaction Management and Concurrency Control
Chapter 11 Managing Databases with SQL Server 2000
A Beginners Guide to Transactions
Backup & Recovery.
Ch 10. Maintaining and Automating SQL Server
Presentation transcript:

Database Configuration and Maintenance Database Configuration and Maintenance Exam / 30

Database Configuration and Maintenance Configuring Files and Filegroups SQL Server uses two different types of files— data and transaction log files. Filegroups are a logical structure, defined within a database, that map a database and the objects contained within a database, to the data files on disk. Filegroups can contain more than one data file. The proportional fill algorithm is designed to allow a resize operation to occur at a filegroup level. In other words, all files within a filegroup expand at the same time. 2 / 30 Confi guring Files and Filegroups Confi guring Database Options Maintainig Database Integrity

Database Configuration and Maintenance File Extensions (just naming convention) :.mdf - primary filegroup,.ndf - all other data files,.ldf - transaction logs 3 / 30 Confi guring Files and Filegroups Confi guring Database Options Maintainig Database Integrity

Database Configuration and Maintenance You should have a file with an.mdf extension within a filegroup named PRIMARY, a file with an.ndf extension in a filegroup with any name that you choose, and the transaction log with an.ldf extension. Besides being the logical definition for one or more files that defines the storage boundary for an object, filegroups have a property called DEFAULT. ALTER DATABASE MODIFY FILEGROUP DEFAULT Following the initial creation of the database, you add filegroups as needed to separate the storage of objects within the database. You also add files to filegroups to increase the disk I/O available to the objects stored on the filegroup, thereby reducing disk bottlenecks. 4 / 30 Confi guring Files and Filegroups Confi guring Database Options Maintainig Database Integrity

Database Configuration and Maintenance Transaction Logs all changes are written to the transaction log prior to a commit being issued. In addition, the writes to the transaction log must occur directly to disk. SQL Server writes sequentially to the transaction log data files underneath a database are isolating the transaction log to a dedicated set of disks 5 / 30 Confi guring Files and Filegroups Confi guring Database Options Maintainig Database Integrity

Database Configuration and Maintenance 6 / 30 Confi guring Files and Filegroups

Database Configuration and Maintenance FILESTREAM data The files are stored in a folder on the operating system, but are linked directly into a database where the files can be backed up, restored, full-text-indexed, and combined with other structured data You define the location for FILESTREAM data in a database by designating a filegroup within the database to be used for storage with the CONTAINS FILESTREAM property. The FILENAME property defined for a FILESTREAM filegroup specifies the path to a folder. 7 / 30 Confi guring Files and Filegroups Confi guring Database Options Maintainig Database Integrity

Database Configuration and Maintenance tempdb Database SQL Server uses tempdb for worktables used in grouping/sorting operations, worktables to support cursors, the version store supporting snapshot isolation level, and overfl ow for table variables. You can also cause index build operations to use space in tempdb. 8 / 30 Confi guring Files and Filegroups Confi guring Database Options Maintainig Database Integrity

Database Configuration and Maintenance Lesson Summary You can define one or more data and log fi les for the physical storage of a database. Data fi les are associated to a fi legroup within a database. Filegroups provide the logical storage container for objects within a database. Files can be stored using the new FILESTREAM capabilities. 9 / 30 Confi guring Files and Filegroups Confi guring Database Options Maintainig Database Integrity

Database Configuration and Maintenance 10 / 30

Database Configuration and Maintenance 11 / 20

Database Configuration and Maintenance Confi guring Database Options The recovery models available in SQL Server 2008 are: Full Bulk-logged Simple BEST PRACTICES RECOVERY MODELS Every production database that accepts transactions should be set to the Full recovery model. By placing the database in the Full recovery model, you can maximize the restore options that are possible. 12 / 30 Confi guring Database Options Maintainig Database Integrity Confi guring Files and Filegroups

Database Configuration and Maintenance THE BULK-LOGGED RECOVERY MODEL BCP BULK INSERT SELECT...INTO CREATE INDEX ALTER INDEX...REBUILD Bulk-logged recovery model does not log every change to the transaction log, you cannot recover a database to a point in time 13 / 30 Confi guring Database Options Maintainig Database Integrity Confi guring Files and Filegroups

Database Configuration and Maintenance THE SIMPLE RECOVERY MODEL exactly as the Full recovery model But Simple recovery model cannot be recovered to a point in time. Each time the database checkpoint process executes, the committed portion of the transaction log is discarded. 14 / 30 Confi guring Database Options Maintainig Database Integrity Confi guring Files and Filegroups

Database Configuration and Maintenance ALTER DATABASE database_name SET RECOVERY { FULL | BULK_LOGGED | SIMPLE } 15 / 30 Confi guring Database Options Maintainig Database Integrity Confi guring Files and Filegroups

Database Configuration and Maintenance Damaged Pages The PAGE_VERIFY CHECKSUM option can be enabled, which allows you to discover and log damaged pages 16 / 30 Confi guring Database Options Maintainig Database Integrity Confi guring Files and Filegroups

Database Configuration and Maintenance Auto Options AUTO_CLOSE AUTO_SHRINK AUTO_CREATE_STATISTICS AUTO_UPDATE_STATISTICS AUTO_UPDATE_STATISTICS_ASYNCH 17 / 30 Confi guring Database Options Maintainig Database Integrity Confi guring Files and Filegroups

Database Configuration and Maintenance Change Tracking To prevent the changes of multiple users from overriding each other, each row in a table that has been enabled for change tracking 18 / 20 Confi guring Database Options Maintainig Database Integrity Confi guring Files and Filegroups

Database Configuration and Maintenance Access Access to a database can be controlled through several options The status of a database: ONLINE, OFFLINE, or EMERGENCY (db_owner role) READ_ONLY or READ_WRITE SINGLE_USER, RESTRICTED_USER(db_owner, dbcreator, and sysadmin roles), and MULTI_USER ROLLBACK, ROLLBACK IMMEDIATE, ROLLBACK AFTER 19 / 20 Confi guring Database Options Maintainig Database Integrity Confi guring Files and Filegroups

Database Configuration and Maintenance Collation Sequences SQL Server has the capability to store character data that spans every possible written language The collation sequence for an instance can be overridden at a database level by specifying the COLLATE clause in either the CREATE DATABASE or ALTER DATABASE command. 20 / 30 Confi guring Database Options Maintainig Database Integrity Confi guring Files and Filegroups

Database Configuration and Maintenance Lesson Summary You can set the recovery model for a database to Full, Bulk-logged, or Simple. You can back up transaction logs for a database in the Full or Bulk-logged recovery model. The AUTO_SHRINK option shrinks a database fi le when there is more than 25 percent of free space in the fi le. You can track and log damaged pages by enabling the PAGE_VERIFY CHECKSUM option. 21 / 30 Confi guring Database Options Maintainig Database Integrity Confi guring Files and Filegroups

Database Configuration and Maintenance 22 / 30

Database Configuration and Maintenance 23 / 30

Database Configuration and Maintenance Maintaining Database Integrity Database Integrity Checks PAGE_VERIFY. The page verifi cation can be set to either TORN_PAGE_DETECTION or CHECKSUM. The PAGE_VERIFY TORN_PAGE_DETECTION option exists for backwards compatibility and should not be used BEST PRACTICES PAGE VERIFICATION You should enable the PAGE_VERIFY CHECKSUM option on every production database 24 / 30 Maintainig Database Integrity Confi guring Database Options Confi guring Files and Filegroups

Database Configuration and Maintenance When DBCC CHECKDB is executed, SQL Server performs all the following actions: Checks page allocation within the database Checks the structural integrity of all tables and indexed views Calculates a checksum for every data and index page to compare against the stored checksum Validates the contents of every indexed view Checks the database catalog Validates Service Broker data within the database 25 / 30 Maintainig Database Integrity Confi guring Database Options Confi guring Files and Filegroups

Database Configuration and Maintenance To accomplish these checks, DBCC CHECKDB executes the following commands: DBCC CHECKALLOC, to check the page allocation of the database DBCC CHECKCATALOG, to check the database catalog DBCC CHECKTABLE, for each table and view in the database to check the structural integrity 26 / 30 Maintainig Database Integrity Confi guring Database Options Confi guring Files and Filegroups

Database Configuration and Maintenance Lesson Summary The PAGE_VERIFY CHECKSUM option should be enabled for every production database to detect any structural integrity errors. When a corrupt page is encountered, the page is logged to the suspect_pages table in the msdb database. If a database is participating in a Database Mirroring session, SQL Server automatically retrieves a copy of the page from the mirror, replaces the page on the principal, and logs an entry in the sys.dm_db_mirroring_auto_page_repair view. DBCC CHECKDB is used to check the logical and physical consistency of a database. 27 / 30 Maintainig Database Integrity Confi guring Database Options Confi guring Files and Filegroups

Database Configuration and Maintenance 28 / 30

Database Configuration and Maintenance 29 / 30

Database Configuration and Maintenance Dziękuję za uwagę Tomasz Gacek 30 / 30