Home > SQL Server Tips > Database Management and Administration
SQL Server Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

DATABASE MANAGEMENT AND ADMINISTRATION

Test for hardware problems with PHYSICAL_ONLY


Serdar Yegulalp, Contributor
09.06.2005
Rating: -4.20- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


The DBCC CHECKDB command acquired a new option in SQL Server 2000: PHYSICAL_ONLY. This option allows DBCC CHECKDB to perform a limited series of tests to determine whether or not the database has suffered damage that occurs when there's a physical problem with the database. Such problems may include disk errors, controller issues or other hardware-based problems that usually result in data loss, but may not show up immediately.

The syntax is simple enough:

USE
DBCC CHECKDB WITH PHYSICAL_ONLY

A successful run without errors will look like this:

DBCC results for ''.
CHECKDB found 0 allocation errors and 0 consistency errors in database ''.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

PHYSICAL_ONLY is designed to run with as little overhead as possible, so it only checks the physical integrity of pages, as well as indexes and allocation structures. For that reason, PHYSICAL_ONLY is a good, fast way to look for torn pages, usually the most obvious sign of a hardware problem. Subtler damage, such as the logical consistency of the database's internal structures, won't be covered by this option -- but major damage caused by hardware issues gives you something much bigger to worry about!

PHYSICAL_ONLY cannot be run with any repair options, such as REPAIR_REBUILD or REPAIR_ALLOW_DATA_LOSS. If a scan with PHYSICAL_ONLY uncovers problems, you probably can't repair them on a software level. To do so might risk further damaging available data. The best plan to prevent data integrity loss is to regularly back up to another medium; running a lossy repair against a database should only be a last resort.

If you don't have a current backup, another option to consider when faced with data loss is to run DBCC CHECKTABLE with REPAIR_ALLOW_DATA_LOSS, then make a parallel restoration of the database (restore the database from its most recent backup under a different, separate name) and selectively copy over any data that changed since the last backup to the "good" copy. This allows you to work from a known good copy and preserve whatever changes were made since the last backup.

About the author: Serdar Yegulalp is editor of the Windows Power Users Newsletter. Check it out for the latest advice and musings on the world of Windows network administrators -- and please share your thoughts as well!


More information from SearchSQLServer.com

  • Step-by-Step Guide: Ensuring data integrity in SQL Server
  • Tip: Enforcing referential integrity through triggers
  • Tip: Presevering Unicode data integrity


  • Rate this Tip
    To rate tips, you must be a member of SearchSQLServer.com.
    Register now to start rating these tips. Log in if you are already a member.




    Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



    RELATED CONTENT
    Microsoft SQL Server Performance Monitoring and Tuning
    Using traces in SQL Server Profiler
    SQL Server Mailbag: CALs, witnesses and unwanted changes
    SQL Server Mailbag: Data restoration and DB property management
    Working with IntelliSense in SQL Server 2008 Management Studio
    SQL Server Mailbag: Stored procedures, triggers and SSRS reports
    Troubleshooting Distributed Transaction Coordinator errors in SQL Server
    Clearing the Windows page file and its effect on server performance
    Optimizing SQL Server indexes –- even when they're not your indexes
    Performance implications of transaction log autogrowth in SQL Server
    The short course on how SQL Server really works

    Microsoft SQL Server 2000
    Track changes to SQL Server 2000 and 2005 with one simple utility
    Is it possible to find disabled indexes in SQL Server 2000?
    FAQ: Creating and altering SQL Server tables
    FAQ: SQL Server comparison features
    SQL Server DBMS' growing popularity is no coincidence
    What is a SQL Server instance?
    Strange error when installing SQL Server 2000 Developer Edition
    Working with multiple versions of SQL Server
    Setting up automatic switchover between SQL Server instances
    How to get started learning about SQL Server
    Microsoft SQL Server 2000 Research

    Database Management and Administration
    Password cracking tools for SQL Server
    Using traces in SQL Server Profiler
    Meet compliance requirements with improved database security practices
    Hardening the network and OS for SQL Server security
    Securing the server and database in SQL Server
    How SQL Server 2008 components impact SharePoint implementations
    Troubleshooting Distributed Transaction Coordinator errors in SQL Server
    Achieving high availability and disaster recovery with SharePoint databases
    Clearing the Windows page file and its effect on server performance
    Deploying a SQL Server virtual appliance for Microsoft Hyper-V

    RELATED GLOSSARY TERMS
    Terms from Whatis.com − the technology online dictionary
    contiguity  (SearchSQLServer.com)
    contiguous  (SearchSQLServer.com)
    drilldown  (SearchSQLServer.com)
    hashing  (SearchSQLServer.com)
    hybrid online analytical processing  (SearchSQLServer.com)

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary

    DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



    SQL Server Development - .NET, C#, T-SQL, Visual Basic
    HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




    All Rights Reserved, Copyright 2005 - 2009, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts