Lesson 2: Configuring Log Shipping Options in .NET framework

Drawer PDF 417 in .NET framework Lesson 2: Configuring Log Shipping Options

Lesson 2: Configuring Log Shipping Options
Painting PDF 417 In VS .NET
Using Barcode creator for VS .NET Control to generate, create PDF 417 image in Visual Studio .NET applications.
www.OnBarcode.com
PDF 417 Scanner In .NET
Using Barcode scanner for Visual Studio .NET Control to read, scan read, scan image in .NET applications.
www.OnBarcode.com
CAUTION
Print Bar Code In Visual Studio .NET
Using Barcode creator for .NET framework Control to generate, create bar code image in VS .NET applications.
www.OnBarcode.com
Bar Code Scanner In Visual Studio .NET
Using Barcode recognizer for Visual Studio .NET Control to read, scan read, scan image in Visual Studio .NET applications.
www.OnBarcode.com
Log backups in a log shipping process
PDF 417 Generator In Visual C#
Using Barcode printer for VS .NET Control to generate, create PDF 417 image in .NET framework applications.
www.OnBarcode.com
PDF417 Creator In VS .NET
Using Barcode drawer for ASP.NET Control to generate, create PDF 417 image in ASP.NET applications.
www.OnBarcode.com
When you re using log shipping, backing up the transaction log independently will disrupt the log shipping process. If you plan to use transaction log backups as part of your recovery plan, use the backup folder as the source of backup files for your recovery plan.
PDF 417 Creator In VB.NET
Using Barcode encoder for VS .NET Control to generate, create PDF417 image in VS .NET applications.
www.OnBarcode.com
Painting Bar Code In .NET Framework
Using Barcode printer for VS .NET Control to generate, create barcode image in .NET applications.
www.OnBarcode.com
Scripting the Log Shipping Configuration
Quick Response Code Printer In .NET Framework
Using Barcode drawer for .NET framework Control to generate, create QR Code image in VS .NET applications.
www.OnBarcode.com
2D Barcode Generation In .NET
Using Barcode drawer for .NET Control to generate, create Matrix 2D Barcode image in .NET framework applications.
www.OnBarcode.com
You can also create a script that enables the primary database and sets the backup options for your log shipping configuration. The advantages of scripting the configuration are that you can use the script to document the configuration and deploy the same configuration for multiple databases, and you can use it as part of the recovery plan. To use SSMS to generate the script, click Script Configuration at the bottom of the Transaction Log Shipping page in the Database Properties window. Using the options you select in the resulting window, SQL Server generates a script that you can store in a file, display as a query in SSMS, or copy to the Clipboard. The generated script uses four stored procedures to configure the primary database and the SQL Server Agent backup jobs for log shipping. The core stored procedure, sp_add_log_shipping_primary_database, is responsible for most of the configuration except for the schedule definition. The sp_add_schedule and sp_attach_schedule procedures configure the schedule and attach it to the job. The sp_update_job procedure then enables the job for execution. The following code block shows the primary database configuration script:
Creating Linear In Visual Studio .NET
Using Barcode generator for .NET Control to generate, create Linear Barcode image in .NET applications.
www.OnBarcode.com
Code11 Creator In .NET
Using Barcode maker for .NET Control to generate, create Code 11 image in VS .NET applications.
www.OnBarcode.com
Primary Database Configuration Script
Make EAN13 In Java
Using Barcode encoder for Eclipse BIRT Control to generate, create EAN-13 image in BIRT applications.
www.OnBarcode.com
Generate Code 128C In .NET
Using Barcode encoder for ASP.NET Control to generate, create ANSI/AIM Code 128 image in ASP.NET applications.
www.OnBarcode.com
-- Execute the following statements at the primary to configure -- log shipping for the database [DEMOSRV\DEV2005].[AdventureWorks2], -- Run the script at the primary in the context of the -- [msdb] database. --------------------------------------------------------------------- Adding the log shipping configuration -- ****** Begin: Script to be run at primary: [DEMOSRV\DEV2005] ****** DECLARE @LS_BackupJobId AS uniqueidentifier DECLARE @LS_PrimaryId AS uniqueidentifier DECLARE @SP_Add_RetCode As int EXEC @SP_Add_RetCode = master.dbo.sp_add_log_shipping_primary_database @database = N'AdventureWorks2' ,@backup_directory = N'C:\LOGSHIP' ,@backup_share = N'\\DEMOSRV\LOGSHIP' ,@backup_job_name = N'LSBackup'
Draw GS1-128 In None
Using Barcode generation for Software Control to generate, create EAN128 image in Software applications.
www.OnBarcode.com
Generate UCC.EAN - 128 In Java
Using Barcode generation for Android Control to generate, create UCC.EAN - 128 image in Android applications.
www.OnBarcode.com
18
Make Bar Code In Java
Using Barcode maker for Java Control to generate, create barcode image in Java applications.
www.OnBarcode.com
Draw Code 128 Code Set B In Java
Using Barcode printer for BIRT Control to generate, create Code128 image in BIRT applications.
www.OnBarcode.com
Implementing Log Shipping
UCC.EAN - 128 Drawer In None
Using Barcode drawer for Excel Control to generate, create UCC-128 image in Excel applications.
www.OnBarcode.com
Making Bar Code In Visual Basic .NET
Using Barcode printer for .NET Control to generate, create barcode image in Visual Studio .NET applications.
www.OnBarcode.com
,@backup_retention_period = 4320 ,@backup_threshold = 60 ,@threshold_alert_enabled = 1 ,@history_retention_period = 5760 ,@backup_job_id = @LS_BackupJobId OUTPUT ,@primary_id = @LS_PrimaryId OUTPUT ,@overwrite = 1 IF (@@ERROR = 0 AND @SP_Add_RetCode = 0) BEGIN DECLARE @LS_BackUpScheduleUID As uniqueidentifier DECLARE @LS_BackUpScheduleID AS int EXEC msdb.dbo.sp_add_schedule @schedule_name =N'LSBackupSchedule_DEMOSRV\DEV20051' ,@enabled = 1 ,@freq_type = 4 ,@freq_interval = 1 ,@freq_subday_type = 4 ,@freq_subday_interval = 15 ,@freq_recurrence_factor = 0 ,@active_start_date = 20060106 ,@active_end_date = 99991231 ,@active_start_time = 0 ,@active_end_time = 235900 ,@schedule_uid = @LS_BackUpScheduleUID OUTPUT ,@schedule_id = @LS_BackUpScheduleID OUTPUT EXEC msdb.dbo.sp_attach_schedule @job_id = @LS_BackupJobId ,@schedule_id = @LS_BackUpScheduleID EXEC msdb.dbo.sp_update_job @job_id = @LS_BackupJobId ,@enabled = 1 END EXEC master.dbo.sp_add_log_shipping_alert_job
The sp_add_log_shipping_primary_database stored procedure has the same parameters as the SSMS interface to set up the primary database. You can easily change parameters such as @database, @backup_directory, @backup_share, and @backup_job _name to create a large number of log shipping configurations. (In fact, if you want to use the previous example script, you should change these parameters to reflect the names of your server, database, backup directory, backup shared folder, and backup job name.) The @backup_retention_period sets the number of minutes after which the job will delete backup files in this script, 4320 minutes or 3 days. The @backup_threshold and @threshold_alert_enabled specify whether an alert will be raised after a certain period. The @history_retention_period sets the time period in minutes after which the job will delete history information from the msdb database.
Lesson 2: Configuring Log Shipping Options
The parameters @backup_job_id and @primary_id are output parameters needed to configure the schedule.
MORE INFO
Log shipping system tables
For complete information about the tables and stored procedures associated with a log shipping configuration, see the Log Shipping Tables and Stored Procedures topic in SQL Server 2005 Books Online. SQL Server 2005 Books Online is installed as part of SQL Server 2005. Updates for SQL Server 2005 Books Online are available for download at www.microsoft.com/technet/prodtechnol/sql/ 2005/downloads/books.mspx.
Copyright © OnBarcode.com . All rights reserved.