Module 3: Managing Database Files. Overview Introduction to Data Structures Creating Databases Managing Databases Placing Database Files and Logs Optimizing.

Slides:



Advertisements
Similar presentations
5 Copyright © 2005, Oracle. All rights reserved. Managing Database Storage Structures.
Advertisements

Module 12: Auditing SQL Server Environments
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.
15 Copyright © 2004, Oracle. All rights reserved. Monitoring and Managing Memory.
Database Optimization & Maintenance Tim Richard ECM Training Conference#dbwestECM Agenda SQL Configuration OnBase DB Planning Backups Integrity.
SharePoint and SQL Server integration Demo: SQL Server Optimizing Configurations SQL Server 2014 for SharePoint 2013 Avoiding ginormous transaction.
Module 15: Managing Transactions and Locks. Overview Introduction to Transactions and Locks Managing Transactions SQL Server Locking Managing Locks.
Module 3: Creating and Managing Databases. Overview Creating Databases Creating Filegroups Managing Databases Introduction to Data Structures.
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
Microsoft SQL Server Administration for SAP SQL Server Architecture.
Implementing Disaster Protection
Proper Care and Feeding of your SQL MDB -Recommendations for General MDB Maintenance -Read the notes on the foils! -Revised October
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.
Working with SQL and PL/SQL/ Session 1 / 1 of 27 SQL Server Architecture.
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
Database Configuration and Maintenance Database Configuration and Maintenance Exam / 30.
Transaction log grows unexpectedly
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.
Overview What is SQL Server? Creating databases Administration Security Backup.
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.
Course 6425A Module 9: Implementing an Active Directory Domain Services Maintenance Plan Presentation: 55 minutes Lab: 75 minutes This module helps students.
Implementing Database Snapshot & Database Mirroring in SQL Server 2005 Presented by Tarek Ghazali IT Technical Specialist Microsoft SQL Server MVP Microsoft.
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 Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Chapter pages1 File Management Chapter 12.
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.
Managing Disks and Drives Chapter 13 powered by dj.
Module 16: Performing Ongoing Database Maintenance
Module 5: Upgrading to SQL Server 7.0. Overview Planning an Upgrade Preparing to Upgrade Verifying the Upgrade Setting a Compatibility Level.
1 Chapter Overview Performing Configuration Tasks Setting Up Additional Features Performing Maintenance Tasks.
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
SQL Server 2005 Implementation and Maintenance Chapter 12: Achieving High Availability Through Replication.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
1 Chapter Overview Understanding Data Restoration Issues Understanding the Types of Database Backups Understanding the Restoration Process.
Chapter 1Oracle9i DBA II: Backup/Recovery and Network Administration 1 Chapter 1 Backup and Recovery Overview MSCD642 Backup and Recovery.
Session 1 Module 1: Introduction to Data Integrity
MISSION CRITICAL COMPUTING Siebel Database Considerations.
Module 11: Managing Transactions and Locks
Backup and Recovery - II - Checkpoint - Transaction log – active portion - Database Recovery.
Data Disaster Recovery Planning Greg Fibiger 1/7/2016.
Oracle Architecture - Structure. Oracle Architecture - Structure The Oracle Server architecture 1. Structures are well-defined objects that store the.
Module 6: Administering Reporting Services. Overview Server Administration Performance and Reliability Monitoring Database Administration Security Administration.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
Module 14: Managing Transactions and Locks. Overview Introducing Transactions and Locks Managing Transactions Understanding SQL Server Locking Architecture.
Hands-On Microsoft Windows Server 2008 Chapter 7 Configuring and Managing Data Storage.
SQL Server 2012 Session: 1 Session: 6 Creating and Managing Databases Data Management Using Microsoft SQL Server.
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 Basics Review Reviewing what we’ve learned so far…….
14 Copyright © 2007, Oracle. All rights reserved. Backup and Recovery Concepts.
Indexing strategies and good physical designs for performance tuning Kenneth Ureña /SpanishPASSVC.
Managing Multi-User Databases
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
The Vocabulary of Performance Tuning
The Vocabulary of Performance Tuning
Performing Database Recovery
The Vocabulary of Performance Tuning
Backup & Recovery.
Presentation transcript:

Module 3: Managing Database Files

Overview Introduction to Data Structures Creating Databases Managing Databases Placing Database Files and Logs Optimizing a Database Using Hardware-based RAID Optimizing a Database Using Filegroups Optimizing the Database Using Filegroups with Hardware-based RAID Capacity Planning

 Introduction to Data Structures How Data Is Stored Transactions How the Transaction Log Works

How Data Is Stored Extent (8 contiguous 8-KB pages) Page (8 KB) Tables, Indexes Data Database Data (file).mdf or.ndf Log (file).ldf Maximum row size = 8060 bytes

Multimedia Presentation: Transactions

How the Transaction Log Works Data modification is sent by application Data modification is sent by application11 Disk Modification is recorded in transaction log on disk 33 Data pages are located in, or read into, buffer cache and modified Data pages are located in, or read into, buffer cache and modified 22 Buffer Cache Disk Checkpoint writes committed transactions to database Checkpoint writes committed transactions to database 44

 Creating Databases What Occurs During Database Creation Specifying Options During Database Creation Changing Database Options After Database Creation Viewing Database Properties

What Occurs During Database Creation Creates a Data File and a Transaction Log Requires That the Owner and Creator Have Permission to the master Database Allows You to Define: The name of the database The properties of the database The location of the database files

Specifying Options During Database Creation Primary File Secondary Files Transaction Log File Name and Location Size File Growth Maximum Size Collation

Changing Database Options After Database Creation Category of database options Auto Cursor Recovery SQL ControlsControls Certain automatic behaviors Cursor behavior and scope The recovery model for the database Control ANSI compliance options State Whether the database is online or offline Who can connect to the database Whether the database is in read-only mode Whether the database is online or offline Who can connect to the database Whether the database is in read-only mode

Viewing Database Properties Use SQL Server Enterprise Manager Use SQL Query Analyzer System functions System stored procedures ( sp_helpdb or sp_spaceused ) DBCC statements (DBCC SQLPERF (LOGSPACE))

 Managing Databases Managing Data and Log File Growth Shrinking a Database or Database File Automatically Shrinking a Database or Database File Manually Deleting a Database

Managing Data and Log File Growth Using Automatic File Growth Specify space allocated, maximum size, and growth increment of each file Optimize performance by allocating sufficient space, setting maximum size, and setting growth increments Manually Expanding Data and Transaction Log Files Determining Whether to Expand Files Automatically or Manually Creating Secondary Data and Transaction Log Files

Shrinking a Database or Database File Automatically Enabling Shrinking to Occur Automatically Specifying the autoshrink option in SQL Server Enterprise Manager Executing the ALTER DATABASE AUTO_SHRINK statement Executing the sp_dboption system stored procedure SQL Server Activities During Auto Shrink Shrinks data and transaction log files when more than 25 percent of the file contains unused space Performs shrinking in the background and does not affect user activity

Shrinking a Database or Database File Manually Methods of Shrinking Shrinking a Database and Data Files Shrinking Transaction Log Files Shrinks inactive portions of the transaction log that are larger than the desired size If that is not enough to reduce to the desired size, SQL Server returns a message and notifies you what to perform Configuring Shrink Database Options

Deleting a Database Methods of Deleting a Database Restrictions on Deleting a Database While it is being restored When a user is connected to it When publishing as part of replication A system database

Placing Database Files and Logs Managing Disk Storage Performance Fault tolerance Spreading Data Files Creating Transaction Logs on Separate Disks Placing the tempdb Database

Optimizing a Database Using Hardware-based RAID Using Hardware-based RAID Offers better performance than operating system-based RAID Enables you to replace failed drive without shutting down the system Applying Types of RAID Disk mirroring or disk duplexing (RAID 1) for redundancy for the transaction log Disk striping with parity for performance and redundancy for data files and transaction logs Disk mirroring with striping for maximum performance for data files

 Optimizing a Database Using Filegroups Introduction to User-defined Filegroups Creating User-defined Filegroups Using Filegroups for Performance Using Filegroups for Maintenance Considerations When Creating Filegroups

Introduction to User-defined Filegroups Northwnd.ldf E:\ User-defined FilegroupPrimary FilegroupTransaction Log OrdHist1.ndf OrdHist2.ndf D:\ Northwnd.mdf C:\ sys…sys… sys…sys… sysuserssysusers sysobjectssysobjects …… OrdersOrders CustomersCustomers ProductsProducts OrdHistYear2OrdHistYear2 OrdHistYear1OrdHistYear1 Northwind Database

Creating User-defined Filegroups Methods of Creating User-defined Filegroups Choosing a Default Filegroup SQL Server designates one filegroup as the default filegroup Default filegroup is set to primary filegroup Change the primary default filegroup if you create user-defined filegroups Sizing the Primary Default Filegroup Viewing Filegroup Information

Using Filegroups for Performance Balancing Data Load Across Multiple Disks Using Parallel Threads to Improve Data Access One File in One Filegroup One File in One Filegroup File Map Salesdata.mdf Two Files in One Filegroup Two Files in One Filegroup Salesdata.mdf Salesdata1.ndf File Map

Using Filegroups for Maintenance Back Up or Restore Files or Filegroups Rather Than an Entire Database Group Tables and Indexes with Similar Maintenance Requirements into Same Filegroups Assign an Individual High-Maintenance Table to Its Own Filegroup

Considerations When Creating Filegroups Monitor System Performance Use Maintenance Requirements Rather Than Performance Considerations Specify a User-defined Filegroup as the Default Be Aware That Filegroups Do Not Provide Fault Tolerance

Optimizing the Database Using Filegroups with Hardware-based RAID DiskControllerDiskController Filegroup DiskControllerDiskController FileE FileF FileG FileH FileA FileB FileC FileD Transaction Log DiskControllerDiskController Operating System DiskControllerDiskController

 Capacity Planning Estimating the Size of a Database Estimating the Amount of Data in Tables

Estimating the Size of a Database Log (file) Activity Frequency Transaction Size Back Up Data (file) Tables # of Rows User and System Indexes Key Value # of Rows Fill Factor

Estimating the Amount of Data in Tables Calculate Number of Bytes in a Row Total the bytes in the row Average variable-length columns Determine Number of Rows in a Data Page Divide 8060 by the total bytes in the row Round down to the next whole number Divide Number of Rows in the Table by Number of Rows in a Data Page

Performance Considerations Use RAID to Improve Performance or Fault Tolerance Place Data Files and Transaction Logs on Separate Physical Disks Use User-defined Filegroups to Simplify Backup Strategies of Very Large Databases

Change the Default Filegroup Back Up the master Database Specify a Maximum File Size Make Initial Database File Size and Autogrow Increments Large Use Disk Mirroring, Disk Striping with Parity or Disk Mirroring with Striping Create One File for Each Physical Disk Recommended Practices

Lab A: Managing Database Files

Review Introduction to Data Structures Creating Databases Managing Databases Placing Database Files and Logs Optimizing a Database Using Hardware-based RAID Optimizing a Database Using Filegroups Optimizing the Database Using Filegroups with Hardware-based RAID Capacity Planning