TAILIEUCHUNG - SQL Server Tacklebox- P25

SQL Server Tacklebox- P25: This book, as with almost all books, started out as an idea. I wanted to accumulate together those scripts and tools that I have built over the years so that DBAs could sort through them and perhaps adapt them for their own circumstances. | 4 Managing data growth IF EXISTS SELECT name FROM Where name like fixed_drives --If So Drop it DROP TABLE fixed_drives --Recreate it CREATE TABLE fixed_drives Drive char 1 COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL MBFree decimal NOT NULL ON PRIMARY --Insert rows from sp_MSForEachDB into temp table INSERT INTO HoldforEachDB_size EXEC sp_MSforeachdb Select as DatabaseName Case When . 8 1024 0 Then 1 Else . 8 1024 End AS size . . From .sysfiles --Select all rows from temp table the temp table will auto delete when the connection is gone. INSERT INTO fixed_drives EXEC xp_fixeddrives Select @@Servername print Select rtrim Cast DatabaseName as varchar 75 as DatabaseName Drive Filename Cast Size as int AS Size Cast MBFree as varchar 10 as MB_Free from HoldforEachDB_size INNER JOIN fixed_drives ON LEFT 1 GROUP BY DatabaseName Drive MBFree Filename Cast Size as int ORDER BY Drive Size Desc print Select Drive as Total Data Space Used Cast Sum Size as varchar 10 as Total Size Cast MBFree as varchar 10 as MB_Free from HoldforEachDBsize 120 4 Managing data growth INNER JOIN fixed_drives ON LEFT 1 Group by Drive MBFree print Select count Distinct rtrim Cast DatabaseName as varchar 75 as Database_Count from HoldforEachDB_size Listing Size query. Example results of the Size query are shown in Figure . DatabaseName Drive Filename Size MB_Free 1 AII_Book _Ever_Read i C C Program FilesVMicrosoft SQL ServerVMSSQL. 1 M SSQLkDATA AII_Books_E 6499 61366 2 DBA_Flep C C Program FilesVMicrosoft SQL MSSQL DATA 2381 61366 3 DBA_Rep C C Program FilesSM icrosoft SQL Server MSSQL 1 MSSQLkDATA 1744 61366 4 AdventureWork 2008 C C Program FilesVMicrosoft SQL ServerVMSSQL. 1 M 228 61366 5 dba_rep_test_native C C Program .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.