Logo

Navigation
  • Home
  • Services
    • ERP Solutions
    • Implementation Solutions
    • Support and Maintenance Solutions
    • Custom Solutions
    • Upgrade Solutions
    • Training and Mentoring
    • Web Solutions
    • Production Support
    • Architecture Designing
    • Independent Validation and Testing Services
    • Infrastructure Management
  • Expertise
    • Microsoft Development Expertise
    • Mobile Development
    • SQL Server Database and BI
    • SAP BI, SAP Hana, SAP BO
    • Oracle and BI
    • Oracle RAC
  • Technical Training
    • Learn Data Management
      • Business Intelligence
      • Data Mining
      • Data Modeling
      • Data Warehousing
      • Disaster Recovery
    • Learn Concepts
      • Application Development
      • Client Server
      • Cloud Computing Tutorials
      • Cluster Computing
      • CRM Tutorial
      • EDI Tutorials
      • ERP Tutorials
      • NLP
      • OOPS
      • Concepts
      • SOA Tutorial
      • Supply Chain
      • Technology Trends
      • UML
      • Virtualization
      • Web 2.0
    • Learn Java
      • JavaScript Tutorial
      • JSP Tutorials
      • J2EE
    • Learn Microsoft
      • MSAS
      • ASP.NET
      • ASP.NET 2.0
      • C Sharp
      • MS Project Training
      • Silverlight
      • SQL Server 2005
      • VB.NET 2005
    • Learn Networking
      • Networking
      • Wireless
    • Learn Oracle
      • Oracle 10g
      • PL/SQL
      • Oracle 11g Tutorials
      • Oracle 9i
      • Oracle Apps
    • Learn Programming
      • Ajax Tutorial
      • C Language
      • C++ Tutorials
      • CSS Tutorial
      • CSS3 Tutorial
      • JavaScript Tutorial
      • jQuery Tutorial
      • MainFrame
      • PHP Tutorial
      • VBScript Tutorial
      • XML Tutorial
    • Learn Software Testing
      • Software Testing Types
      • SQA
      • Testing
  • Career Training
    • Career Improvement
      • Career Articles
      • Certification Articles
      • Conflict Management
      • Core Skills
      • Decision Making
      • Entrepreneurship
      • Goal Setting
      • Life Skills
      • Performance Development
      • Personal Excellence
      • Personality Development
      • Problem Solving
      • Relationship Management
      • Self Confidence
      • Self Supervision
      • Social Networking
      • Strategic Planning
      • Time Management
    • Education Help
      • Career Tracks
      • Essay Writing
      • Internship Tips
      • Online Education
      • Scholarships
      • Student Loans
    • Managerial Skills
      • Business Communication
      • Business Networking
      • Facilitator Skills
      • Managing Change
      • Marketing Management
      • Meeting Management
      • Process Management
      • Project Management
      • Project Management Life Cycle
      • Project Management Process
      • Project Risk Management
      • Relationship Management
      • Task Management
      • Team Building
      • Virtual Team Management
    • Essential Life Skills
      • Anger Management
      • Anxiety Management
      • Attitude Development
      • Coaching and Mentoring
      • Emotional Intelligence
      • Stress Management
      • Positive Thinking
    • Communication Skills
      • Conversation Skills
      • Cross Culture Competence
      • English Vocabulary
      • Listening Skills
      • Public Speaking Skills
      • Questioning Skills
    • Soft Skills
      • Assertive Skills
      • Influence Skills
      • Leadership Skills
      • Memory Skills
      • People Skills
      • Presentation Skills
    • Finding a Job
      • Etiquette Tips
      • Group Discussions
      • HR Interviews
      • Interview Notes
      • Job Search Tips
      • Resume Tips
      • Sample Resumes
 

SQL Server 2005 – Using Database Snapshots

By Exforsys | on December 26, 2005 |
SQL Server 2005

SQL Server 2005 – Using Database Snapshots

In this tutorial you will learn about Using Database Snapshots in SQL Server 2005, Effect of the Update Pattern on Database Snapshot Growth, Metadata About Database Snapshots, Limitations on the Source Database, Limitations on Database Snapshots, Database Snapshots with Offline Filegroups and Best Practices for Creating Database Snapshots.

Snapshots are read only static views of the database. This is a new feature introduced into SQL Server 2005 Enterprise edition to enable DBAs report on the database or revert to the source database if required so that data loss is confined to the point at which the snapshot was created. A database snapshot can exist in the same server as the database and each snapshot is transactionally consistent with the source database at the point of its creation. When a snapshot is created, the source database is likely to have some transactions which are open and as yet uncommitted. These transactions are rolled back in the snapshot to make it transactionally consistent.

The snapshot also persists till it is specifically dropped by the DBA. The database snapshot is not related to snapshot backups, snapshot isolation of transactions or snapshot replication.

Snapshots operate at a data-page level and the original page is copied from the source database using the copy-on-write operation. Updates to the database subsequently made do not modify the snapshot. These pages are stored in sparse files (an NTFS feature) which are empty files that contain no user data and do not have disk space for user data allocated to it as yet. However, sparse files can grow in size and occupy disk space as the snapshots get stored into it.

Effect of the Update Pattern on Database Snapshot Growth

Enterprises which have large databases should replace the old snapshot with a new snapshot at regular predetermined intervals. The ideal interval will have to be decided by the DBA on the basis of the growth rate of the snapshot and the disk space available in the sparse file. If the disk drive fills up the write operations to all snapshots will fail. Therefore, the DBA should study the typical update patterns for the database and plan the amount of space required and also plan for the lifespan of the snapshot.

Metadata About Database Snapshots

The metadata relating to database snapshots is stored in the sys.databases catalog view. The snapshot does not expose metadata on its own, but exposes the metadata from the source database. The syntax for viewing the metadata is as under:

USE < database_snapshot > SELECT * FROM sys.database_files

However, when the source database uses full text search or database mirroring, it disables itself in a snapshot and alters some values in the snapshot’s database.

Limitations on the Source Database

The source database cannot be dropped, detached or restored so long as the database snapshot exists. Database performance also is drastically reduced due to I/O operations to the snapshot every time a page is updated.

Limitations on Database Snapshots

A database snapshot must be created on the same server as the source database. The snapshot captures the data at a point in time and does not commit any uncommitted transactions that may be in the pipeline at that time. If a page being updated on the source database is pushed to a snapshot, the snapshot runs out of disk space, the snapshot is likely to be corrupted and hence to be deleted. The other limitations of a snapshot are:

  1. Snapshots are read only
  2. Snapshots of model, master and temp databases cannot be made
  3. Specifications of the database snapshots cannot be changed
  4. Files cannot be dropped from a snapshot.
  5. Snapshots cannot be backed up or restored.
  6. Snapshots cannot be attached or detached.
  7. Snapshots of FAT32 file system or RAW partitions cannot be created.
  8. Snapshots do not support full text indexing
  9. The snapshot inherits the security constraints of the source database at the point of its creation.
  10. The state of filegroups at the point of creation alone is reflected in the snapshot.
  11. When the source database becomes RECOVERY_PENDING, the database snapshots become inaccessible till the source is recovered.
  12. Read only filegroups and compressed file groups do not support reverting.
  13. Disk Space Requirements

Snapshots are space efficient as it requires only space for storage of pages that change during its lifetime. Since they are also kept only for a limited period of time size is not a major problem. It must be remembered that if a database snapshot runs out of disk space, the snapshot will have to be deleted.

Database Snapshots with Offline Filegroups

Snapshots are affected by offline filegroups in the source database when an attempt is made to create a snapshot. Though the snapshot is created Sparse files are not created for offline filegroups. The existing database snapshot is not impacted even when an online filegroup is brought online. A filegroup remains online in database snapshots (even if taken offline) if it was online at the time of creation. However, queries using the snapshot are likely to fail if it was taken offline. The reverting of the source database to the snapshot requires that all the filegroups which were online at the time of creation are online.

Best Practices for Creating Database Snapshots

1. Naming Database Snapshots should be well designed and thought of. The name of the snapshot must incorporate information identifying the source database, the creation date and time and sequence number or such other information as would be useful to the administrator.

2. Limiting the Number of Database Snapshots is advisable, as snapshots persist till they are specifically dropped.

3. Client Connections to a Database Snapshot must be able to locate the snapshot. Users can connect to the snapshot using the SQL server Management Studio or though a programmatic solution that directs report writing clients to the latest snapshot.

« « SQL Server 2005 – Disaster Recovery
Effective Software Testing » »

Author Description

Avatar

Editorial Team at Exforsys is a team of IT Consulting and Training team led by Chandra Vennapoosa.

Free Training

RSSSubscribe 394 Followers
  • Popular
  • Recent
  • SQL Server Architecture and Components

    September 13, 2005 - 0 Comment
  • SQL Server 2005 – Using the Sqlcmd Utility

    December 18, 2005 - 0 Comment
  • Developing Client applications in SQL Server 2005

    November 1, 2005 - 0 Comment
  • SQL Server 2005 – Disaster Recovery

    December 26, 2005 - 0 Comment
  • SQL Server 2005 Installation – Maintenance Plan Without Using Wizard

    December 2, 2005 - 0 Comment
  • Security Features in SQL Server 2005 for the Developer

    October 15, 2005 - 0 Comment
  • SQL Server 2005 Configuration Manager

    December 18, 2005 - 0 Comment
  • SQL Server 2005 Administrative Tools

    November 19, 2005 - 0 Comment
  • SQL Server 2005 – Backing up a Database

    January 1, 2006 - 0 Comment
  • SQL Server 2005 – Unattended Installations

    December 7, 2005 - 0 Comment
  • SQL Server 2005 – Configuring Replication

    January 11, 2006 - 0 Comment
  • SQL Server 2005 Replication Enhancements

    January 11, 2006 - 0 Comment
  • SQL Server 2005 – Mirror Server

    January 11, 2006 - 0 Comment
  • SQL Server 2005 – Introduction to Data Availability

    January 1, 2006 - 0 Comment
  • SQL Server 2005 – Backing up a Database

    January 1, 2006 - 0 Comment
  • SQL Server 2005 – Disaster Recovery

    December 26, 2005 - 0 Comment
  • SQL Server 2005 – Managing Certificates

    December 26, 2005 - 0 Comment
  • SQL Server 2005 – Managing Permissions

    December 26, 2005 - 0 Comment
  • Managing SQL Server 2005 Security

    December 24, 2005 - 0 Comment
  • SQL Server 2005 – Using the Database Tuning Advisor

    December 24, 2005 - 0 Comment

Exforsys e-Newsletter

ebook
 

Related Articles

  • SQL Server 2005 – Configuring Replication
  • SQL Server 2005 Replication Enhancements
  • SQL Server 2005 – Mirror Server
  • SQL Server 2005 – Introduction to Data Availability
  • SQL Server 2005 – Backing up a Database

Latest Articles

  • Project Management Techniques
  • Product Development Best Practices
  • Importance of Quality Data Management
  • How to Maximize Quality Assurance
  • Utilizing Effective Quality Assurance Strategies
  • Sitemap
  • Privacy Policy
  • DMCA
  • Trademark Information
  • Contact Us
© 2023. All Rights Reserved.IT Training and Consulting
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptReject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT