Monitoring and Managing SQL Server Flashcards

1
Q

VIEW SERVER STATE

A

enables the ability to view current activity, including user activity and recent expensive queries

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

db_accessadmin

A

fixed database role. Members of this group can grant or remove access to a database for SQL Server Logins, Windows Logins and Windows Groups

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

db_securityadmin

A

fixed database role. Members of this role can manage role membership and permissions. Care should be exercised when assigning this role because it can inadvertently lead to privilege escalation for security principles added to the role

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

db_ddladmin

A

fixed database role. This role enables users assigned the role to run any DDL Statement in the database. This includes CREATE, ALTER, DROP, ENABLE TRIGGER, DISABLE TRIGGER, TRUNCATE TABLE, and UPDATE STATISTICS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

serveradmin

A

fixed server role. Members of this role can change server-wide configuration options. Members also have the ability to shut down the server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

sysadmin

A

fixed server role. Members of this role can perform any activity on the server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

securityadmin

A

fixed server role. Members of this role manage logins and their properties including the ability to change passwords for SQL Server Logins

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

VIEW ANY DEFINITION

A

Grants the ability to view server-level definitions such as server level audit views

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

VIEW DEFINITION

A

grants the ability to view database-level definitions such as database level audit views for a specific database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Role required to run DBCC

A

User must either be sysadmin or db_owner

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

REBUILD option with ONLINE = ON will not work on any table with one or more of the following:

A

XML indexes
Spatial indexes
Columnstore indexes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which is an online defragmentation method?
DBCC DBREINDEX or DBCC INDEXDEFRAG
Also, why should neither be used?

A

DBCC INDEXDEFRAG can be used for online defragmentation. Neither should be used due to the commands being scheduled for deprecation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

In order for Auto Update Statistics Asynchronously to take effect, what must also be set?

A

Auto Update Statistics

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does AUTO_UPDATE_STATISTICS_ASYNC do?

A

When enabled, the query optimizer will not wait for the update of statistics but will run the query first and update the outdated statistics afterwards. The query will run with the current statistics and a background process will start to update the statistics in a different thread.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a synchronous statistic update?

A

The query optimizer will update the outdated statistics before compiling the query therefore possibly getting a better plan based on the most current statistics

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

When would you use AUTO_UPDATE_STATISTICS_ASYNC?

A

When a statistic update due to synchronous statistics requires a significant amount of time and your query cannot wait for it to complete

17
Q

When should you not use AUTO_UPDATE_STATISTICS_ASYNC?

A

When a sql execution will significantly change the distribution of your data such as truncating a table or running bulk updates

18
Q

When are statistics considered out of date for versions up to 2014?

A

Threshold is based on the percent of rows changed. If table cardinality was 500 or less, then update for every 500 modifications. Above 500, for every 500 modifications plus 20%

19
Q

When are statistics considered out of date for versions 2016 and beyond?

A

It is determined by the square root of the product of 1000 and the table cardinality. If a table has 2 million rows then sqrt(1000*2,000,000) = 44721.359. So every 44,721 modifications, the stats will update. Previously, it would have updated every 400,500 modifications.

20
Q

What are the database compatibility levels for each sql server version from 2008 to 2017?

A
2008 (100)
2012  (110)
2014  (120)
2016  (130)
2017  (140)
21
Q

Describe the difference between Server Audit, Server Audit Specification and Database Audit?

A

Server Audit is the outcome or output of the auditing operation. Server Audit Specifications are used to specify which objects need to be audited at the server level. Database Audit Specification is at the database level.

22
Q

sys.database_query_store_options

A

used to set the global configuration of the query store

23
Q

sys.query_store_query

A

shows information about the aggregated runtime execution statistics for a given query

24
Q

sys.query_context_settings

A

show details about the query semantics, including language, date format, cursor options, and schema ID

25
Q

sp_query_store_flush_db

A

stored procedure used when you want to write the in-memory portion of the query store to a physical disk

26
Q

sys.sp_xtp_control_query_exec_stats

A

used with natively complied stored procedures for a database instance. It enables per-query statistics information to be collected

27
Q

sys.query_store_plan

A

used to discover the execution plan used by a specific query. Because execution plans for a query can change over time and the Query Store stores historical data, you can potentially identify optimal execution plans for queries to improve performance by used this DMV

28
Q

sys.query_sotre_runtime_stats_interval

A

enables you to see the start and stop time of an interval during which query execution plan statistics were collected. You can correlate this data with other performance measures to potentially improve database performance