Log Shipping enables you to automatically send transaction log backups from a primary database on a primary server instance to one or more secondary databases on separate secondary server instances. The transaction log backups are applied to each of the secondary databases individually.
ADVANTAGES OF LOG SHIPPING-
- Easy setup.
- Standby databases can be available for read -only queries.
- Low Maintenance.
- Multiple standby servers can be configured.
- Provide both disaster recovery and high availability solution.
- It supports both bulk logged and full recovery model.
DISADVANTAGES OF LOG SHIPPING-
- It is possible to loss data when the main database is corrupt.
- It only works at database level and not at SQL server instance level.
- There will be data transfer latency.
- Failover take time.
- No automatic failover.
TYPES OF LOG SHIPPING -
In SQL Server two types of log shipping which are given below-:
- Standby Mode
- Restore Mode
Standby Mode-The database is available for querying and users can access it, but in read-only mode.
Restore Mode- In this mode the database is not accessible.
STEPS TO CONFIGURE LOG SHIPPING-
- I have used SQL 2019 to set up Log Shipping.
- First, connect to your primary instance and select a database.
- Take a full back up from primary instance.
- Now connect to secondary server.
- Here, restore the full back up on the secondary server with the help of move command with norecovery.
- Now, restore the log backup on the secondary server which we have taken from primary server.
- Now, configure log shipping between both the server and Go to primary server->Go to database->Right click->Go to properties->Transaction Log Shipping
- Now, go to add and connect with initialize secondary server.
- Add the path for copied files.
- Go through standby mode which means you can read from secondary server.
- Now, at primary server insert some data in a selected database.
- Go to SQL Server agent and start the LS backup job at the primary server.
JOBS CREATED FOR LOG SHIPPING-
There are 3 types of jobs in log shipping as given below-
- Backup job (LS Backup)- A SQL Server Agent job that performs the backup operations, logs history to the local server and the monitor server and deletes old backup file and history information.
- Copy job (LS Copy)- A SQL Server Agent job that copies the backup files from primary server to a configurable destination on the secondary server and logs history on the secondary server and the monitor server.
No comments:
Post a Comment
If you have any doubt or question, please contact us.