SQL Server security best practice

Security! This is the word comes in mind of every concerned person when it come...

Change the Collation Settings in MS SQL Server

This post will show you how to change the collation settings in MS SQL Server for specific database...

Resolve collation conflict

In this post I will show you how you can resolve collation conflict error...

Book: SQL Server 2008 High Availability

In this book I have tried to cover every single piece of information that might requires for installing and configuring SQL Server HA option like Clustering, Replication, Log Shipping and Database Mirroring...

Why to recompile Stored Procedure

Generally, we create views and stored procedures (proc here after) ...

Showing posts with label database mirroring. Show all posts
Showing posts with label database mirroring. Show all posts

1/12/2016

Blog Roll - List of blog post and script contribution

Greetings of the day!!


I am getting frequent emails with questions why I do not write as often I used to write earlier. I know, I got very few blog posts since 2013; the reason was that I had some personal commitment that kept me busy to take time off and make a blog post. However I tried to keep the moment by posting couple of blogs every year but that's on the another blog space - my employers blog space at http://www.pythian.com/blog/author/goswami/ . I have also contributed some scripts to Technet Script Gallery.  Below is the list of the blog post I made last year and the Script Gallery.

I am determined to post at least couple of entry each month now, I would appreciate your support as always!!


Links to the blog posts
Date Title URL
Jan 5 2016 SQL Server 2016 – AlwaysOn Basic Availability Group http://www.pythian.com/blog/alwayson-basic-availability-group-sql-server-2016/
July 31 2015 SQL Server and OS Error 1117, Error 9001, Error 823 http://www.pythian.com/blog/sql-server-and-os-error-1117-error-9001-error-823/
July 9 2015 Reading System Logs on SQL Server http://www.pythian.com/blog/reading-system-logs-on-sql-server/
July 20 2015 Reading System Logs on SQL Server - Part 2 http://www.pythian.com/blog/reading-system-logs-sql-server-part-2/
Sep 30 2015 Import / Export Multiple SSIS Packages http://www.pythian.com/blog/importexport-multiple-ssis-packages/
July 28 2014 Unexpected Shutdown caused by ASR http://www.pythian.com/blog/unexpected-shutdown-caused-by-asr/
Jan 23 2014 Script to Collect Database Information Quickly http://www.pythian.com/blog/script-to-collect-database-information-quickly/


Links to the Technet script Gallery

Date Title URL
Nov 22 2015 Script to Collect ALL Database Information wtih VLF Count https://gallery.technet.microsoft.com/Script-to-Collect-ALL-82664699
May 3 2013 Collect Cluster Information using TSQL https://gallery.technet.microsoft.com/scriptcenter/COLLECT-CLUSTER-INFORMATION-9a75e4a7
Mar 9 2013 Configure Auto Growth in Fixed MB https://gallery.technet.microsoft.com/scriptcenter/Configure-AutoGrowth-in-f4f3d7d1
Jun 26 2015 Script to Monitor Database Mirroring Health https://gallery.technet.microsoft.com/scriptcenter/Script-to-monitor-database-0f35c5d7
Jun 26 2015 Script to Monitor AlwaysOn Health https://gallery.technet.microsoft.com/scriptcenter/TSQL-for-AlwaysOn-Health-6aae827d

9/14/2011

Checking DB Mirroring Status

Often I see a question in community on how to quickly check the status of the database mirroring, sometime in busy environment and busy server launching database mirroring keep us waiting for a while, so is there a way we can check database mirroring status ?


Yes, of course we do have; execute below statement and you will have a status of the database mirroring for all the database you have configured mirroring on :


SELECT DB_NAME(database_id),   
mirroring_role_desc,    
mirroring_state_desc    
FROM sys.database_mirroring    
WHERE mirroring_guid IS NOT NULL; 


Let me know if you are looking some specific code, and I will try to post it here!!


- Hemantgiri S. Goswami (http://www.sql-server-citation)

5/05/2011

Winner of the contest

Dear Readers,

I am very please to announce winner of the contest about describing best HA & DR solution. The contest was successful, there are about  5 entries I have get from various  sources like linkedin and email, I would like to thank all the participant and readers. The winner is Dave Thomas.

My apologies, I suppose to declare winner on 25th April but could not able to make it.



3/07/2011

Describe HA and DR strategy and win

Dear Readers,

I am very please to made an announcement about the contest.  As you aware that I have wrote a book on SQL Server 2008 High Availability which was published on 24th January 2008 2011 by Packt Publication. Now you have a chance to win a subscription worth £150 of digital library at Packt Publication and a Paper book of SQL Server 2008 HA, here is the information.

Who this book is for?
This book is written for the System Administrator, experienced SQL Developers who want to learn about the topic – SQL Server High Availability, Aspiring DBAs. That means, this book is having a step-by-step instructions, pre-requisite with plenty snapshots to get you through the installation of SQL Server High Availability options like Cluster, Replications ( Snapshot, Transactional, Peer-2-Pee and Merge), Log Shipping and Database Mirroring.

I have tried to include external reference for further study on that particular topic if you wish to read some advance information, I have also include few common issues and how to resolve them for every topic i.e. How to troubleshoot common issues for Clustering, Replication, Log Shipping and Database Mirroring.

Here is the detailed index for every chapter of this book at - http://www.sql-server-citation.com/2011/01/sql-server-2008-high-availability-book.html

Where to buy?
One can purchase my book SQL Server 2008 High Availability from Packt Publication in Paper and eBook format at https://www.packtpub.com/microsoft-sql-server-2008-high-availability/book or one can purchase this from Amazon at http://www.amazon.com/Microsoft-Server-2008-High-Availability/dp/1849681228/ref=sr_1_1?ie=UTF8&s=books&qid=1299390127&sr=8-1



Contest Information:

Describe the best HA and DR solution you have designed or worked upon, especially in case of physically dispersed location, and the reason why?

The best answer will win a  subscription of digital library worth £150 at Packt Library for 1 year and 2nd best answer will win Paper book of SQL Server 2008 HA.

The best answer will be judged by me and Satya Shyam K Jayanty (whom I admired as Guru.), we will announced the winner by 25th April 2011.

Rules:
1. Their will be two winners - 1 Subscription and 1 Paper book of SQL Server 2008 HA
2. The contest will remain open until 5th of April 2011
3. The Packt Pub Subscription will be free for 1 year

Update:
By mistake I have mentioned that my book was published on 24th January 2008, I did not noticed it until Ashish Sharma draw my attention, I have corrected it now. Thank you Ashish :)

What are you waiting for, start participating and be a lucky winner!!!



Regards
-- Hemantgiri S. Goswami | www.sql-server-citation.com

1/25/2011

SQL Server 2008 High Availability – A Book

I have no words to explain my excitement and happiness to share news with you all - my book on SQL Server 2008 High Availability is published!!
I have started authoring this book in May 2010 and as the time passes and gradually I move to the final chapter of the book, I was feeling like aha finally it is done!!! – Do you think so, it was this easy?
No, every publication house has their own set of rules to be followed while authoring a book and a process to be followed before the chapter or entire book is ready to be published i.e. 1st edit, 2nd edit of the chapter until final edit and the Packt Publication is no exception.
Since this is the first time I was authoring book I was having little or no idea about authoring a book. The editors from Packt Publication helped me a lot by helping me time to time with proper answers to my queries. I must admit that I could not be able to complete this book without support and encouragement from my family including my 2 year old daughter Dhruti.
I hope that you all will enjoy reading and learning from this book as I did while authoring and contributed my little part for the growth of my beloved SQL Server J
Let me tell you about this book:
1223EN_MockupCover The term High Availability means that the servers or systems that host or run the business-critical applications should be highly available 24 X 7. As the word it-self defines how important it is to make these applications and data available for end-users as well as business users, if this data is not available for a short time, it will be a big problem for both sets of users. Imagine a bank spread across the country and having a huge customer base. One fine day, their server crashes! If the bank relies only on backups, then it might end up losing approximately 15 to 30 minutes of data, depending on the backup strategy. Now the HA options related to SQL Server such as clustering, replication, log shipping, and database mirroring will help overcome this situation.
In this book I have tried to cover every single piece of information that might requires for installing and configuring SQL Server HA option like Clustering, Replication, Log Shipping and Database Mirroring, below are the chapters:
Chapter 1: Understanding Windows Domains, Domain Users, and SQL Server Security
Chapter 2: Implementing Clustering
Chapter 3: Snapshot Replication
Chapter 4: Transactional Replication
Chapter 5: Merge Replication
Chapter 6: Peer-to-Peer Replication
Chapter 7: Log Shipping
Chapter 8: Database Mirroring
Appendix A: Troubleshooting
Appendix B: External References
If you are interested to read more about the detailed / contents of each chapter you may find them here https://www.packtpub.com/toc/microsoft-sql-server-2008-high-availability-table-contents
And, here is the link for the sample chapter https://www.packtpub.com/sites/default/files/1223-chapter-1-understanding-windows-domains-domain.pdf

Regards
Hemantgiri S. Goswami

11/09/2009

SQL Server High Availability Options Preview

As it is named, all the SQL Servers and databases should be highly available (HA) to cater the business requirement, and, the business application should be up and running all the time. To achieve this Microsoft has introduced SQL Server Cluster which is one of the highly recommended and used solutions for SQL Server high availability which is server specific that means that all the databases on the SQL Server Cluster are available in case of failover. Database Mirroring (DM) and Log Shipping (LS) along with the Replication (Repl.) are the alternate solution for the high availability but all this options are database specific that means that you can set it up for specific database(s).

Here are the brief about each (I'll post detailed article on each in near future):

Replication: As it is named, replicates the data/database to one or more than one location. Replication was first introduced in SQL Server 6 with minor support and was enhanced in SQL Server 7.0; with launch of SQL Server 2000 it has added some more features to it. And, with SQL Server 2005 Microsoft has introduced Peer-to-Peer replication which is capable of doing load balancing.

The Application:  Based on the business requirement i.e. for reporting purpose, data from more than one location needs to be merged and or if wish to have transaction level replication of data.
Component of the Replication:
Publisher:  Is a server which published the data
Distributor: Is a server which is responsible to distribute data to the subscriber(s)
Subscribers: are servers which has the subscription, the distributor sends the data which is being published by the publisher here.
Subscription Type: Subscription has two method, pull and push. With Pull subscription, subscriber connects to the publisher periodically and pulls the data where as with Push subscription publisher connects with the subscribers and push the changes over subscriber.

 There are 4 type of Replication available: 
1.       Snapshot:  Snapshot replication is the very basic and simplest type of replication available. As name implies, it took snapshot of the published data, connect to the subscriber and then applied the snapshot on subscriber.  This is most suitable when data is required for reporting purpose and are not updated on the subscriber end, and high latency is acceptable.

Application:  Where higher latency is allowed and data is used for the reporting purpose only.

2.       Transactional:  In this mode of replication, it is replicating data transaction level by continuous monitoring.  To achieve this Log Reader Agent is being created when Transactional Replication is configured, it monitors every database which is configured for Transactional Replication and then copies the transactions which are marked for replication from T-Log to distribution database. Distribution database then send (either pull/push subscription) it to the subscriber.
       Application:  Where higher latency is not allowed and data is used for the reporting
       purpose, and   sometimes subscriber is allowed to updates.
     
3.       Merge:  Merge replication uses Triggers to track the changes in subscriber to publisher.  And, as it named it merges the records, irrespective of who updates/inserts records.  This is the most complex topology of replication.  As it is a merge replication wherein updates/modifications are allowed from more than one subscriber at a time, it has in-built facility to resolved conflict.  There are some pre-requisites which you need to have before Merge Replication can be configured, here is my article on Merge Replication Tips here
Application:
a.       Multiple Subscribers might update the same data at various times and propagate those changes to the Publisher and to other Subscribers.
b.      It might have a chance of occurring conflict, and if they do, there should be the mechanism to resolve it.
c.       One time modification is done at subscriber end and the same needs to update at publisher and other subscriber.

4.       Peer-to-Peer:  This is the best topology of Replication introduced up till. This has been introduced in with launch of SQL Server 2005. In, Peer-to-Peer replication the participants have the complete schema and all the data modifications (DML operations) are made at all nodes.  Now, you would be thinking, hey what is the catch here, what is new then merge replication? Well, the simplest answer is Peer-to-peer Replication is designed for Load Balancing by spreading out write activity across all available nodes and then based on the sync latency it synchronizes database, thus read and write operations become faster.  And, additionally if any of the server is not available it will continue to perform as it is with another node and write operation for this node is routed to another node.
Application: Best suited for online shopping application

Database Mirroring: Database mirror is the best and cost effective solution for automatic failover. Database mirroring is introduced with launch of SQL Server 2005. A database mirroring replicate the change to secondary server at transaction level and provides two modes: High Performance (Asynchronous) and High Safety (Synchronous). The difference between two is, with High Safety mode it will not send and write any data to the secondary node until it is committed on the primary node whereas with High Performance mode it will ship the transaction and write the transaction on to secondary server no matter it is committed or roll back on the primary server.

Log Shipping:   This is the cost effective solution, as it is named, it ships T-Log backup to the secondary node(s) on regular interval and then restore job performs T-Log restoration at secondary server to keep it updated with the primary server. The disadvantage is, it don’t have automatic failover feature and hence manual intervention for role change would take 2~3 minutes time (I guess this is allowable downtime).


SQL Server Cluster:  This is the best HA feature in SQL Server, which provides automatic failover for Entire Server, in comparison to other options which provides supports to particular database(s). But, this solution is costlier than other 3 options because it requires identical hardware.  

3/09/2009

Community launched | Surat SQL Server User Group | DotNetChaps

Hi,

We have formed a Technical Community User Group. The aim of this User Group is to share/exchange what all we have in terms of the knowledge.

We have two separate forums for MS SQL and for Dot Net technology to avoid confusion. You may post all your queries pertaining to MS SQL at http://www.surat-user-group.org and if you are having a query in .Net (be it asp .net, c# or vb .net) please post it to http://tech.groups.yahoo.com/group/DotNetChaps/

http://www.surat-user-group.org is having an association with SQLPASS (http://www.sqlpass.org) and is an official SQLPASS Chapter.

http://tech.groups.yahoo.com/group/DotNetChaps/ is having an association with iNETA.