Quản trị net diễn đàn chia sẻ thông tin các thủ thuật mạng, internet bảo mật thông tin dành cho giới IT VIệt hy vọng là nơi bổ ích cho cộng đồng

Quản trị net diễn đàn chia sẻ thông tin các thủ thuật mạng, internet bảo mật thông tin dành cho giới IT VIệt hy vọng là nơi bổ ích cho cộng đồng (http://quantrinet.com/forum/index.php)
-   Mssql( Microsoft SQL Server) (http://quantrinet.com/forum/forumdisplay.php?f=152)
-   -   Không nên Shrink a Database trong MS SQL Server (cảnh báo) how to shrink a database? (http://quantrinet.com/forum/showthread.php?t=9929)

hoctinhoc 19-10-2015 05:14 PM

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.




Bây giờ là 01:03 PM. 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.