- SQL Server 2005 or later
- Standard, Workgroup or Enterprise editions must be installed on all server instances involved in log shipping.
- The servers involved in log shipping should have the same case sensitivity settings.
- The database must use the full recovery or bulk-logged recovery model
- A shared folder for copying T-Log backup files
- SQL Server Agent Service must be configured properly
USE [master]
GO
ALTER DATABASE [jugal] SET RECOVERY FULL WITH NO_WAIT
GO
3. The next step is to configure and schedule a transaction log backup. Click on Backup Settings… to do this.
When you click the Add… button it will take you to the below screen where you have to configure the Secondary Server and database. Click on the Connect… button to connect to the secondary server. Once you connect to the secondary server you can access the three tabs as shown below.
TO DISK = 'BackupFilePathname'
WITH NORECOVERY;
- TUF File: It’s Transaction Undo File. It Generated only when you Have Configured Log Shipping With Stand by Option. Since In Stand by Log Shipping Secondary Database is Available to User. So TUF Keep Pending Transaction Which are in Log File Came from Primary So That when Next Log Backup Will Come From Primary They Can Be Synchronized At Secondary.
- .WRK : This Extension Is Given To A File Which is Being Copied From Primary Backup Location to Secondary and Once Copy Process has been completed these file are renamed with .trn file.
EXEC Master.dbo.sp_delete_log_shipping_primary_secondary
@primary_database = N’VirendraTest’,
@secondary_server = N’VIRENDRA_PC’,
@primary_database =N’LSVirendraTest’;
GO
7.My log file is corrupted in Log shipping..?
If your log file is corrupted in a log shipping setup, it's crucial to address this issue promptly to ensure data integrity and the continuity of your log shipping process. Here are steps you can take to handle a corrupted log file in log shipping:
1. Identify
the Cause:
·
Determine the cause of the log file corruption.
Common causes include disk failures, storage issues, hardware problems, or
unexpected interruptions during log file copying or applying.
2. Take
Immediate Action:
·
Stop the log shipping restore job to prevent
further attempts to apply the corrupted log file.
·
Ensure that backups of the primary database are
intact and available for recovery.
3. Restore
Last Good Log Backup:
·
Restore the last good log backup on the
secondary server to restore the database to a consistent state before the
corruption occurred.
·
If the last good log backup is also corrupted,
consider using an earlier backup that is known to be valid, although this may
result in data loss.
4. Fix
the Corrupted Log File:
·
If possible, attempt to repair the corrupted log
file using DBCC CHECKDB with the REPAIR_ALLOW_DATA_LOSS option. Note that this
should be done cautiously as it can result in data loss.
·
If repair is not feasible, consider restoring
the log file from a known good backup or creating a new log file.
5. Resume
Log Shipping:
·
Once the database is restored to a consistent
state without the corrupted log file, reconfigure log shipping by setting up a
new log shipping plan.
·
Ensure that log backups are taken regularly on
the primary database and successfully applied to the secondary databases to
maintain synchronization.
6. Monitor
for Issues:
·
Monitor the log shipping process and database
integrity regularly to detect any further issues or inconsistencies.
·
Set up alerts or notifications to be notified of
any log shipping failures or errors promptly.
7. Review
and Improve Backup and Recovery Strategies:
·
Review your backup and recovery strategies,
including log backup frequency, retention policies, and backup verification
procedures, to prevent future log file corruptions and ensure data protection.
No comments:
Post a Comment