Đăng ký vps giá rẻ, tên miềndomain. Việc kiểm tra và mua tên miền giá rẻ, domain giá rẻ, hosting giá rẻ, máy chủ ảo giá rẻserver giá rẻ chỉ với 2 bước đơn giản. Giúp bạn tiên phong trong kinh doanh Online

SQL Server
 9ecva.com - 9e Chu Van An Forever : SQL Server
Tiêu đề Chủ đề: Cách sửa lỗi repair database SQL Server 2005 Trả lời bài viếtGửi bài viết mới
Tác giả
Nội dung << Chủ đề trước | Chủ đề kế tiếp >>
DUCVINH83
Administrator
Administrator
Avatar
Không ngừng học hỏi !

Ngày gia nhập: 01/11/2005
Giới tính:
Đến từ: Vietnam
Trạng thái:
Bài viết: 365
Tiền: 738$
Địa chỉ e-mail: Gửi mail
Yahoo! IM: Yahoo! IM
Sinh nhật: 17/02/1983
Cảnh cáo: (0%)
Minus 1 warningCurrent warnlevel: 0%Add 1 warning
Ngày gửi: 27/04/2010 lúc 7:40 chiều | Đã khóa IP Trích dẫn DUCVINH83

How to repair a SQL Server 2005 Suspect database


Introduction

If your project's database is in suspect mode, then no transaction will take place until and unless you repair your database. That causes a show stopper for your up and running application. Here, you will find a way to get out of this.

Background

Your Database is in Suspect Mode. I guess, you haven't experienced this problem till now. But, if it comes to you and if the database is LIVE, then it's time to read this article to get out of this tension.

Using the Code

If you find your database in Suspect mode, then please keep your nerve strong. Just proceed step by step what I am written below. I think you will get out of this trouble. SQL Server 2005 introduced a new DB Status called Emergency. This mode can change the DB from Suspect mode to Emergency mode, so that you can retrieve the data in read only mode. The steps are... After executing the script given below, you will get back your database in operational mode. Actually I have tried with two of my existing live systems and found no data loss.

Note: Obviously there are two more options available. Run REPAIR_ALLOW_DATA_LOSS to ensure the database is returned to a structurally and transitionally consistent state. Here are a few things to bear in mind about emergency mode repair: it's a one-way operation. Anything it does cannot be rolled back or undone. If this worries you (if someone ever got into that state, then surely don't have the healthy concern about data that they should have in the first place) then make a copy of the damaged database before you run emergency mode repair.
As it's a one-way operation, you cannot wrap it in an explicit user-transaction.
It's the only repair option available in emergency mode - if you try to use REPAIR_REBUILD, then it won't work.

Collapse code snippet
EXEC sp_resetstatus 'yourDBname';
ALTER DATABASE yourDBname SET EMERGENCY
DBCC checkdb('yourDBname')
ALTER DATABASE yourDBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB ('yourDBname', REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE yourDBname SET MULTI_USER

Points of Interest

You will be happy that your database as well as the application are still in workable condition. :)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Suvendu Banik


Member
Love to code
Occupation: Program Manager
Location: India India


Được sửa bởi DUCVINH83 trên diễn đàn 27/04/2010 lúc 7:46 chiều


__________________

YM: DUCVINH83
0912 822334


Lên trên Xem DUCVINH83's Thông tin cá nhân Tìm những bài viết khác của DUCVINH83 Ghé thăm DUCVINH83's Trang chủ
 
DUCVINH83
Administrator
Administrator
Avatar
Không ngừng học hỏi !

Ngày gia nhập: 01/11/2005
Giới tính:
Đến từ: Vietnam
Trạng thái:
Bài viết: 365
Tiền: 738$
Địa chỉ e-mail: Gửi mail
Yahoo! IM: Yahoo! IM
Sinh nhật: 17/02/1983
Cảnh cáo: (0%)
Minus 1 warningCurrent warnlevel: 0%Add 1 warning
Ngày gửi: 27/04/2010 lúc 7:48 chiều | Đã khóa IP Trích dẫn DUCVINH83

Wow phê thật hôm nọ không hiểu sao tự nhiên một bản ghi của mình bị lỗi trong database SQL Server 2005, mình biết có một chính xác là ID nào bị hỏng, nhưng không tại nào DELETE hay SELECT ID đó được. Mình dùng trưởng này và keke, tự nhiên cái ID đó biến mất, database của mình lại chạy ngon lành, quá tuyệt, thanks !


__________________

YM: DUCVINH83
0912 822334


Lên trên Xem DUCVINH83's Thông tin cá nhân Tìm những bài viết khác của DUCVINH83 Ghé thăm DUCVINH83's Trang chủ
 

Nếu bạn muốn trả lời thì trước tiên bạn phải đăng nhập
Nếu chưa đăng ký thì bạn hãy đăng ký

  Trả lời bài viếtGửi bài viết mới
Xem trang in Xem trang in

Di chuyển nhanh
Bạn không thể tạo đề tài mới
Bạn không thể trả lời bài viết
Bạn không thể xoá bài viết bạn đã gưi
Bạn không thể sửa bài viết bạn đã gửi
Bạn không thể tạo bình chọn
Bạn không thể bình chọn



Trang này được tạo ra trong 0.1875 giây.
cheap jordans for salecheap jordans for salecheap jordans for salecheap jordans for salecheap jordans for salecheap jordans for salecheap jordans for salecheap jordans for salecheap jordans for salesac longchamp pas chergucci outlet

baomang.net  9ecva.com © 2007 - Phát triển bởi Trịnh Đức Vinh