Search Suggest

Objective Questions on SQL Server 2016 & SQL server 2017 Administration & Azure SQL Databases.



Q1.Columns that are returned by sys.dm_tran_locks relate to either the resource being blocked
1. The request causing the block
2. The session causing the block
3. The session waiting on the block
4. The user causing the block
Ans:- 1. The request causing the block
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Q2.Which of the following is NOT a primary function of the Log Reader Agent?
1.Copy transactions from the distribution database to one or more subscribers
2.Look for transactions marked for replication
3.Copy transactions marked for replication to the distribution database
4.Analyze the transaction log of the publication
Ans:- Copy transactions from the distribution database to one or more subscribers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Q3.Which of the following is a supported way to provide availability for the distribution database?
1.Availability groups
2.Log shipping
3.Database mirroring
4.Failover cluster instances
Ans:-Failover cluster instances
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Q4.Which of the following stored procedures is used to a create a distribution database on a distributor SQL Server instance?
1.sp_adddistributor
2.sp_adddistributiondb
3.sp_adddistpublisher
4.sp_addpublisher
Ans:-sp_adddistributiondb
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Q5.Which of the following is NOT a direct key consideration for distribution database performance and scalability?
1.Data retention
2.Data volume
3.Collocation with the publisher
4.Database ANSI option settings
5.Data and log file I/O path
Ans:- Database ANSI option settings
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Q6.An update modifies 1,000 rows in a table that is referenced in two publications. How many Log Reader Agent commands does this activity generate?
1.You cannot reference a table in two publications
2.1
3.2,000
4.1,000
Ans:- 3.
~~~~~~~~~~~~~~~~~~~~~~~~~ 
Q7.Which of the following is a danger of using the -SkipErrors parameter?
1.Slow performance due to skipped transactions
2.No issues with this parameter
3.Partial transactions sent to the subscriber
4.Failed transactions will be retried within the retry threshold
Ans:- 3
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Q8.Which of the following is not a directly-securable area related to a transactional replication topology?
1.tempdb database
2.Distribution database
3.Subscription databases
4.Publication database

Ans :1
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Q9.Which of the following approaches for deploying transactional replication allows for easier recovery in the event of a disaster?
1.Using the Wizard to recreate the various publications, distributor settings and subscriptions
2.Retaining a script that configures the pre-disaster topology (hand-coded or from the wizard)
3.Using log shipping to protect the publisher, distributor and subscribers
4.Protect the publisher, distributor, subscribers using database mirroring or availability groups
Ans:-2
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Q10.Each machine in a failover cluster is called what?
1. blade
2. unit
3. node
4. server

Ans:- 3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Q11.in which commit mode will the primary replica not wait for confirmation that the transaction was processed by the secondary replica?
1.synchronous-commit
2.priority-commit
3.procedural-commit
4.asynchronous-commit

 Ans:-4.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Q12.Which availability group component routes traffic to either the primary or secondary replicas?
1.Traffic Manager
2.Listener
3.Routing Agent
4.Distributor
Ans:- 2
~~~~~~~~~~~~~~~~~~~~~
Q13.Which failover type supports the asynchronous commit mode?

1.Automatic
2.Forced
3.Manual
4.Distributed

Ans : 2 & 3
 ~~~~~~~~~~~~~~~~~~~~~~~~
Q14. Which of the following is not true about Distributed Availability Groups?
1. There is only one primary replica database.
2. Each cluster maintains its own quorum.
3. Transaction updates are only sent once from the primary availability group to the secondary.
4. Failover Clusters can be a long distance apart.
Ans:-1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Q15.When creating a new server in Azure, what rule must you follow when giving it a name?
1.It must be unique for your account.
2.It must be globally unique.
3.It must have a capital and lower case letters.
4.It must contain a special character.
 Ans:- 2.
~~~~~~~~~~~~~~~~~~~~~~~~~~
Q16:- The Azure SQL Database administrator account exists at what service level?
1.Database
2.Resource Group
3.User
4.Server
Ans : 4
~~~~~~~~~~~~~~~~~~~~~~~~ 
Q17.What is the CI record?
1.The CI record contains the CD array.
2.The CI record contains the anchor row and dictionary.
3.The CI record is added to the header of every row on the page.
Ans : The CI record contains the anchor row and dictionary.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Q18.Which statement is true about the anchor record in page level compression?
1.The anchor record contains a value from each row that has a commonly occurring prefix from the column.
2.The anchor record contains a list of items that are duplicated on the page.
3.The values in the column are replaced by the anchor record index.
Ans : 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Q19. The COMPRESS function may only be used on row-overflow columns.
1.True
2.False
Ans : 2.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Q20. What is the CD Array in Row level compression?
1.The structure within a compressed page that stores the values.
2.A structure that stores the total bytes of each row in a page.
3.The structure within a compressed page that stores the widths of each column in the row.
Ans : 3
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
Q21.What is an advantage of the COMPRESS function?
1.COMPRESS uses the same algorithm as PAGE compression.
2.You don't have to worry about any T-SQL code changes when selecting the rows.
3.You can compress individual columns.
4.The compressed values retain their original data type in the table.
Ans : 3
~~~~~~~~~~~~~~~~~~~~~~~~
Q22.Backup compression is compatible with TDE.
1.False
2.True
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Q23.Consider the scenario where a plan is forced for a query, and an index is added which would make that query faster.Which of the following is true?
1.Adding an index to a table removes forced plans referencing that table
2.The plan forcing fails, the optimizer generates a new plan using the new index
3.The plan forcing succeeds, the new index is not used
Ans : 1
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Q24.Which of the following is a downside to using DMVs to debug performance regressions?
Your choice:
1.Data is lost after a restart of SQL
2.No DMVs track query performance
3.Collection has to be explicitly started before the problem occurs
4.Data is unaggregated, resulting in large volumes that's difficult to search through
Ans : 1
~~~~~~~~~~~~~~~~~
Q25. What causes regressions due to plan changes?
1. Bad parameter sniffing
2. Out of date statistics
3. Bad query patterns
4.overly complicated queries
5. caused by the data growth
6. code changes or schema change can cause regressions
7.All of the above
Ans : 7
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
Q.26
When trying to solve an overall high CPU problem, which of the following is most useful?
1.Knowing the 5 queries with the highest total CPU usage per time interval
2.Knowing the 5 queries with the highest maximum CPU usage per time interval
3.Knowing the 5 queries with the highest average CPU usage per time interval
Ans:1
~~~~~~~~~~~~~~~~~~~~~~
Q.27
Which of the following is a downside to using DMVs to track per-query resource consumption?
1.Data is aggregated over different time periods for different queries
2.Collection has to be explicitly started before the problem occurs
3.Data is unaggregated, resulting in large volumes that's difficult to search through
Ans : 1
~~~~~~~~~~~~~~~~~~~~~~~~
Q28
Which Query Store view contains the start and end times for the aggregation intervals?
1.sys.dm_db_runtime_stats_interval
2.sys.dm_exec_runtime_stats_interval
3.sys.query_store_runtime_stats_interval
4.sys.query_store_runtime_stats
Ans: 3
 ~~~~~~~~~~~~~~~~~~~~~
Q29.Which Query Store view contains Contains information about the runtime execution statistics information for the query.
1.sys.dm_db_runtime_stats_interval
2.sys.dm_exec_runtime_stats_interval
3.sys.query_store_runtime_stats_interval
4.sys.query_store_runtime_stats
Ans: 4
~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Q30.Which Query Store view contains Contains information about Query Store options for this database
1.sys.database_query_store_options
2.sys.query_context_settings
3.sys.query_store_plan
4.sys.query_store_query
5.sys.query_store_query_text
6.sys.query_store_runtime_stats
7.sys.query_store_wait_stats
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Q31.If Query Store fills up and becomes read-only, after increasing the max size, what else must be done to allow new data to be captured?

1.The Desired State must be set to 'ON'
2.The Operational Mode must be set to 'READ-WRITE'
3.Nothing further needs to be done.
Ans-: 2.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Q32.
Which of the Query Store built in reports would be the best to use when ensuring that an upgrade won't result in slow queries?

1.The Top Resource Consuming Queries report
2.The Tracked Queries report
3.The Regressed Queries report
4.The Overall Resource Consumption report
Ans: 3
~~~~~~~~~~~~~ 
Q33. True or False: In SQL Server 2016 the Backup compression is compatible with Transparent Database Encryption (TDE).
1. True
2.False
Ans: True
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Q34. True or False: In SQL Server 2016 the Backup Encryption can also be used for databases that are encrypted using TDE.
1.True
2.False
Ans : True

Q 35:- What are the Benefits of Backup Encryption:-
1.Encrypting the database backups helps secure the data: SQL Server provides the option to encrypt the backup data while creating a backup.
2.Encryption can also be used for databases that are encrypted using TDE.
3.Encryption is supported for backups done by SQL Server Managed Backup to Microsoft Azure, which provides additional security for off-site backups.
4.This feature supports multiple encryption algorithms up to AES 256 bit. This gives you the option to select an algorithm that aligns with your requirements.
5.You can integrate encryption keys with Extended Key Management (EKM) providers.
6. 1 & 3 & 5
7.All of the above
Ans : 7
~~~~~~~~~~~
Q36.Which Editions of SQL Server support Transparent Database Encryption (TDE)?
1. Developer Edition
2. Enterprise Edition
3. Standard Edition
4. Expression Edition
Ans: 2

Q37. Which of the following statement is false regarding TDE
1.TDE performs real-time I/O encryption and decryption of the data and log files.
2.The encryption uses a database encryption key (DEK), which is stored in the database boot record for availability during recovery.
3.The DEK is a symmetric key secured by using a certificate stored in the master database of the server
4.The DEK is a Asymmetric key secured by using an asymmetric key protected by an EKM module.
5.TDE protects data "at rest", meaning the data and log files.
6.All
6. None of the above
Ans: 6
~~~~~~~~~~~~~~~ 
Q38.Which Editions of SQL Server support Transparent Database Encryption (TDE)?
1. Developer Edition
2. Enterprise Edition
3. Standard Edition
4. Expression Edition
Ans: 2
~~~~~~~~~~~~ 
Q39.Which of the following statement is false regarding TDE
1.TDE performs real-time I/O encryption and decryption of the data and log files.
2.The encryption uses a database encryption key (DEK), which is stored in the database boot record for availability during recovery.
3.The DEK is a symmetric key secured by using a certificate stored in the master database of the server
4.The DEK is a Asymmetric key secured by using an asymmetric key protected by an EKM module.
5.TDE protects data "at rest", meaning the data and log files.
6.All
6. None of the above
Ans: 6
~~~~~~~~~~~~~~~~~~~~~~~
Q40.You work for company blogspot.com. The management wants to track data changes made to a number of tables within the database.
The solution must be able to show the data before and after any modification.
Solution: You should use DDL triggers.
Does the solution meet the goal?
1.Yes
2.No
Ans:- No
~~~~~~~~~~~~~~~~~
Q41:-The first five columns in a capture instance table contain what?
1.Information for auditing the change that was captured
2.Reference pointers to the log operation generating the change
3.The first five columns from the source table
4.Metadata about the captured change in the row
Ans: 4
~~~~~~~~~~~~~~~~~
Q42.How many values exist for the __$operation column?
1.There isn't a __$operation column in CDC
2.Three - Insert, Update, Delete
3.Four - Delete, Insert, Value before update, Value after update
4.Two - Insert, Delete
Ans:3
~~~~~~~~~~~~~~~~~~~~~~~~
Q43.What two options are required to enable a table for Change Data Capture?
1.The table name and a name for the capture instance
2.The role name for security and filegroup for the capture instance
3.The table name and role name for security
4.The source_schema and source_name for the object
Ans : 4
~~~~~~~~~~~~~~~~~~~~~~~~
Q44.What SSIS component controls the lifecycle of CDC packages in SSIS?
1.CDC Source Component
2.You can only control this manually through the table-valued functions
3.CDC Splitter Component
4.CDC Control Task Component
~~~~~~~~~~~~~~~~~~~~~~~~~
Q45.How many capture instances are supported per source table?
It depends on the size of the table
1.Only one
2.Two
3.Unlimited
Ans: 2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Q46.What consideration must be made when using CDC with Database Mirroring or Availability Groups?
1.The capture and cleanup jobs must be manually created on the secondary server
2.CDC is not compatible with Database Mirroring or Availability Groups
3.Nothing special must be done with Database Mirroring or Availability Groups
4.The overhead of the log reader will slow down operations
Ans: 1
~~~~~~~~~~~~~~~~~~~~~~~
Q47.What edition of SQL Server is required to use Change Data Capture?
1.Enterprise Edition
2.Express Edition
3.Business Intelligence Edition
4.Standard Edition
Ans : 1
~~~~~~~~~~~~~~~~~~~~~~~~
Q48.What permission is required to enable a table for Change Data Capture?
1.db_datareader
2.schema owner
3.db_owner
4.SELECT on the table
Ans: 3
~~~~~~~~~~~~~~~~~~~~~~~~~~
Q49.What function maps a log sequence number to a time range?
1.You can only do this by querying the system tables
2.You can't map a log sequence number to a time range in CDC
3.sys.fn_cdc_map_time_to_log_sequence_number
4.sys.fn_cdc_map_lsn_to_time
Ans: 4
~~~~~~~~~~~~~
Q50.Which type of security predicate should you use to explicitly blocks all write operations that violate the predicate in Row-level security (RLS)?
1. Filter predicate
2. block predicate
Ans: 2
~~~~~~~~~~~~~~~~~~~~~~~~
Q51. To AUTO_UPDATE_STATISTICS_ASYNC, the AUTO_UPDATE_STATISTICS needs to be enabled as well.
1.True 
2. False

Ans:1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Q52.The Query Optimizer can execute your queries without waiting for updated statistics when the AUTO_UPDATE_STATISTICS_ASYNC option is used. This way none of your queries will be delayed when the statistics are updated. It is also possible that some applications experience timeouts when the statistics are updated before running the query. This situation can be avoided by enabling asynchronous statistics updates.
1.True 
2. False
Ans: 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Q53.
what below query will do
USE AdventureWorks2012;  
GO  
EXEC sp_autostats 'Production.Product', 'ON';  
GO  

1. Display the status of all statistics on a table
2. Enable AUTO_UPDATE_STATISTICS for all statistics on a table
3.Disable AUTO_UPDATE_STATISTICS for a specific index

Ans: 2
~~~~~~~~~~~~~~~~~~~~~~~
Q54. which DMV returns information about the database table columns that are missing for an index. 
1.sys.dm_db_missing_index_group_stats
2.sys.dm_db_missing_index_groups
3.sys.dm_db_missing_index_details
4.sys.dm_db_missing_index_columns(index_handle)
Ans: 4

Sys.dm_db_missing_index_coulmns : - 

Explanation:-  should use the sys.dm_missing_index_details DMV. This DMV returns the table for which the index is missing, along with the column types that should be used in the index.The Information provided by this DMV can then be used to determine how to run the CREATE INDEX  Transact-SQL statement to create the index.. 

~~~~~~~~~~~~~~~~~~~~~~
Q55 When you execute the DBCC CHECKDB commands with no option, which of the following checks are executed 

1. DBCC CHECKTABLE
2. DBCC CHECKCATALOG
3. DBCC CHECKALLOC
4. Validate the contents of every indexed view in the database
5. Validates link-level consistency between table metadata and file system directories and files when storing varbinary(max) data in the file system using FILESTREAM
6.Validate the Service Broker data in the database
7.DBCC CHECK CONSTRAINT
8.DBCC CHECKFILEGROUP
Ans: 1,2,3,4,5,6
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Q.You manage a Microsoft SQL Server environment. You have a database named salesOrders that includes a
table named Table1.
Table1 becomes corrupt. You repair the table.
You need to verify that all the data in Table1 complies with the schema.

write correct answer here..

       

Q.56  Stored procedure which create a database mail profile as the default public Database Mail profile for msdb
1. sysmail_add_profile_sp
2. sysmail_add_principalprofile_sp
Ans: - 2.

Reference:- 
~~~~~~~~~~~~~~~~~~~
Q. 57 In case of distributed availability group in SQL Server 2016  which of the follwoing is true
1.Both WSFC clusters are joined to the same domain.
2.Each WSFC cluster is joined to a different domain.
3.One WSFC cluster is joined to a domain, and one WSFC cluster is not joined to a domain.
4.Neither WSFC cluster is joined to a domain.
5.All
6.None
~~~~~~~~~~~~~~~~~~~~~~~~~~
Q.58.You deploy a SQL Server 2016 cluster with an AlwaysOn availability group. The cluster is configured using the Failover Cluster feature in Windows Server 2016.
All Windows Server across all clusters must be in the same version and patch level
A.True 
B.False
Ans: False
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Q59.You deploy a SQL Server 2016 cluster with an AlwaysOn availability group. The cluster is configured using the Failover Cluster feature in Windows Server 2016.
in this case below statement is true or false

Changes made to the primary replica on the primary availability group are replicated to all replicas in the secondary availability group.
1.True
2.False
Ans:
~~~~~~~~~~~~~~~~~~~
Q.60 You deploy a SQL Server 2016 cluster with an AlwaysOn availability group.The cluster is configured using the Failover Cluster feature in Windows Server 2016.
in this case below statement is true or false
In a distributed availability group, changes from the primary availability group are replicated only to the primary replica in the secondary availability group.Then, the primary replica in the secondary availability group replicates the changes to all secondary replicas in the secondary availability group.
1.True
2.False
Ans:  1
~~~~~~~~~~~~~~
Q61. ________ type of encryption allows a client to confirm the identity of the owner of a private key?
options:
1.Certificate
2.Private
3.Public
4.key
Ans:-  1.
~~~~~~~~~~~~~~~
Q62. The certificate used to encrypt a database backup should be exported and archived with the backup files.
Above statement is 
1.True
2.False
Ans:2

Q63.
Your Company has 4 servers named SQL1,SQL2,SQL3,SQL4 with SQl Server 2016 installed.
SQL1 hosts a line of business database named HR_Applications.
SQL1 is the production server.All Servers have identical hardware.

You configure log shipping for the HR_Applications database.
You configure SQL1 as a primary server, SQL02 as remote monitoring server, and SQl03 as a secondary server.

You want to configure SQL4 as a secondary server for the HR_Applications.
You need to configure SQL4 by using T-SQL queries.

Which query should you execute first?

1.sp_add_log_shipping_secondary_database @secondary_database = N'HR_Applications'  on SQL4
2.sp_add_log_shipping_secondary_database on sql1
3.sp_add_log_shipping_secondary_primary on SQl4
4.sp_add_log_shipping_secondary_primary @primary_server= N'sql4' on SQL1


Ans:- 3 
https://kushagrarakesh.blogspot.com/2018/03/what-is-difference-between.html
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

Q64.

will these commands will  work from secondary replica.

backup database [AdventureWorks2014] to disk = 'adven_full.bak' with compression,copy_only
go

backup database [AdventureWorks2014] to disk = 'adven_diff.bak' with differential, compression,copy_only
go

backup log  [AdventureWorks2014] to disk = 'adven_log.trn'

1.True
2.False

Ans: True

Q65. In order to Recover an Azure SQL database using automated database backups.
You can restore from a database backup to:

1.A new database on the same logical server recovered to a specified point in time within the retention period.
2.A database on the same logical server recovered to the deletion time for a deleted database.

3.A new database on any logical server in any region recovered to the point of the most recent daily backups in geo-replicated blob storage (RA-GRS).

4.All of the above


Ans:4
https://docs.microsoft.com/en-us/azure/sql-database/sql-database-recovery-using-backups



Q66
Which of the following statement/s are true
1.We create a computer object in Active Directory whenever we setup the Cluster. This is the CNO.
2.We create a computer object in Active Directory whenever we create a role that requires a client access point (most roles). This is the VCO.
3VCOs follow the CNO. Whichever OU the CNO is in is where the VCOs will be created.
4.All
5.None

Ans : 4

Q67.Below  statements true or false

1.SQL Server Audit Action Group: SERVER_OPERATION_GROUP:-
This group tracks server operations such as those involving: bulk administration, alter connection, alter resources, alter server state, alter server settings, view server state, external access assembly, unsafe assembly, alter resource governor.

2.SQL Server Audit Action Group : SERVER_OBJECT_CHANGE_GROUP This event is raised for CREATE, ALTER, or DROP operations on server objects.
Equivalent to the Audit Server Object Management Event Class.

3.SQL Server Audit Action Group SERVER_PERMISSION_CHANGE_GROUP This event is raised when a GRANT, REVOKE, or DENY is issued for permissions in the server scope, such as creating a login. Equivalent to the Audit Server Scope GDR Event Class.

4.All
5.None


Q68  In my database  AUTO_CREATE_STATISTICS are enabled will it create multi column statistics?

A.True
B.False

Ans : False

https://www.mssqltips.com/sqlservertutorial/286/database-engine-tuning-advisor/


Q69. What is false about storing data using geo-replicated storage?
Data will be stored in a data center known only to Azure and separate from your chosen data center.
It costs more than local storage
Access to data is quicker for applications that run outside the data center
Provides three additional copies beyond what local replication provides.

Ans: 3
~~~~~~~~~~~~~~~~~~~~~~~~~
Q70. Which is a characteristic of Azure Availability Sets?

   Provides a single point of failure within the architecture.
   Increases availability of the Azure VMs that are part of the same Availability set
   Speeds up performance by requiring VMs in an Availability Set to be part of the same Cloud service
   Availability sets are backed by blob storage




Q72.The D: drive in an Azure VM can be used for what purpose?
As a cache drive for data access due to its proximity to C: drive
As a temp drive for the Azure VM
As a temp drive for SQL Server
A quicker location to store a SQL Server log or data file


Q73:- Which is not a required step to setup Availability Group Listeners?
A.Create the Availability Group Listener using SSMS and Failover Cluster Manager
B.Install KB2854082 on all cluster nodes then reboot the VMs
C.Create load-balanced VM endpoints with Direct Server Return
D.Create Windows Firewall inbound rules for the Remote PowerShell port 5986



















Post a Comment