Chia Sẽ Kinh Nghiệm Về IT



Tìm Kiếm Với Google
-


Gởi Ðề Tài Mới  Gửi trả lời
 
Công Cụ Xếp Bài
Tuổi 19-10-2015, 05:14 PM   #1
hoctinhoc
Guest
 
Trả Lời: n/a
Không nên Shrink a Database trong MS SQL Server (cảnh báo) how to shrink a database?
Không nên Shrink a Database trong MS SQL Server (cảnh báo) how to shrink a database?


Các bạn có nên sử dụng tính năng shrink database để giảm dung lượng Database MS SQL server?

Câu trả lời là không nên nhe vì sau khi shrink sẽ làm giảm Performance và tăng
Fragmemtation cho Dababase của bạn

Tại sao ư? các bạn tham khảo 2 bài viết và phân tích sau nhe:


Shrinking the Database file (MDF):
After the above process has finished, you can release more unused data by following the steps below.
  • NOTE: Shrinking the ' data' database file ( mdf) can cause slower performance in the database afterwards.
    • One reason for this is that it can cause fragmentation of the indexes (for more details see Microsoft TechNet article linked below).
    Therefore, shrinking the data should only be done if either:
    • Your SQL server's hard drive is almost full and you desperately need to free space
    • You have recently run a process (for example the one described in Technote #1624409) which has deleted a lot of information in the database, and you wish to reclaim this 'empty' space.


http://www.straightpathsql.com/archives/2009/01/dont-touch-that-shrink-button/

http://blog.sqlauthority.com/2011/01...s-performance/

Database 500GB Shrink mất bao lâu?

Câu trả lời là tuỳ thuộc vào RAM, CPU, DISK IO trên mỗi Server thì sẽ có thời gian khác nhau

Theo kinh nghiệm của mình thì 500GB thời gian shrink mất khoảng 12h

https://www.calazan.com/how-to-check...l-server-2005/

Cách xem quá trình Shrink DB được bao nhiêu phần trăm

Chạy Query sau:

Trích dẫn:

SELECT percent_complete, start_time, status, command, estimated_completion_time, cpu_time, total_elapsed_time FROM sys.dm_exec_requests WHERE command = 'DbccFilesCompact'


Cách Cancel quá trình Shrink là Reboot lại SQL service



Hy vọng chúc kinh nghiệm này sẽ giúp ít được cho các bạn.


  Trả lời ngay kèm theo trích dẫn này
Gửi trả lời


Công Cụ
Xếp Bài

Quyền Hạn Của Bạn
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Mở
Hình Cảm xúc đang Mở
[IMG] đang Mở
Mã HTML đang Tắt




Bây giờ là 01:41 AM. Giờ GMT +7



Diễn đàn tin học QuantriNet
quantrinet.com | quantrimang.co.cc
Founded by Trương Văn Phương | Developed by QuantriNet's members.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.