tailieunhanh - Microsoft SQL Server 2008 R2 Unleashed- P80

Microsoft SQL Server 2008 R2 Unleashed- P80:SQL Server 2005 provided a number of significant new features and enhancements over what was available in SQL Server 2000. This is not too surprising considering there was a five-year gap between these major SQL Server 2008 is not as much of a quantum leap forward from SQL Server 2005 | 734 CHAPTER 23 Creating and Managing Databases Shrinking the Log File The data file most likely to grow beyond a normal size and require periodic shrinking is the transaction log file. If a user process issues a large update transaction the log file grows to the size needed to hold the records generated by the transaction. This could be significantly larger than the normal growth of the transaction log. As with data files shrinking of the log file in SQL Server 2008 can take place only from the end of the log file. However you must first back up or truncate the log to remove the inactive log records and reduce the size of the logical log. You can then run the DBCC SHRINKFILE or DBCC SHRINKDATABASE command to release the unused space in the log file. Transaction log files are divided logically into segments called virtual log files. The Database Engine chooses the size of the virtual log files dynamically while it is creating or extending log files. Transaction log files can only be shrunk to a virtual log file boundary. It is therefore not possible to shrink a log file to a size smaller than the size of a virtual log file even if the space is not being used. The size of the virtual log files in a transaction log increase as the size of the log file increases. For example a database defined with a log file of 1GB may have virtual log files 128MB in size. Therefore the log can be shrunk to only about 128MB. Because of the overhead incurred when the autoshrink process attempts to shrink database files it is not recommended that you enable this option for the transaction log because it could be triggered numerous times during the course of a business day. It is better to schedule the shrinking of the log file to be performed during normal daily maintenance when production system activity is at a minimum. Using SSMS to Shrink Databases In addition to shrinking a database by using T-SQL you can do so through SSMS. In the Object Explorer you right-click the database you .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.