Thursday, November 14, 2019

Always ON FAQ's....


1. What is Always on in SQL Server 2012?
AlwaysOn Availability Groups feature is a high-availability and disaster-recovery solution that provides an enterprise-level alternative to database mirroring. Introduced in SQL Server 2012, AlwaysOn Availability Groups maximizes the availability of a set of user databases for an enterprise. An availability group supports a failover environment for a discrete set of user databases, known as availability databases that fail over together. An availability group supports a set of read-write primary databases and one to four sets of corresponding secondary databases. Optionally, secondary databases can be made available for read-only access and/or some backup operations.
2. What are Availability Groups?
A container for a set of databases, availability databases, that fails over together.
3. What are Availability Databases?
A database that belongs to an availability group. For each availability database, the availability group maintains a single read-write copy (the primary database) and one to four read-only copies (secondary databases).
4. Which SQL Server Editions include AlwaysOn Availability Group functionality?
SQL Server Enterprise Edition
5. What editions on Windows server support Always ON Functionality?
Windows Enterprise Edition
6. How many replicas can I have in an AlwaysOn Availability Group?
Total 5-1 Primary and up to 4 Secondaries.
7. How many AlwaysOn Availability Groups can be configured in Always ON?
Up to 10 availability groups is the recommendation, but it’s not enforced
8. How many databases can be configured in an AlwaysOn Availability Group?
Up to 100 is the recommendation, but it’s not enforced
9. What is Availability mode in Always ON?
The availability mode is a property of each availability replica. The availability mode determines whether the primary replica waits to commit transactions on a database until a given secondary replica has written the transaction log records to disk (hardened the log).
10. Do we need SQL Server Cluster instances to configure Always ON?
No we don’t need SQL Server Cluster instances to configure Always ON.
11. Do we need shared storage to configure Always ON?
No, we don’t need shared storage.
12. How many Availability modes are supported by Always ON?
Always ON supports below availability modes.
·         Asynchronous-commit mode
·         Synchronous-commit mode
13. What is the Difference between Asynchronous-commit mode and Synchronous-commit mode?
Asynchronous-commit mode
An availability replica that uses this availability mode is known as an asynchronous-commit replica. Under asynchronous-commit mode, the primary replica commits transactions without waiting for acknowledgement that an asynchronous-commit secondary replica has hardened the log. Asynchronous-commit mode minimizes transaction latency on the secondary databases but allows them to lag behind the primary databases, making some data loss possible.
Synchronous-commit mode
An availability replica that uses this availability mode is known as a synchronous-commit replica. Under synchronous-commit mode, before committing transactions, a synchronous-commit primary replica waits for a synchronous-commit secondary replica to acknowledge that it has finished hardening the log. Synchronous-commit mode ensures that once a given secondary database is synchronized with the primary database, committed transactions are fully protected. This protection comes at the cost of increased transaction latency.
14. What is called Primary replica?
The availability replica that makes the primary databases available for read-write connections from clients and, also, sends transaction log records for each primary database to every secondary replica.
15. What is called Secondary replica?
An availability replica that maintains a secondary copy of each availability database, and serves as a potential failover targets for the availability group. Optionally, a secondary replica can support read-only access to secondary databases can support creating backups on secondary databases.
16. What is Availability Group listener?
A server name to which clients can connect in order to access a database in a primary or secondary replica of an AlwaysOn availability group. Availability group listeners direct incoming connections to the primary replica or to a read-only secondary replica.
17. What are Readable Secondary Replicas?
The AlwaysOn Availability Groups active secondary capabilities include support for read-only access to one or more secondary replicas (readable secondary replicas). A readable secondary replica allows read-only access to all its secondary databases. However, readable secondary databases are not set to read-only. They are dynamic. A given secondary database changes as changes on the corresponding primary database are applied to the secondary database.
18. What are the benefits of Readable Secondary Replicas?
Directing read-only connections to readable secondary replicas provides the following benefits:
·         Offloads your secondary read-only workloads from your primary replica, which conserves its resources for your mission critical workloads. If you have mission critical read-workload or the workload that cannot tolerate latency, you should run it on the primary.
·         Improves your return on investment for the systems that host readable secondary replicas.
In addition, readable secondary’s provide robust support for read-only operations, as follows:
·         Temporary statistics on readable secondary database optimize read-only queries. For more information, see Statistics for Read-Only Access Databases, later in this topic.
·         Read-only workloads use row versioning to remove blocking contention on the secondary databases. All queries that run against the secondary databases are automatically mapped to snapshot isolation transaction level, even when other transaction isolation levels are explicitly set. Also, all locking hints are ignored. This eliminates reader/writer contention.
19. How many synchronous secondary replicas can I have?
We can have up to 2 synchronous replicas, but we are not required to use any. We could run all Secondaries in Async mode if desired
20. Can we use a secondary for reporting purpose?
Yes. An active secondary can be used to offload read-only queries from the primary to a secondary instance in the availability group.
21. Can we use secondary replicas to take the db backups?
Yes. An active secondary can be used for some types of backups
22. What all types of DB backups are possible on Secondary Replicas?
·         BACKUP DATABASE supports only copy-only full backups of databases, files, or filegroups when it is executed on secondary replicas. Note that copy-only backups do not impact the log chain or clear the differential bitmap.
·         Differential backups are not supported on secondary replicas.
23. Can we take Transaction log backups on the secondary replicas?
Yes, we can take transaction log backups on the secondary replicas without COPY_ONLY option.
24. What is “Failover” in Always ON?
Within the context of a session between the primary replica and a secondary replica, the primary and secondary roles are potentially interchangeable in a process known as failover. During a failover the target secondary replica transitions to the primary role, becoming the new primary replica. The new primary replica brings its databases online as the primary databases, and client applications can connect to them. When the former primary replica is available, it transitions to the secondary role, becoming a secondary replica. The former primary databases become secondary databases and data synchronization resumes.
25. How many types of Failover are supported by Always ON?
Three forms of failover exist—automatic, manual, and forced (with possible data loss). The form or forms of failover supported by a given secondary replica depends on its availability mode,
26. What are the Failover types supported by Synchronous-commit mode?
·         Planned manual failover (without data loss)
·         Automatic failover (without data loss)
27. What is planned manual failover?
A manual failover occurs after a database administrator issues a failover command and causes a synchronized secondary replica to transition to the primary role (with guaranteed data protection) and the primary replica to transition to the secondary role. A manual failover requires that both the primary replica and the target secondary replica are running under synchronous-commit mode, and the secondary replica must already be synchronized.
28. What is Automatic failover?
An automatic failover occurs in response to a failure that causes a synchronized secondary replica to transition to the primary role (with guaranteed data protection). When the former primary replica becomes available, it transitions to the secondary role. Automatic failover requires that both the primary replica and the target secondary replica are running under synchronous-commit mode with the failover mode set to “Automatic”. In addition, the secondary replica must already be synchronized, have WSFC quorum, and meet the conditions specified by the flexible failover policy of the availability group.
29. Can we configure Automatic failover of Availability Groups with SQL Server Failover cluster instances?
SQL Server Failover Cluster Instances (FCIs) do not support automatic failover by availability groups, so any availability replica that is hosted by an FCI can only be configured for manual failover.
30. What are the Failover types supported by under asynchronous-commit mode?
Only form of failover is forced manual failover (with possible data loss), typically called forced failoverForced failover is considered a form of manual failover because it can only be initiated manually. Forced failover is a disaster recovery option. It is the only form of failover that is possible when the target secondary replica is not synchronized with the primary replica.
31. What is Use the AlwaysOn Dashboard
Database administrators use the AlwaysOn Dashboard to obtains an at-a-glance view the health of an AlwaysOn availability group and its availability replicas and databases in SQL Server 2012. Some of the typical uses for the AlwaysOn Dashboard are:
·         Choosing a replica for a manual failover.
·         Estimating data loss if you force failover.
·         Evaluating data-synchronization performance.
·         Evaluating the performance impact of a synchronous-commit secondary replica

1.      What is availability group wizard?
Availability Group Wizard is a GUI using SQL Server Management Studio to create and configure an AlwaysOn availability group in SQL Server 2012.
2.      What are the Restrictions on Availability Groups?
·         Availability replicas must be hosted by different nodes of one WSFC cluster
·         Unique availability group name: Each availability group name must be unique on the WSFC cluster. The maximum length for an availability group name is 128 characters.
·         Availability replicas: Each availability group supports one primary replica and up to four secondary replicas. All of the replicas can run under asynchronous-commit mode, or up to three of them can run under synchronous-commit mode.
·         Maximum number of availability groups and availability databases per computer: The actual number of databases and availability groups you can put on a computer (VM or physical) depends on the hardware and workload, but there is no enforced limit. Microsoft has extensively tested with 10 AGs and 100 DBs per physical machine.
·         Do not use the Failover Cluster Manager to manipulate availability groups:
3.      What are the minimum requirements of a database to be part of the Always ON Availability Group?
·         Availability groups must be created with user databases. Systems databases can’t be used.
·         Databases must be read-write. Read-only databases aren’t supported.
·         Databases must be multiuser databases.
·         Databases can’t use the AUTO_CLOSE feature.
·         Databases must use the full recovery model, and there must be a full backup of them.
·         A given database can only be in a single availability group, and that database can’t be configured to use database mirroring.
4.      How many read-write and read only databases replica can be configure in SQL Server 2012 and 2014?
·         SQL Server 2012 supported a maximum of four secondary replicas.
·         With SQL Server 2014, AlwaysOn Availability Groups now supports up to eight secondary replicas.
5.      Is it possible to setup Log Shipping on a database which is part of Availability Group?
Yes, it can be configured.
6.      Is it possible to setup Replication on a database which is part of Availability Group?
Yes, It is possible.
7.      FILESTEAM is supported by Availability Group or not?
Yes, it is supported.
8.      Change Data Capture supported by Always ON or not?
Yes, it is supported.
9.      Database Snapshot supported by Always ON or not?
Yes, it is supported.
10.  Can system database participate in AG?
No.
11.  Suppose primary database became in suspect mode. Will AG have failover to secondary replica?
 Issues at the database level, such as a database becoming suspect due to the loss of a data file, deletion of a database, or corruption of a transaction log, do not cause an availability group to failover.
12.  Can we have two primary availability replica?
No, it is not possible.
13.  Is AG support automatic page repair for protection against any page corruption happens?
Yes, It automatically takes care of the automatic page repair.
14.  How to Add a secondary database from an availability group?
ALTER DATABASE Db1 SET HADR AVAILABILITY GROUP = MyAG;
15.  How to remove a secondary database from an availability group?
ALTER DATABASE MyDb2 SET HADR OFF;
GO
16.  Is SQL Server 2012 AlwaysOn support encryption and compression?
SQL Server 2012 AlwaysOn Availability Group supports row and page compression for tables and indexes, we can use the data compression feature to help compress the data inside a database, and to help reduce the size of the database. We can use encryption in SQL Server for connections, data, and stored procedures; we can also perform database level encryption: Transparent data encryption (TDE). If you use transparent data encryption (TDE), the service master key for creating and decrypting other keys must be the same on every server instance that hosts an availability replica for the availability group
17. Does AG support Bulk-Logged recovery model?
No, it does not.
18. Can a database belong to more than one availability group?
No.
19. What is session timeout period?
Session-timeout period is a replica property that controls how many seconds (in seconds) that an availability replica waits for a ping response from a connected replica before considering the connection to have failed. By default, a replica waits 10 seconds for a ping response. This replica property applies only the connection between a given secondary replica and the primary replica of the availability group.
20. How to change the Session Timeout period?
ALTER AVAILABILITY GROUP AccountsAG
MODIFY REPLICA ON 'INSTANCE09' WITH (SESSION_TIMEOUT = 15);
21. What are different synchronization preferences are available?
As part of the availability group creation process, We have to make an exact copy of the data on the primary replica on the secondary replica. This is known as the initial data synchronization for the Availability Group.
22. How many types of Data synchronization preference options are available in Always ON?
There are three options- Full, Join only, or Skip initial data synchronization.
23. Is it possible to run DBCC CHECKDB on secondary replicas?
Yes.
24. Can I redirect the read-only connections to the secondary replica instead of Primary replica?
Yes, we can specify the read_only intent in the connection string and add only secondaries (not the primary) to the read_only_routing list. If you want to disallow direct connections to the primary from read_only connections, then set its allow_connections to read_write.
25. If a DBA expands a data file manually on the primary, will SQL Server automatically grow the same file on secondaries?
It will be automatically expanded on the Secondary replica.
26. Is it possible to create additional indexes on read-only secondary replicas to improve query performance?
No, it is not possible.
27. Is it possible to create additional statistics on read-only secondaries to improve query performance?
No. But we can allow SQL Server to automatically create statistics on read-only secondary replicas.
28. Can we manually fail over to a secondary replica?
Yes. If the secondary is in synchronous-commit mode and is set to “SYNCHRONIZED” you can manually fail over without data loss. If the secondary is not in a synchronized state then a manual failover is allowed but with possible data loss
29. What is read intent option?
There are two options to configure secondary replica for running read workload. The first option ‘Read-intent-only’ is used to provide a directive to AlwaysOn secondary replica to accept connections that have the property ApplicationIntent=ReadOnly set. The word ‘intent’ is important here as there is no application check made to guarantee that there are no DDL/DML operations in the application connecting with ‘ReadOnly’ but an assumption is made that customer will only connect read workloads.
30. Does AlwaysOn Availability Groups repair the data page corruption as Database Mirroring?
Yes. If a corrupt page is detected, SQL Server will attempt to repair the page by getting it from another replica.
31. What are the benefits of Always on feature?
·         Utilizing database mirroring for the data transfer over TCP/IP
·         providing a combination of Synchronous and Asynchronous mirroring
·         providing a logical grouping of similar databases via Availability Groups
·         Creating up to four readable secondary replicas
·         Allowing backups to be undertaken on a secondary replica
·         Performing DBCC statements against a secondary replica
·         Employing Built-in Compression & Encryption


No comments:

Post a Comment

COMMON SQL SERVER BACKUP FAILURE ERRORS AND ISSUES

  One of the most common task for a DBA’s are to perform installation of new SQL Server versions and installing patches. Most often or not e...