Đang chuẩn bị liên kết để tải về tài liệu:
SQL Server MVP Deep Dives- P11

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

SQL Server MVP Deep Dives- P11: Each year Microsoft invites all the MVPs from every technology and country to Redmond for an MVP Summit—all top secret—“don’t tweet what you see!” During the MVP Summit, each product team holds a series of presentations where they explain their technologies, share their vision, and listen to some honest feedback. | 356 Chapter 27 Automating SQL Server Management using SMO code can then be executed every time your backup strategy calls for a full database backup of all databases on the target server. If you remove the full database backup logic from the code sample the code can be run every time transaction log backups are to be run for all databases on the server improving your recovery interval to minimize the potential data loss in the event of a system failure. In the following script shown in listing 2 we ll connect to our target server and then get the default backup directory from the Settings collection. We ll next grab the database collection and iterate through that to do the backups. For each database we ll get the current date and time and put it into a string to use in the backup filename. We ll do the full backup for the database then we ll check to see if the database recovery model is Simple. If not we ll perform a transaction log backup on the database as well. Figure 2 The SMO Backup object Listing 2 Backing up user databases backup.psi Performs a Full backup followed by a transaction log backup on all user databases param string srvname MyServer MyInstance Load SMO assembly and if we re running SQL 2008 DLLs load the SMOExtended and SQLWMIManagement libraries v System.Reflection.Assembly LoadWithPartialName Microsoft.SqlServer.SMO p v.FullName.Split p1 p 1 .Split p2 pi 1 .Split . if p2 0 -ne 9 System.Reflection.Assembly LoadWithPartialName Microsoft.SqlServer. SMOExtended out-null System.Reflection.Assembly LoadWithPartialName Microsoft.SqlServer. SQLWMIManagement out-null s new-object Microsoft.SqlServer.Management.Smo.Server srvname bkdir s.Settings.BackupDirectory dbs s.Databases foreach db in dbs if db.IsSystemObject -eq False -and db.IsMirroringEnabled -eq False Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Restore 357 dbname db.Name dt get-date -format yyyyMMddHHmmss bk new-object Microsoft.SqlServer.Management.Smo.Backup

Đã 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.