Book Image

Microsoft SQL Server 2008 High Availability

By : Hemantgiri S. Goswami
Book Image

Microsoft SQL Server 2008 High Availability

By: Hemantgiri S. Goswami

Overview of this book

<p>Every business has it's mission critical applications and data. Therefore, it is very important to keep database servers up and running all the time – 24 X 7. There is a need to store and process terabytes of data to cater for business needs, and it is vital to make data highly available.<br /><br />High availability is all about the site being accessible all the time. High availability solutions minimize the downtime for these mission critical applications.</p> <p>Microsoft SQL Server is a powerful relational database engine, widely used to store and maintain data in Enterprises of various levels be they small, medium or large.</p> <p>This book will teach you how best to use these readily-available options and save you time in making your websites highly available.<br /><br />This Microsoft SQL Server 2008 High Availability book will take you through pre and post installation concepts and common issues you come across while working with SQL Server HA. It will teach you how these various HA solutions can be installed using GUI and the command line. It will also show you how to troubleshoot common issues you may encounter whilst installing or managing the HA option in your environment. It provides references to external links for more advanced learning on the topic.<br /><br />This book starts with an introductory chapter into the windows domain, domain users and various handshake methods available with Windows server. It also offers information the different authentication methods available with SQL Server - giving you an insight into the importance of security. After you are through with the security aspects, your journey to installing SQL Server HA will start. It will cover the concepts of database mirroring, log shipping, clustering, and replication.<br /><br />By the end of this book you will be confident enough to take up the challenge to install any of the SQL Server HA options.</p>
Table of Contents (18 chapters)
Microsoft SQL Server 2008 High Availability
About the Author
About the Reviewers

Chapter 3: Snapshot Replication

  • Question: I get the following error: Cannot make the change because a snapshot is already generated. Set @force_invalidate_snapshot to 1, in order to force the change and invalidate the existing snapshot. How do I resolve this error?

    Answer:When we add an article to an existing publication that we have already initialized, now as we have added one more article to it, snapshot will become obsolete and will have be reinitialized to incorporate the changes. Adding parameter @force_invalidate_snapshot=1 will force snapshot to be regenerated.

  • Question: Every time I add an article, entire snapshot is generated. Why is that so?

    Answer: There is a property called @immediate_sync in the publication that enforces full snapshot to be generated immediately whenever a new article is added. Setting the value to false for the @immediate_sync will generate snapshot for only the newly added article.

    Execute the following command at the Publisher end to reset the value for @immediate_sync option:

    sp_changepublication @publication='publicationname',

    In this case, do not forget to call sp_addsubscription procedure for every subscription so that a newly added article can be added. And finally, call sp_refreshsubscriptions to refresh the existing Subscribers.

  • Question: Why did Snapshot Agent fail to start?

    Answer: This question is often found in many newsgroups and various SQL Server forums. Most often this error is caused by login failure error or if there is an issue with the NTFS or share permissions. We need to make sure that we have given appropriate permission for both share and NTFS.

  • Question: My snapshot has returned the following error: initial snapshot timeout.

    Answer: This means that the snapshot that has been generated is large enough or we may have an issue with the network (network congestion or DNS, among others). To overcome this problem:

    • Split the single publication into smaller and multiple publications

    • Compress the snapshot files

    • Increase the value of query timeout


    For more information on Agent Profile parameters, refer to the Snapshot Agent parameters section in Chapter 3.

  • Question: Why has my transaction log grown so big?

    Answer: Replication is using BCP In and BCP Out to synchronize database. Also, BCP operations are fully logged under Full Recovery model and minimally logged when database is set to bulk-logged mode. It all results in all the transactions getting logged, making the transaction log to grow bigger in size.

    Although we may change the database recovery model to bulk-logged mode during bulk operation, it is not recommended as it affects the point-in-time recovery. The recommendation is that we should schedule T-Log backup for regular intervals at minimum latency, for example, every 15 minutes, so that we can have point-in-time recovery and we can also keep our T-log in shape.

Troubleshooting using Replication Monitor (RM)

When it comes to troubleshooting replication apart from troubleshooting it by viewing error details in the job history, we can use RM to troubleshoot errors. RM can be handy to identify the error details and to troubleshoot them.

  1. 1. To launch RM, call sqlmonitor.exe. Expand My Publisher | PublisherName | Publication Name, and select the Agent tab in the right-hand side pane.

  2. 2. Right-click on the Agent and select View Details; here we will see the summary option in the grid on the right-hand side of pane. If we click the drop-down arrow of the View option, we will be asked to choose an option from various available options.

  3. 3. Until we have all successful synchronization, let's Un-share the folder where we have stored the snapshot files. Please refer to the following screenshot. The following screen represents the scenario after we have un-shared the snapshot share (also notice the red-cross on the Publisher).

  4. 4. Right-click on the Error and select View Details. Notice the error message in the following screenshot; it clearly indicates that it could not find the network path.

  5. 5. Let's re-share the folder and restore the share and NTFS permission. Notice that the snapshot has now been applied successfully.