You are on page 1of 184

s@lm@n

Microsoft
Exam 70-764
Administering a SQL Database Infrastructure
Version: 8.0

[ Total Questions: 119 ]


Microsoft 70-764 : Practice Test
Question No : 1

You have a database named DB1 that is configured to use the full recovery model. You
have a full daily backup job that runs at 02:00. The job backs up data from DB1 to the file
B:\DB1.bak.

You need to restore the DB1 database to the point in time of May 25, 2016 at 02:23 and
ensure that the database is functional and starts to accept connections.

Which Transact-SQL statement should you run?

A. Option A
B. Option B
C. Option C
D. Option D

Answer: B

Question No : 2 DRAG DROP

You have a test server that contains a database named DB1. Backups of the database are
written to a single backup device. The backup device has a full, differential, and transaction
log backup.

You discover that the database is damaged. You restore the database to the point at which
the differential backup was taken.

2
Microsoft 70-764 : Practice Test
You need to rebuild the database with data stored in the latest transaction logs.

How should you complete the Transact-SQL statement? To answer. drag the appropriate
Transact-SQL segments to the correct locations. Each Transact-SQL segment may be
used once, more than once, or not at all. You may need to drag the split bar between
panes or scroll to view content.

Answer:

3
Microsoft 70-764 : Practice Test
Explanation:

Box 1: RESTORE
Box 2: RECOVERY

The RESTORE ... WITH RECOVERY option puts the database into a useable state, so
users can access a restored database.

References:https://www.mssqltips.com/sqlservertutorial/112/recovering-a-database-that-is-
in-the-restoring-state/

Question No : 3 DRAG DROP

You are designing an authentication strategy for a new server that has SQL Server 2016
installed. The strategy must meet the following business requirements:

✑ The account used to generate reports must be allowed to make a connection


during certain hours only.
✑ Failed authentication requests must be logged.

You need to recommend a technology that meets each business requirement. The solution
must minimize the amount of events that are logged.

Which technologies should you recommend?

To answer, drag the appropriate solution to the correct business requirement in the answer
area.

4
Microsoft 70-764 : Practice Test

Answer:

Explanation:

* Logon triggers fire stored procedures in response to a LOGON event. This event is raised
when a user session is established with an instance of SQL Server. Logon triggers fire after
the authentication phase of logging in finishes, but before the user session is actually
established.

5
Microsoft 70-764 : Practice Test
You can use logon triggers to audit and control server sessions, such as by tracking login
activity, restricting logins to SQL Server, or limiting the number of sessions for a specific
login.

* Login auditing can be configured to write to the error log on the following events.
Failed logins
Successful logins
Both failed and successful logins

Incorrect:
* C2 audit mode can be configured through SQL Server Management Studio or with the c2
audit mode option in sp_configure. Selecting this option will configure the server to record
both failed and successful attempts to access statements and objects.

References:
Logon Triggers
Configure Login Auditing (SQL Server Management Studio)

Question No : 4

You have a SQL Server instance on a server named Server1.

You need to recommend a solution to perform the following tasks every week:

✑ Rebuild the indexes by using a new fill factor.


✑ Run a custom T-SQL command.
✑ Back up the databases.

What should you recommend?

More than one answer choice may achieve the goal. Select the BEST answer.

A. A trigger
B. An alert
C. A maintenance plan
D. Windows PowerShell
E. A system policy

6
Microsoft 70-764 : Practice Test
Answer: C
Explanation:

Maintenance plans create a workflow of the tasks required to make sure that your database
is optimized, regularly backed up, and free of inconsistencies.

Reference: Maintenance Plans

Question No : 5 DRAG DROP

You are designing a database for a university.

The database will contain two tables named Classes and Enrollment that have the
following specifications:

✑ Classes will store brochures in the XPS format. The brochures must be structured
in folders and must be accessible by using UNC paths.
✑ Enrollment will store information about students and their classes. Performance
must be enhanced for queries of the current enrollments.

You need to identify which SQL Server technology meets the specifications of each table.

Which technologies should you identify?

To answer, drag the appropriate technology to the correct table in the answer area.

7
Microsoft 70-764 : Practice Test
Answer:

Explanation:

Note:
* The FileTable feature brings support for the Windows file namespace and compatibility
with Windows applications to the file data stored in SQL Server. FileTable lets an
application integrate its storage and data management components, and provides
integrated SQL Server services - including full-text search and semantic search - over
unstructured data and metadata.
In other words, you can store files and documents in special tables in SQL Server called
FileTables, but access them from Windows applications as if they were stored in the file
system, without making any changes to your client applications.

References:
FileTables (SQL Server)
Partitioned Tables and Indexes

Question No : 6

8
Microsoft 70-764 : Practice Test
You have a customer who has several SQL Server 2012 database servers.

You are designing a data warehouse for the customer. The data warehouse will use
columnstore indexes.

The customer identifies that the following must be supported for the column store indexes.

✑ Data manipulation language (DML) statements


✑ Nonclustered columnstore indexes
✑ Clustered columnstore indexes
✑ Partitioning

You need to identify which technology requires the customer to implement an SQL Server
2016 database.

What should you identify?

A. clustered columnstore indexes


B. nonclustered columnstore indexes
C. data manipulation language (DML) statements
D. partitioning

Answer: A
Explanation: SQL Server 2016 has the features of SQL Server 2012 plus updateable
clustered columnstore indexes. This feature is required here as DML statements must be
supported in the warehouse.

Reference: Columnstore Indexes Described

https://msdn.microsoft.com/en-us/library/gg492088(v=sql.120).aspx

Question No : 7 DRAG DROP

You plan to deploy SQL Server 2016.

Your company identifies the following monitoring requirements:

✑ Tempdb must be monitored for insufficient free space.

9
Microsoft 70-764 : Practice Test
✑ Deadlocks must be analyzed by using Deadlock graphs.

You need to identify which feature meets each monitoring requirement.

Which features should you identify?

To answer, drag the appropriate feature to the correct monitoring requirement in the
answer area.

Answer:

Explanation:

10
Microsoft 70-764 : Practice Test

* You can use the sys.dm_db_file_space_usage dynamic management view to monitor the
disk space used by the user objects, internal objects, and version stores in the tempdb
files. Additionally, to monitor the page allocation or deallocation activity in tempdb at the
session or task level, you can use the sys.dm_db_session_space_usage and
sys.dm_db_task_space_usage dynamic management views. These views can be used to
identify large queries, temporary tables, or table variables that are using a large amount of
tempdb disk space.

*
/ Use SQL Server Profiler to identify the cause of a deadlock. A deadlock occurs when
there is a cyclic dependency between two or more threads, or processes, for some set of
resources within SQL Server. Using SQL Server Profiler, you can create a trace that
records, replays, and displays deadlock events for analysis.

/ SQL Server Profiler and SQL Server Management Studio use a deadlock wait-for graph to
describe a deadlock. The deadlock wait-for graph contains process nodes, resource nodes,
and edges representing the relationships between the processes and the resources.

Question No : 8

Note: This question is part of a series of questions that use the same or similar answer
choices. An answer choice may be correct for more than one question in the series. Each
question is independent of the other questions in this series. Information and details
provided in a question apply only to that question.

You need to examine information about logins, CPU times, and Disk I/O on a particular
database in Microsoft Azure.

What should you use?

A. Activity Monitor
B. Sp_who3
C. SQL Server Management Studio (SSMS) Object Explorer
D. SQL Server Data Collector

11
Microsoft 70-764 : Practice Test
E. SQL Server Data Tools (SSDT)
F. SQL Server Configuration Manager

Answer: A
Explanation:

Activity Monitor displays information about SQL Server processes and how these
processes affect the current instance of SQL Server.
Activity Monitor is a tabbed document window with the following expandable and
collapsible panes: Overview, Active User Tasks, Resource Waits, Data File I/O, and
Recent Expensive Queries.

The Activity User Tasks Pane shows information for active user connections to the
instance, including the following column:
* Login: The SQL Server login name under which the session is currently executing.

The Recent Expensive Queries Pane shows information about the most expensive queries
that have been run on the instance over the last 30 seconds, including the following
column:
* CPU (ms/sec): The rate of CPU use by the query

References:https://technet.microsoft.com/en-us/library/cc879320(v=sql.105).aspx

Question No : 9

You plan to create a database.

The database will be used by a Microsoft .NET application for a special event that will last
for two days.

During the event, data must be highly available.

After the event, the database will be deleted.

12
Microsoft 70-764 : Practice Test
You need to recommend a solution to implement the database while minimizing costs. The
solution must not affect any existing applications.

What should you recommend?

More than one answer choice may achieve the goal. Select the BEST answer.

A. SQL Server 2016 Enterprise


B. SQL Server 2016 Standard
C. SQL Azure
D. SQL Server 2016 Express with Advanced Services

Answer: B
Explanation:

Programmability (AMO, ADOMD.Net, OLEDB, XML/A, ASSL) supported by Standard and


Enterprise editions only.

Reference: Features Supported by the Editions of SQL Server 2016

Question No : 10 DRAG DROP

You plan to deploy a database to SQL Azure.

You are designing two stored procedures named USP_1 and USP_2 that have the
following requirements:

✑ Prevent data read by USP_1 from being modified by other active processes.
✑ Allow USP_2 to perform dirty reads.

You need to recommend the isolation level for the stored procedures.

The solution must maximize concurrency.

Which isolation levels should you recommend?

To answer, drag the appropriate isolation level to the correct stored procedure in the
answer area.

13
Microsoft 70-764 : Practice Test

Answer:

Explanation:

Note:
* SP1: repeatable read
a repeatable read scan retains locks on every row it touches until the end of the

14
Microsoft 70-764 : Practice Test
transaction. Even rows that do not qualify for the query result remain locked. These locks
ensure that the rows touched by the query cannot be updated or deleted by a concurrent
session until the current transaction completes (whether it is committed or rolled back).
* SP2: read uncommitted permits repeatable reads

Question No : 11

You are designing a monitoring application for a new SQL Server 2016 instance.

You need to recommend a solution to generate a report that displays the 10 most frequent
wait types that occur for the instance.

What should you include in the recommendation?

More than one answer choice may achieve the goal. Select the BEST answer.

A. The SQL Server error log


B. The sys.dm_os_wait_stats dynamic management view
C. The DBCC SQLPERF(WAITSTATS) command
D. SQL Server Profiler

Answer: B
Explanation:

sys.dm_os_wait_stats
Returns information about all the waits encountered by threads that executed. You can use
this aggregated view to diagnose performance issues with SQL Server and also with
specific queries and batches.
Columns include:
waiting_tasks_count
Number of waits on this wait type. This counter is incremented at the start of each wait.

Reference:

sys.dm_db_wait_stats (Windows Azure SQL Database)

15
Microsoft 70-764 : Practice Test

Question No : 12 HOTSPOT

You have a Microsoft SQL Server instance that hosts a database named DB1 that contains
800 gigabyte (GB) of data. The database is used 24 hours each day. You implement
indexes and set the value of the Auto Update Statistics option set to True.

Users report that queries take a long time to complete.

You need to identify statistics that have not been updated for a week for tables where more
than 1,000 rows changed.

How should you complete the Transact-SQL statement? To answer, configure the
appropriate Transact-SQL segments in the answer area.

Answer:

16
Microsoft 70-764 : Practice Test

Explanation:

Box 1: stats_date
See example below.

Box 2: rowmodctr

17
Microsoft 70-764 : Practice Test
See examplebelow.

Box 3: stats_date
You need to identify statistics that have not been updated for a week.

Box 4: rowmodctr
You need to identify that more than 1,000 rows changed.
Rowmodctr counts the total number of inserted, deleted, or updated rows since the last
time statistics were updated for the table.

Example: We will query every statistics object which was not updated in the last day and
has rows modified since the last update. We will use the rowmodctr field of sys.sysindexes
because it shows how many rows were inserted, updated or deleted since the last update
occurred. Please note that it is not always 100% accurate in SQL Server 2005 and later,
but it can be used to check if any rows were modified.

--Get the list of outdated statistics


SELECTOBJECT_NAME(id),name,STATS_DATE(id, indid),rowmodctr
FROM sys.sysindexes
WHERE STATS_DATE (id, indid)<=DATEADD(DAY,-1,GETDATE())
AND rowmodctr>0
AND id IN (SELECT object_id FROM sys.tables)
GO
After collecting this information, we can decide which statistics require an update.

References:

Question No : 13 DRAG DROP

You administer a Microsoft SQL Server database named Contoso. You create a stored
procedure named Sales.ReviewInvoice by running the following Transact-SQL statement:

18
Microsoft 70-764 : Practice Test
You need to create a Windows-authenticated login named ContosoSearch and ensure that
ContosoSearch can run the Sales.ReviewInvoices stored procedure.

Which three Transact-SQL segments should you use to develop the solution? To answer,
move the appropriate Transact-SQL segments from the list of Transact-SQL segments to
the answer area and arrange them in the correct order.

Answer:

19
Microsoft 70-764 : Practice Test

Question No : 14 HOTSPOT

You manage a Microsoft SQL Server instance. You have a user named User1.

You need to grant the minimum permissions necessary to allow User1 to review audit logs.

For each action, which option should you use? To answer, select the appropriate options in
the answer area.

20
Microsoft 70-764 : Practice Test

Answer:

Explanation:

21
Microsoft 70-764 : Practice Test

Box 1: securityadmin

To access log files for instances of SQL Server that are online, this requires membership in
the securityadmin fixed server role.

Box 2: sys.server_audit_specifications
sys.server_audit_specifications contains information about the server audit specifications in
a SQL Server audit on a server instance.

Question No : 15

Note: This question is part of a series of questions that present the same scenario. Each
question in the series contains a unique solution that might meet the stated goals. Some
question sets might have more than one correct solution, while others might not have a
correct solution.

After you answer a question in this sections, you will NOT be able to return to it. As a
result, these questions will not appear in the review screen.

A company has a server that runs Microsoft SQL Server 2016 Web edition. The server has

22
Microsoft 70-764 : Practice Test
a default instance that hosts a database named DB1.

You need to ensure that you can perform auditing at the database level for DB1.

Solution: You migrate DB1 to a named instance on a server than runs Microsoft SQL
Server 2016 Standard edition.

Does the solution meet the goal?

A. Yes
B. No

Answer: B
Explanation:

All editions of SQL Server support server level audits. All editions support database level
audits beginning with SQL Server 2016 SP1. Prior to that, database level auditing was
limited to Enterprise, Developer, and Evaluation editions.

References: https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-
server-audit-database-engine

Question No : 16

Note: This question is part of a series of questions that present the same scenario. Each
question in the series contains a unique solution that might meet the stated goals. Some
question sets might have more than one correct solution, while others might not have a
correct solution.

After you answer a question in this sections, you will NOT be able to return to it. As a
result, these questions will not appear in the review screen.

You need to configure a Microsoft SQL Server instance to ensure that a user named Mail1
can send mail by using Database Mail.

23
Microsoft 70-764 : Practice Test
Solution: You add the DatabaseMailUserRole to Mail1 in the msdb database.

Does the solution meet the goal?

A. Yes
B. No

Answer: A
Explanation:

Database Mail is guarded by the database role DatabaseMailUserRole in the msdb


database in order to prevent anyone from sending arbitrary emails. Database users or roles
must be created in the msdb database and must also be a member of
DatabaseMailUserRole in order to send emails with the exception of sysadmin who has all
privileges.

Note: Database Mail was first introduced as a new feature in SQL Server 2005 and
replaces the SQL Mail feature found in previous versions.

References:http://www.idevelopment.info/data/SQLServer/DBA_tips/Database_Administrati
on/DBA_20.shtml

Question No : 17 DRAG DROP

You have a database. The existing backups for the database and their corresponding files
are listed in the following table.

24
Microsoft 70-764 : Practice Test
You purchase a new server. You must restore the database to the new server.

You need to restore the data to the most recent time possible.

Which three files should you restore in sequence? To answer, move the appropriate files
from the list of files to the answer area and arrange them in the correct order.

Answer:

25
Microsoft 70-764 : Practice Test
Explanation:

Step 1: Full..
Start with the full backup.

Step 2: Diff_20160503_1700.bak
Followed by the most recent differential backup.

Step 3: Log_20160503_1900.bak
And finally the most recent log backup (the only log backup done after the most recent
differential backup).

References: https://docs.microsoft.com/en-us/sql/relational-databases/backup-
restore/differential-backups-sql-server

Question No : 18

You have a server named Server1 that has 2 processors.

You plan to deploy multiple instances of SQL Server 2016 to Server1. Each instance will

26
Microsoft 70-764 : Practice Test
have multiple databases.

You need to recommend a method to allocate processor time to each database.

What should you include in the recommendation?

More than one answer choice may achieve the goal. Select the BEST answer.

A. Resource Governor
B. Max Degree of Parallelism
C. Windows System Resource Manager (WSRM)
D. Processor affinity

Answer: A
Explanation:

SQL Server Resource Governor is a feature than you can use to manage SQL Server
workload and system resource consumption. Resource Governor enables you to specify
limits on the amount of CPU, physical IO, and memory that incoming application requests
can use.

Reference: Resource Governor

Incorrect:

D: PROCESS AFFINITY

Enables hardware threads to be associated with CPUs.

Question No : 19

You deploy a database by using SQL Server 2016. The database contains a table named
Table1.

You need to recommend a solution to track all of the deletions executed on Table1. The
solution must minimize the amount of custom code required.

27
Microsoft 70-764 : Practice Test
What should you recommend?

A. Change data capture


B. Statistics
C. A trigger
D. Master Data Services

Answer: A
Explanation:

Change data capture is designed to capture insert, update, and delete activity applied to
SQL Server tables, and to make the details of the changes available in an easily consumed
relational format. The change tables used by change data capture contain columns that
mirror the column structure of a tracked source table, along with the metadata needed to
understand the changes that have occurred.

Reference: About Change Data Capture (SQL Server)

Question No : 20 HOTSPOT

Note: This question is part of a series of questions that use the same scenario. For your
convenience, the scenario is repeated in each question. Each question presents a different
goal and answer choices, but the text of the scenario is exactly the same in each question
in this series.

You are a database administrator for a company that has an on-premises Microsoft SQL
Server environment and Microsoft Azure SQL Database instances. The environment hosts
several customer databases, and each customer uses a dedicated instance. The
environments that you manage are shown in the following table.

28
Microsoft 70-764 : Practice Test

You need to configure monitoring for Tailspin Toys.

In the table below, identify the monitoring tool that you must use for each activity.

NOTE: Make only one selection in each column.

29
Microsoft 70-764 : Practice Test
Answer:

Explanation:

Monitoring from application: Transact-SQL


Transact-SQL can be used to monitor a customized application.

Trend analysis: System Monitor


System Monitor can provide trend analysis.

From question

References:https://docs.microsoft.com/en-us/sql/relational-
databases/performance/performance-monitoring-and-tuning-tools

30
Microsoft 70-764 : Practice Test

Question No : 21

You have a database that stores information for a shipping company. You create a table
named Customers by running the following Transact-SQL statement. (Line numbers are
included for reference only.)

You need to ensure that salespeople can view data only for the customers that are
assigned to them.

Which Transact-SQL segment should you insert at line 07?

A. RETURNS varchar(20)WITH Schemabinding


B. RETURNS dbo.CustomersORDER BY @salesPerson
C. RETURNS tableORDER BY @salesPerson
D. RETURNS tableWITH Schemabinding

Answer: D
Explanation:

The return value can either be a scalar (single) value or a table.


SELECT 1 just selects a 1 for every row, of course. What it's used for in this case is testing
whether any rows exist that match the criteria: if a row exists that matches the WHERE
clause, then it returns 1, otherwise it returns nothing.
Specify the WITH SCHEMABINDING clause when you are creating the function. This
ensures that the objects referenced in the function definition cannot be modified unless the

31
Microsoft 70-764 : Practice Test
function is also modified.

References: https://docs.microsoft.com/en-us/sql/t-sql/statements/create-function-transact-
sql

Question No : 22 DRAG DROP

You use SQL Server 2016 Enterprise Edition. Your database contains a partitioned table
named AuditData. AuditData is partitioned by year. Partition 1 contains data from the year
2010 and prior.

Management has decided to archive all AUDITDATA records from 2010 and prior.
Management wants the records to be removed from the database entirely and provided to
the backup team as a zipped text file. The data must no longer reside in the database.
There is very little tolerance for performance degradation in your environment.

You need to remove all 2010 and prior data from the AuditData table by using the least
amount of system resources possible.

Develop the solution by selecting and arranging the required SQL actions in the correct
order.

You may not need all of the actions.

32
Microsoft 70-764 : Practice Test

Answer:

33
Microsoft 70-764 : Practice Test

Explanation:
Box 1: CREATE TABLE
Box 2: SPLIT RANGE
Box 3: SELECT INTO
Box 4: BCP
Box 5: DROP TABLE
Box 6: DROP PARTITION

Note:
* Create a new partitioned table with the partition function you want, and then insert the
data from the old table into the new table by using an INSERT INTO...SELECT FROM
statement.
* SPLIT RANGE ( boundary_value )
Adds one partition to the partition function. boundary_value determines the range of the
new partition, and must differ from the existing boundary ranges of the partition function.
Based on boundary_value, the Database Engine splits one of the existing ranges into two.
Of these two, the one where the new boundary_value resides is considered the new

34
Microsoft 70-764 : Practice Test
partition.
* BCP can be used to produce the zipped text file.
* Example:
Splitting a partition of a partitioned table or index into two partitions
The following example creates a partition function to partition a table or index into four
partitions. ALTER PARTITION FUNCTION splits one of the partitions into two to create a
total of five partitions.
CREATE PARTITION FUNCTION myRangePF1 (int)
AS RANGE LEFT FOR VALUES ( 1, 100, 1000 );
GO
--Split the partition between boundary_values 100 and 1000
--to create two partitions between boundary_values 100 and 500
--and between boundary_values 500 and 1000.
ALTER PARTITION FUNCTION myRangePF1 ()
SPLIT RANGE (500);

References:
http://technet.microsoft.com/en-us/library/ms186307(v=sql.110).aspx
http://technet.microsoft.com/en-us/library/ms162802(v=sql.120).aspx

Question No : 23

Note: This question is part of a series of questions that use the same scenario. For your
convenience, the scenario is repeated in each question. Each question presents a different
goal and answer choices, but the text of the scenario is exactly the same in each question
in this series.

You are a database administrator for a company that has an on-premises Microsoft SQL
Server environment and Microsoft Azure SQL Database instances. The environment hosts
several customer databases, and each customer uses a dedicated instance. The
environments that you manage are shown in the following table.

35
Microsoft 70-764 : Practice Test

You need to monitor WingDB and gather information for troubleshooting issues.

What should you use?

A. sp_updatestats
B. sp_lock
C. sys.dm_os_waiting_tasks
D. sys.dm_tran_active_snapshot_database_transactions

Answer: B
Explanation:

The sp_lock system stored procedure is packaged with SQL Server and will give you
insight into the locks that are happening on your system. This procedure returns much of its
information from the syslock info in the master database, which is a system table that

36
Microsoft 70-764 : Practice Test
contains information on all granted, converting, and waiting lock requests.

Note: sp_lock will be removed in a future version of Microsoft SQL Server. Avoid using this
feature in new development work, and plan to modify applications that currently use this
feature. To obtain information about locks in the SQL Server Database Engine, use the
sys.dm_tran_locks dynamic management view.
sys.dm_tran_locks returns information about currently active lock manager resources in
SQL Server 2008and later. Each row represents a currently active request to the lock
manager for a lock that has been granted or is waiting to be granted.

References:https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-
procedures/sp-lock-transact-sql

Question No : 24

You use SQL Server 2016 to maintain the data used by applications at your company.

You want to execute two statements.

You need to guarantee that either both statements succeed, or both statements fail
together as a batch.

Which code should you use?

37
Microsoft 70-764 : Practice Test

38
Microsoft 70-764 : Practice Test
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E

Answer: D
Explanation:

Structure should be:


BEGIN TRY
BEGIN TRANSACTION
COMMIT TRANSACTION
END TRY
BEGIN CATCH
ROLLBACK TRANSACTION
END CATCH.

Reference: TRY...CATCH (Transact-SQL)

Question No : 25 DRAG DROP

Note: This question is part of a series of questions that use the same scenario. For your
convenience, the scenario is repeated in each question. Each question presents a different
goal and answer choices, but the text of the scenario is exactly the same in each question
in this series.

You have five servers that run Microsoft Windows 2012 R2. Each server hosts a Microsoft
SQL Server instance. The topology for the environment is shown in the following diagram.

39
Microsoft 70-764 : Practice Test

You have an Always On Availability group named AG1. The details for AG1 are shown in
the following table.

Instance1 experiences heavy read-write traffic. The instance hosts a database named
OperationsMain that is four terabytes (TB) in size. The database has multiple data files and
filegroups. One of the filegroups is read_only and is half of the total database size.

Instance4 and Instance5 are not part of AG1. Instance4 is engaged in heavy read-write I/O.

Instance5 hosts a database named StagedExternal. A nightly BULK INSERT process loads
data into an empty table that has a rowstore clustered index and two nonclustered rowstore
indexes.

You must minimize the growth of the StagedExternal database log file during the BULK
INSERT operations and perform point-in-time recovery after the BULK INSERT transaction.
Changes made must not interrupt the log backup chain.

You plan to add a new instance named Instance6 to a datacenter that is geographically
distant from Site1 and Site2. You must minimize latency between the nodes in AG1.

40
Microsoft 70-764 : Practice Test
All databases use the full recovery model. All backups are written to the network location
\\SQLBackup\. A separate process copies backups to an offsite location. You should
minimize both the time required to restore the databases and the space required to store
backups. The recovery point objective (RPO) for each instance is shown in the following
table.

Full backups of OperationsMain take longer than six hours to complete. All SQL Server
backups use the keyword COMPRESSION.

You plan to deploy the following solutions to the environment. The solutions will access a
database named DB1 that is part of AG1.

The wait statistics monitoring requirements for the instances are described in the following
table.

You need to analyze the wait type and statistics for specific instanced in the environment.

Which object should you use to gather information about each instance? To answer, drag
the appropriate objects to the correct instances. Each object may be used once, more than
once, or not at all. You may need to drag the split bar between panes or scroll to view
content.

NOTE: Each correct selection is worth one point.

41
Microsoft 70-764 : Practice Test

Answer:

Explanation:

42
Microsoft 70-764 : Practice Test

Instance 1: sys.dm_exec_query_stats
From Scenario: Instance1 requirement: Aggregate statistics since last server restart.
sys.dm_exec_query_stats returns aggregate performance statistics for cachedquery plans
in SQL Server.

Instance 4: sys.dm_os_wait_stats
sys.dm_os_wait_statsreturns information about all the waits encountered by threads that
executed.
From Scenario: Instance4 requirement: Identify the most prominent wait types.

Instance 5:sys.dm_exec_session_wait_stats
From Scenario: Instance5 requirement: Identify all wait types for queries currently running
on the server.
sys.dm_exec_session_wait_stats returns information about all the waits encountered by
threads that executed for each session.

Question No : 26

43
Microsoft 70-764 : Practice Test
You are the administrator for a SQL Server 2016 instance that stores the data for an online
transaction processing sales system.

The company takes full backups every week; differential backups on the days with no full
backups; and hourly transaction backups. These backups are stored on a backup server in
the company's data center.

Every week, the company places the full backup on a tape and sends it to a third-party
backup storage system.

The company is worried that a disaster might occur that could destroy their computer
center and cause them to lose orders.

You need to determine the best method for providing the smallest amount of data loss and
downtime without leasing or purchasing additional physical locations.

What should you do? More than one answer choice may achieve the goal. Select the BEST
answer.

A. Set up SQL Server Always On with a SQL Azure database as a replica.


B. Set up SQL Server Always On by using a SQL Server on a Windows Azure Virtual
Machine.
C. Put the differential backup on tape and send it to the third-party backup storage system.
D. Use the Microsoft SQL Server Backup to Microsoft Windows Azure Tool to direct all
backups to a different geographical location.

Answer: D
Explanation:

SQL Server 2012 was the first version to provide the ability to back up databases to the
Cloud, and SQL Server 2016 improves on the process.

Microsoft SQL Server Backup to Windows Azure Tool enables backup to Windows Azure
Blob Storage and encrypts and compresses SQL Server backups stored locally or in the
cloud.

Reference:

Smart, Secure, Cost-Effective: SQL Server Back Up to Windows Azure - SQL Server Team
Blog - Site Home - TechNet Blogs

44
Microsoft 70-764 : Practice Test

Question No : 27

You are designing a SQL Server database for an order fulfillment system.

You create a table named Sales.Orders by using the following script:

Each order is tracked by using one of the following statuses:

✑ Fulfilled
✑ Shipped
✑ Ordered
✑ Received

You need to design the database to ensure that you can retrieve the status of an order on a
given date. The solution must ensure that new statuses can be added in the future.

What should you do?

More than one answer choice may achieve the goal. Select the BEST answer.

A. Implement change data capture on the Sales.Orders table.


B. To the Sales.Orders table, add a column named Status that will store the order status.
Update the Status column as the order status changes.
C. Create a new table named Sales.OrderStatus that contains three columns named
OrderID, StatusDate, and Status. Insert new rows into the table as the order status
changes.
D. To the Sales.Orders table, add three columns named FulfilledDate, ShippedDate, and
ReceivedDate. Update the value of each column from null to the appropriate date as the
order status changes.

Answer: B

45
Microsoft 70-764 : Practice Test
Question No : 28

You need to recommend a solution to allow application users to perform UPDATE


operations on the database tables. The solution must meet the business requirements.

What should you recommend?

A. Create a user-defined database role and add users to the role.


B. Create stored procedures that use EXECUTE AS clauses.
C. Create a Policy-Based Management Policy.
D. Create functions that use EXECUTE AS clauses.

Answer: B

Question No : 29

Note: This question is part of a series of questions that use the same or similar answer
choices. An answer choice may be correct for more than one question in the series. Each
question is independent of the other questions in this series. Information and details
provided in a question apply only to that question.

You are the database administrator for a company that hosts Microsoft SQL Server. You
manage both on-premises and Microsoft Azure SQL Database environments.

You have a user database named HRDB that contains sensitive human resources data.
The HRDB backup files must be encrypted.

You need to grant the correct permission to the service account that backs up the HRDB
database.

Which permission should you grant?

A. DDLAdmin
B. db_datawriter
C. dbcreator
D. dbo
E. View Database State
F. View Server State

46
Microsoft 70-764 : Practice Test
G. View Definition
H. sysadmin

Answer: G
Explanation:

Restoring the encrypted backup: SQL Server restore does not require any encryption
parameters to be specified during restores. It does require that the certificate or the
asymmetric key used to encrypt the backup file be available on the instance that you are
restoring to. The user account performing the restore must have VIEW DEFINITION
permissions on the certificate or key.

References: https://docs.microsoft.com/en-us/sql/relational-databases/backup-
restore/backup-encryption

Question No : 30

Note: This question is part of a series of questions that present the same scenario. Each
question in the series contains a unique solution that might meet the stated goals. Some
question sets might have more than one correct solution, while others might not have a
correct solution.

After you answer a question in this sections, you will NOT be able to return to it. As a
result, these questions will not appear in the review screen.

A company has an on-premises Microsoft SQL Server environment and Microsoft Azure
SQL Database instances. The environment hosts several customer databases.

One customer reports that their database is not responding as quickly as the service level
agreements dictate. You observe that the database is fragmented.

You need to optimize query performance.

Solution: You rebuild all indexes.

47
Microsoft 70-764 : Practice Test
Does the solution meet the goal?

A. Yes
B. No

Answer: A
Explanation:

You can remedy index fragmentation by either reorganizing an index or by rebuilding an


index.

References:https://msdn.microsoft.com/en-us/library/ms189858(v=sql.105).aspx

Question No : 31 HOTSPOT

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.

How should you complete the Transact-SQL code statement? To answer, select the
appropriate Transact-SQL code segments in the dialog box in the answer area.

48
Microsoft 70-764 : Practice Test
Answer:

Explanation:

Box 1: CHECKCONSTRAINTS
DBCC CHECKCONSTRAINTS checks the integrity of a specified constraint or all
constraints on a specified table in the current database.

Box 2: ALL_CONSTRAINTS
ALL_CONSTRAINTS checks all enabled and disabled constraints on the table if the table
name is specified or if all tables are checked;otherwise, checks only the enabled constraint.

Note: Syntax: DBCC CHECKCONSTRAINTS


[
(
table_name | table_id | constraint_name | constraint_id
)
]
[ WITH
[ { ALL_CONSTRAINTS | ALL_ERRORMSGS } ]
[ , ] [NO_INFOMSGS ]
]

References: https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-

49
Microsoft 70-764 : Practice Test
checkconstraints-transact-sql

Question No : 32 HOTSPOT

You use SQL Server 2016. You create a table within a database by using the following
DDL:

The following table illustrates a representative sample of data:

The system is expected to handle 50 million orders a month over the next five years.

You have been instructed by your Team Lead to follow best practices for storage and

50
Microsoft 70-764 : Practice Test
performance in the utilization of SPARSE columns.

Which columns should you designate as SPARSE? To answer, mark each column as
SPARSE or NOT SPARSE in the answer area.

Answer:

51
Microsoft 70-764 : Practice Test

Explanation:

Note:
Sparse columns are ordinary columns that have an optimized storage for null values.

52
Microsoft 70-764 : Practice Test
Sparse columns reduce the space requirements for null values at the cost of more
overhead to retrieve nonnull values. Consider using sparse columns when the space saved
is at least 20 percent to 40 percent.

Question No : 33

Note: This question is part of a series of questions that use the same scenario. For your
convenience, the scenario is repeated in each question. Each question presents a different
goal and answer choices, but the text of the scenario is exactly the same in each question
in this series.

You have five servers that run Microsoft Windows 2012 R2. Each server hosts a Microsoft
SQL Server instance. The topology for the environment is shown in the following diagram.

You have an Always On Availability group named AG1. The details for AG1 are shown in
the following table.

53
Microsoft 70-764 : Practice Test
Instance1 experiences heavy read-write traffic. The instance hosts a database named
OperationsMain that is four terabytes (TB) in size. The database has multiple data files and
filegroups. One of the filegroups is read_only and is half of the total database size.

Instance4 and Instance5 are not part of AG1. Instance4 is engaged in heavy read-write I/O.

Instance5 hosts a database named StagedExternal. A nightly BULK INSERT process loads
data into an empty table that has a rowstore clustered index and two nonclustered rowstore
indexes.

You must minimize the growth of the StagedExternal database log file during the BULK
INSERT operations and perform point-in-time recovery after the BULK INSERT transaction.
Changes made must not interrupt the log backup chain.

You plan to add a new instance named Instance6 to a datacenter that is geographically
distant from Site1 and Site2. You must minimize latency between the nodes in AG1.

All databases use the full recovery model. All backups are written to the network location
\\SQLBackup\. A separate process copies backups to an offsite location. You should
minimize both the time required to restore the databases and the space required to store
backups. The recovery point objective (RPO) for each instance is shown in the following
table.

Full backups of OperationsMain take longer than six hours to complete. All SQL Server
backups use the keyword COMPRESSION.

You plan to deploy the following solutions to the environment. The solutions will access a
database named DB1 that is part of AG1.

The wait statistics monitoring requirements for the instances are described in the following

54
Microsoft 70-764 : Practice Test
table.

You need to create a backup plan for Instance4.

Which backup plan should you create?

A. Weekly full backups, nightly differential. No transaction log backups are necessary.
B. Weekly full backups, nightly differential backups, transaction log backups every 5
minutes.
C. Weekly full backups, nightly differential backups, transaction log backups every 12
hours.
D. Weekly full backups, nightly differential backups, nightly transaction log backups.

Answer: B
Explanation:

From scenario: Instance4 and Instance5 are not part of AG1. Instance4 is engaged in
heavy read-write I/O. The recovery point objective of Instancse4 is 60 minutes.
RecoveryPoint Objectives are commonly described as the amount of data that was lost
during the outage and recovery period.

References:http://sqlmag.com/blog/sql-server-recovery-time-objectives-and-recovery-point-
objectives

Question No : 34 DRAG DROP

You are planning to deploy a database to Windows Azure SQL Database.

55
Microsoft 70-764 : Practice Test
You need to design a stored procedure to update rows. The stored procedure must meet
the following requirements:

✑ If the update fails, an error must be raised to the application and the update must
be discarded.
✑ The stored procedure must be designed to maximize concurrency.

What should you include in your design?

To answer, move the appropriate actions from the list of actions to the answer area and
arrange them in the correct order.

Answer:

Explanation:
Box 1: Begin an explicit transaction.
Box 2: Perform an update in a try block.
Box 3: Read the @@ROWCOUNT system variable.

56
Microsoft 70-764 : Practice Test
Box 4: Raise an error and roll back the transaction if the row count is less than 1.
Box 5: Commit the transaction in a finally block.

Note:
* Read Committed is SQL Server's default isolation level.
* @@ROWCOUNT
eturns the number of rows affected by the last statement.
* Using TRY…CATCH in a transaction
The following example shows how a TRY…CATCH block works inside a transaction. The
statement inside the TRY block generates a constraint violation error.
BEGIN TRANSACTION;

BEGIN TRY
-- Generate a constraint violation error.
DELETE FROM Production.Product
WHERE ProductID = 980;
END TRY
BEGIN CATCH
SELECT
ERROR_NUMBER() AS ErrorNumber
,ERROR_SEVERITY() AS ErrorSeverity
,ERROR_STATE() AS ErrorState
,ERROR_PROCEDURE() AS ErrorProcedure
,ERROR_LINE() AS ErrorLine
,ERROR_MESSAGE() AS ErrorMessage;

IF @@TRANCOUNT > 0
ROLLBACK TRANSACTION;
END CATCH;

IF @@TRANCOUNT > 0
COMMIT TRANSACTION;
GO

Question No : 35

You manage a SQL Server 2016 instance that contains a database named DB1.

57
Microsoft 70-764 : Practice Test
Users report that some queries to DB1 take longer than expected. Although most queries
run in less than one second, some queries take up to 20 seconds to run.

You need to view all of the performance statistics for each database file.

Which method should you use?

A. Query the sys.dm_os_tasks dynamic management view.


B. Query the sys.dm_os_performance_counters dynamic management view.
C. Query the sys.dm_io_virtual_file_stats dynamic management function.
D. Examine the Data File I/O pane in Activity Monitor.

Answer: C
Explanation:

sys.dm_io_virtual_file_stats
Returns I/O statistics for data and log files.

Reference: sys.dm_io_virtual_file_stats (Transact-SQL)

Question No : 36

You are troubleshooting an application that runs a query. The application frequently causes
deadlocks.

You need to identify which transaction causes the deadlock.

What should you do?

More than one answer choice may achieve the goal. Select the BEST answer.

A. Query the sys.dm_exec_sessions dynamic management view.


B. Query the sys.dm_exec_requests dynamic management view.
C. Create a trace in SQL Server Profiler that contains the Deadlock graph event
D. Create an extended events session to capture deadlock information.

Answer: D

58
Microsoft 70-764 : Practice Test
Explanation:

Troubleshooting deadlocks
You have been receiving reports from users indicating that certain applications are
returning deadlock errors. To maximize the effectiveness of troubleshooting these
problems, you decide to focus on the deadlocks that are hit most frequently. You create an
Extended Events session that:

/ Configures deadlock event tracking for the session.


/ Specifies a target that aggregates based on an identifier for the deadlock.

You run the Extended Events session, and after additional deadlocks are reported you are
able to obtain aggregated deadlock information, along with the complete XML deadlock
graph for each source. Using this information you are able to pin point the most common
deadlocks and start working on a solution.
Create an Extended Events Session
View Event Session Data

Question No : 37

You have a database named DB1 that stores more than 700 gigabyte (GB) of data and
serves millions of requests per hour.

Queries on DB1 are taking longer than normal to complete.

You run the following Transact-SQL statement:

SELECT * FROM sys.database_query_store_options

You determine that the Query Store is in Read-Only mode.

You need to maximize the time that the Query Store is in Read-Write mode.

Which Transact-SQL statement should you run?

59
Microsoft 70-764 : Practice Test
A. ALTER DATABASE DB1SET QUERY_STORE (QUERY_CAPTURE_MODE = ALL)
B. ALTER DATABASE DB1SET QUERY_STORE (MAX_STORAGE_SIZE_MB = 50)
C. ALTER DATABASE DB1SET QUERY_STORE (CLEANUP_POLICY =
(STALE_QUERY_THRESHOLD_DAYS = 14));
D. ALTER DATABASE DB1SET QUERY_STORE (QUERY_CAPTURE_MODE = NONE)

Answer: C
Explanation:

Stale Query Threshold (Days): Time-based cleanup policy that controls the retention period
of persisted runtime statistics and inactive queries.
By default, Query Store is configured to keep the data for 30 days which may be
unnecessarily long for your scenario.
Avoid keeping historical data that you do not plan to use. This will reduce changes to read-
only status. The size of Query Store data as well as the time to detect and mitigate the
issue will be more predictable. Use Management Studio or the following script to configure
time-based cleanup policy:

ALTER DATABASE [QueryStoreDB]


SET QUERY_STORE (CLEANUP_POLICY = (STALE_QUERY_THRESHOLD_DAYS =
14));

References:https://docs.microsoft.com/en-us/sql/relational-databases/performance/best-
practice-with-the-query-store

Question No : 38

You have a server that has SQL Server 2016 installed. The server contains 100 user
databases.

You need to recommend a backup solution for the user databases.

The solution must meet the following requirements:

✑ Perform a transaction log backup every hour.


✑ Perform a full backup of each database every week.

60
Microsoft 70-764 : Practice Test
✑ Perform a differential backup of each database every day.
✑ Ensure that new user databases are added automatically to the backup solution.

What should you recommend?

More than one answer choice may achieve the goal. Select the BEST answer.

A. Policy-Based Management
B. A Data Definition Language (DDL) trigger
C. SQL Server Agent jobs
D. A maintenance plan

Answer: D
Explanation:

Maintenance plans create a workflow of the tasks required to make sure that your database
is optimized, regularly backed up, and free of inconsistencies.

Maintenance plans can be created to perform the following task (among others):
Back up the database and transaction log files. Database and log backups can be retained
for a specified period. This lets you create a history of backups to be used if you have to
restore the database to a time earlier than the last database backup. You can also perform
differential backups.

Reference: Maintenance Plans

Question No : 39 DRAG DROP

You have a database named DB1. DB1 contains a table named Sales.SalesPerson that
has an index named AK_SalesPerson_rowguid. Queries that do not use the index take
approximately 10 times longer to complete than queries that use the index.

You discover that AK_SalesPerson_rowguid has severe fragmentation.

You need to recommend a solution to defragment the index. The solution must ensure that
the index can be used by queries during the defragmentation.

What statement should you use? To answer, drag the appropriate elements to the correct

61
Microsoft 70-764 : Practice Test
locations. Each element may be used once, more than once, or not at all. You may need to
drag the split bar between panes or scroll to view content.

Answer:

Explanation:

Rebuilding an index can be executed online or offline. Reorganizing an index is always


executed online. To achieve availability similar to the reorganize option, you should rebuild
indexes online.
Use: ALTER INDEX REBUILD WITH (ONLINE = ON)

62
Microsoft 70-764 : Practice Test
Question No : 40 HOTSPOT

You manage a Microsoft SQL Server environment. A server fails and writes the following
event to the application event log:

MSG_AUDIT_FORCED_SHUTDOWN

You configure the SQL Server startup parameters as shown in the following graphic:

Use the drop-down menus to select the answer choice that answers each question.

63
Microsoft 70-764 : Practice Test
NOTE: Each correct selection is worth one point.

Answer:

Explanation:

64
Microsoft 70-764 : Practice Test

Box 1: single-user
The startup option -m starts an instance of SQL Server in single-user mode.

Box 2: sysadmin
Starting SQL Server in single-user mode enables anymember of the computer's local
Administrators group to connect to the instance of SQL Server as a member of the
sysadmin fixed server role.

References:https://docs.microsoft.com/en-us/sql/database-engine/configure-
windows/database-engine-service-startup-options

Question No : 41 DRAG DROP

You are configuring a new Microsoft SQL Server Always On Availability Group. You plan to
configure a shared network location at \\DATA-CI1\SQL.

You need to create an availability group listener named AGL1 on port 1433.

In which order should you perform the actions? To answer, move all actions from the list of
actions to the answer area and arrange them in the correct order.

65
Microsoft 70-764 : Practice Test

Answer:

Explanation:

66
Microsoft 70-764 : Practice Test

Step 1: Launch the Failover Cluster Manager and..


To support theAlways On availability groups feature, ensure that every computer that is to
participate in one or more availability groups meets requirements including:
* Ensure that each computer is a node in a WSFC (Windows Server Failover Clustering).

Step 2: Add andconfigure the replica and…


All the server instances that host availability replicas for an availability group must use the
same SQL Server collation.

Step 3: Enable the SQL Server 2016 Always On Availability Group feature.
Enable the Always On availability groups feature on each server instance that will host an
availability replica for any availability group. On a given computer, you can enable as many
server instances for Always On availability groups as your SQL Server installation
supports.

Step 4: Create the Always On Availability Group and..


Using Transact-SQL to create or configure an availability group listener

67
Microsoft 70-764 : Practice Test
Step 5: Select the Full data synchronization method and…

References:

Question No : 42

You are the new database administrator for a SQL Server 2016 instance.

You conduct an assessment on the instance and determine that the auto create statistics
setting on the database named DB1 has been turned off. You see no evidence that any
maintenance has been occurring.

You want to set up monitoring to see if query performance is being affected.

You need to set up a monitoring process that will capture any cases where statistics could
have been useful if they existed.

What should you do?

A. Create a SQL Server Agent job to execute DBCC SHOWSTATISTICS on each of the
primary key columns in the database.
B. Use the missing_column_statistics extended event.
C. Query the sys.statistics system view to see all cases where the statistics were last
needed.
D. Write a query using the sys.dm_db_missing_index_group_stats DMV Joining to
sys.indexes, filtering on is_hypothetical.

Answer: B
Explanation:

The Missing Column Statistics event class indicates that column statistics that could have
been useful for the optimizer are not available.
By monitoring the Missing Column Statistics event class, you can determine if there are
statistics missing for a column used by a query. This can cause the optimizer to choose a
less efficient query plan than expected.

Reference: Missing Column Statistics Event Class

68
Microsoft 70-764 : Practice Test

Question No : 43

Note: This question is part of a series of questions that present the same scenario. Each
question in the series contains a unique solution that might meet the stated goals. Some
question sets might have more than one correct solution, while others might not have a
correct solution.

After you answer a question in this sections, you will NOT be able to return to it. As a
result, these questions will not appear in the review screen.

You need to configure a Microsoft SQL Server instance to ensure that a user named Mail1
can send mail by using Database Mail.

Solution: You add the DatabaseMailUserRole to Mail1 in the tempdb database.

Does the solution meet the goal?

A. Yes
B. No

Answer: B
Explanation:

Database Mail is guarded by the database role DatabaseMailUserRole in the msdb


database, not the tempdb database, in order to prevent anyone from sending arbitrary
emails. Database users or roles must be created in the msdb database and must also be a
member of DatabaseMailUserRole in order to send emails with the exception of sysadmin
who has all privileges.

Note: Database Mail was first introduced as a new feature in SQLServer 2005 and replaces
the SQL Mail feature found in previous versions.

References:http://www.idevelopment.info/data/SQLServer/DBA_tips/Database_Administrati
on/DBA_20.shtml

69
Microsoft 70-764 : Practice Test

Question No : 44 DRAG DROP

You plan to deploy a database by using SQL Server 2016.

Your company identifies the following requirements for the database:

✑ The name of all stored procedures must start with "usp_"always.


✑ All distribution statistics must be updated daily.

You need to identify which feature must be used to meet each database requirement.

Which features should you identify?

To answer, drag the appropriate feature to the correct database requirement in the answer
area.

Answer:

Explanation:

70
Microsoft 70-764 : Practice Test

* Policy-Based Management
Each Stored Procedure that are created and that will be created has to have prefix “USP_”.

* Maintenance plans create a workflow of the tasks required to make sure that your
database is optimized, regularly backed up, and free of inconsistencies.

References:
How to: Create and Configure a Policy-Based Management Policy
Maintenance Plans

Question No : 45 DRAG DROP

You have a server named SQL1 that has SQL Server 2016 installed. SQL1 hosts a
database named Database! Database1 contains a table named Table1. Table1 is
partitioned across five filegroups based on the TransactionType field.

The schema of Table1 is configured as shown in the following table.

71
Microsoft 70-764 : Practice Test
Table1 contains the indexes shown in the following table.

You need to recommend an index strategy to maximize performance for the queries that
consume the indexes available to Table1.

Which type of index storage should you recommend?

To answer, drag the appropriate index storage type to the correct index in the answer area.

Answer:

72
Microsoft 70-764 : Practice Test

Explanation:

Note:
Index Storage Type
* Designing a partitioned index independently (unaligned) of the base table can be useful in
the following cases:
/The base table has not been partitioned.
/The index key is unique and it does not contain the partitioning column of the table.
/ You want the base table to participate in collocated joins with more tables using different
join columns.
Partitioned Tables and Indexes

Question No : 46

You have an SQL Server 2016 server named SQL1.

73
Microsoft 70-764 : Practice Test
You are designing a performance monitoring solution.

You need to monitor the following events on SQL1:

✑ A deadlock graph
✑ Missing column statistics
✑ CPU performance statistics
✑ A batch of completed Transact-SQL statements

Which two tools should you use? Each correct answer presents a complete solution.

A. dynamic management views


B. Database Engine Tuning Advisor
C. SQL Server Profiler
D. Activity Monitor
E. Data Profile Viewer

Answer: B,C
Explanation: B: Database Engine Tuning Advisor examines how queries are processed in
the databases you specify.
When you run a Profiler Trace and feed it to the Database Engine Tuning Advisor, it also
looks for missing column statistics, and it can automatically create them for you.
C: Use SQL Server Profiler to identify the cause of a deadlock. A deadlock occurs when
there is a cyclic dependency between two or more threads, or processes, for some set of
resources within SQL Server. Using SQL Server Profiler, you can create a trace that
records, replays, and displays deadlock events for analysis.

Reference: Analyze Deadlocks with SQL Server Profiler

https://msdn.microsoft.com/en-us/library/ms188246.aspx

Reference: Mastering SQL Server Profiler, page 245

Question No : 47

You have a server named Server1 that has 16 processors.

You plan to deploy multiple instances of SQL Server 2016 to Server1.

74
Microsoft 70-764 : Practice Test
You need to recommend a method to allocate processors to each instance.

What should you include in the recommendation?

More than one answer choice may achieve the goal. Select the BEST answer.

A. Processor affinity
B. Windows System Resource Manager (WSRM)
C. Max Degree of Parallelism
D. Resource Governor

Answer: A
Explanation:

CPU affinity management through Windows System Resource Manager is not


recommended for SQL Server multi-instance management. Instead, use the processor
affinity settings in SQL Server.

Reference: Server Properties (Processors Page)

Question No : 48 DRAG DROP

You have two servers named SQL1 and SQL2 that have SQL Server 2012 installed. SQL1
contains a database that is mirrored asynchronously to SQL2. The database contents are
updated once a month.

You need to upgrade the database to SQL Server 2016. The solution must minimize
downtime.

Which upgrade steps should you recommend?

To answer, move the appropriate actions from the list of actions to the answer area and
arrange them in the correct order.

75
Microsoft 70-764 : Practice Test

Answer:

Explanation:
Box 1: Fail over.
Box 2: Upgrade SQL1.
Box 3: Upgrade SQL2.
Box 4: Establish a mirror.

Note:
* To perform the rolling upgrade
Step 1: For each mirroring session, whose mirror server instance has just been upgraded,
wait for the session to synchronize. Then, connect to the principal server instance, and
manually fail over the session.

76
Microsoft 70-764 : Practice Test
Step 2: Upgrade each server instance that is now the mirror server in all mirroring sessions
in which it is a partner.
Step 3: Resume the mirroring session.

* When upgrading server instances to SQL Server 2016, you can reduce downtime for
each mirrored database to only a single manual failover by performing a sequential
upgrade, known as a rolling upgrade. A rolling upgrade is a multi-stage process that in its
simplest form involves upgrading the server instance that is currently acting as the mirror
server in a mirroring session, then manually failing over the mirrored database, upgrading
the former principal server, and resuming mirroring

Question No : 49

You have a database named DB1.

You plan to create a stored procedure that will insert rows into three different tables. Each
insert must use the same identifying value for each table, but the value must increase from
one invocation of the stored procedure to the next.

Occasionally, the identifying value must be reset to its initial value.

You need to design a mechanism to hold the identifying values for the stored procedure to
use.

What should you do?

More than one answer choice may achieve the goal. Select the BEST answer.

A. Create a sequence object that holds the next value in the sequence. Retrieve the next
value by using the stored procedure. Reset the value by using an ALTER SEQUENCE
statement as needed.
B. Create a sequence object that holds the next value in the sequence. Retrieve the next
value by using the stored procedure. Increment the sequence object to the next value by
using an ALTER SEQUENCE statement. Reset the value as needed by using a different
ALTER SEQUENCE statement.
C. Create a fourth table that holds the next value in the sequence. At the end each
transaction, update the value by using the stored procedure. Reset the value as needed by
using an UPDATE statement.
D. Create an identity column in each of the three tables. Use the same seed and the same

77
Microsoft 70-764 : Practice Test
increment for each table. Insert new rows into the tables by using the stored procedure.
Use the DBCC CHECKIDENT command to reset the columns as needed.

Answer: A
Explanation:

* an application can obtain the next sequence number without inserting the row by calling
the NEXT VALUE FOR function.
* ALTER SEQUENCE
Includes argument:
RESTART [ WITH <constant> ]
The next value that will be returned by the sequence object. If provided, the RESTART
WITH value must be an integer that is less than or equal to the maximum and greater than
or equal to the minimum value of the sequence object. If the WITH value is omitted, the
sequence numbering restarts based on the original CREATE SEQUENCE options.

* CREATE SEQUENCE
Creates a sequence object and specifies its properties. A sequence is a user-defined
schema bound object that generates a sequence of numeric values according to the
specification with which the sequence was created. The sequence of numeric values is
generated in an ascending or descending order at a defined interval and can be configured
to restart (cycle) when exhausted.
Sequence Numbers

Question No : 50

You manage a Microsoft SQL Server environment. You plan to encrypt data when you
create backups.

You need to configure the encryption options for backups.

What should you configure?

A. a certificate
B. an MD5 hash
C. a DES key

78
Microsoft 70-764 : Practice Test
D. an AES 256-bit key

Answer: D
Explanation:

To encrypt during backup, you must specify an encryption algorithm, and an encryptor to
secure the encryption key. The following are the supported encryption options:
Encryption Algorithm: The supported encryption algorithms are: AES 128, AES 192, AES
256, and Triple DES
Encryptor: A certificate or asymmetric Key

References:https://docs.microsoft.com/en-us/sql/relational-databases/backup-
restore/backup-encryption

Question No : 51

You have two SQL Server 2016 instances named SQLDev and SQLProd.

You plan to create a new database on SQLProd that will use SQL Server Authentication.

You need to ensure that when the new database is copied from SQLProd to SQLDev,
users can connect to the database on SQLDev even if they do not have a login on the
SQLDev instance.

What should you use?

More than one answer choice may achieve the goal. Select the BEST answer.

A. Triggers
B. Contained database
C. SQL Server Analysis Services (SSAS) scripts
D. Extended Events
E. SQL Server Integration Services (SSIS) scripts

Answer: B

79
Microsoft 70-764 : Practice Test
Explanation:

A fully contained database includes all the settings and metadata required to define the
database and has no configuration dependencies on the instance of the SQL Server
Database Engine where the database is installed.

Reference: Contained Databases

Question No : 52 DRAG DROP

You plan to deploy three highly available SQL Server environments that will use SQL
Server 2016.

You identify the following specifications for each environment as shown following table.

You need to recommend which high-availability feature is required for each environment.

Which features should you identify?

To answer, drag the appropriate feature to the correct requirement in the answer area.

80
Microsoft 70-764 : Practice Test
Answer:

Explanation:

* Always on availability groups


The 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.
Deploying AlwaysOn Availability Groups requires a Windows Server Failover Clustering
(WSFC) cluster.

References:
AlwaysOn Availability Groups (SQL Server)
Features Supported by the Editions of SQL Server 2016

81
Microsoft 70-764 : Practice Test

Question No : 53 HOTSPOT

Note: This question is part of a series of questions that use the same scenario. For your
convenience, the scenario is repeated in each question. Each question presents a different
goal and answer choices, but the text of the scenario is exactly the same in each question
in this series.

You are a database administrator for a company that has an on-premises Microsoft SQL
Server environment and Microsoft Azure SQL Database instances. The environment hosts
several customer databases, and each customer uses a dedicated instance. The
environments that you manage are shown in the following table.

82
Microsoft 70-764 : Practice Test
You need to configure auditing for the Adventure Works environment.

How should you complete the Transact-SQL statement? To answer, select the appropriate
options in the answer area.

NOTE: Each correct selection is worth one point.

Answer:

83
Microsoft 70-764 : Practice Test

Explanation:

84
Microsoft 70-764 : Practice Test

Box 1: CREATE SERVER AUDIT


Create the server audit.
You must implement auditing to record access to data that is considered sensitive by the
company.
Create database audit

Box 2: ALTER SERVER AUDIT


Enable the server audit.

Box 3: CREATE DATABASE AUDIT


Create the database audit specification.

Box 4: FOR SERVER AUDIIT


You must implement auditing for all objects in the ADVSchema.

85
Microsoft 70-764 : Practice Test
References:

Question No : 54

Note: This question is part of a series of questions that use the same or similar answer
choices. An answer choice may be correct for more than one question in the series. Each
question is independent of the other questions in this series. Information and details
provided in a question apply only to that question.

You observe that several indexes are fragmented.

You need to rebuild the indexes.

What should you use?

A. Activity Monitor
B. Sp_who3
C. Object Explorer in the SQL Server Management Studio (SSMS)
D. SQL Server Data Collector
E. SQL Server Data Tools (SSDT)
F. SQL Server Configuration Manager

Answer: C
Explanation:

How to: Rebuild an Index (SQL Server Management Studio)


To rebuild an index

References: https://technet.microsoft.com/en-us/library/ms187874(v=sql.105).aspx

Question No : 55

86
Microsoft 70-764 : Practice Test
Your network contains an Active Directory domain that has two groups named Group1 and
Group2.

The domain contains two SQL Server instances named SQLDev and SQLProd. Each SQL
Server instance has access to various storage media.

The SQL Server instances have a database that contains a table named Table1.

Table1 contains a column named Column1. The value for Column1 can be either Value1 or
Value2.

You need to recommend a solution to ensure that users in Group1 can retrieve only rows
from Column1 that contain the value of Value1.

What should you recommend?

A. A dynamic management view


B. Filegroups
C. Snapshot isolation
D. User-defined views

Answer: D
Explanation:

A view is a virtual table whose contents are defined by a query. Like a table, a view
consists of a set of named columns and rows of data. Unless indexed, a view does not
exist as a stored set of data values in a database. The rows and columns of data come
from tables referenced in the query defining the view and are produced dynamically when
the view is referenced.
A view acts as a filter on the underlying tables referenced in the view.
http://msdn.microsoft.com/en-us/library/ms190174.aspx

Incorrect:
Not A: Dynamic management views and functions return server state information that can
be used to monitor the health of a server instance, diagnose problems, and tune
performance.
http://technet.microsoft.com/en-us/library/ms188754(v=sql.120).aspx

87
Microsoft 70-764 : Practice Test
Question No : 56 DRAG DROP

You administer a database that is used for reporting purposes. The database has a large
fact table that contains three hundred million rows. The table includes a clustered
columnstore index and a nonclustered index on the ProductID column. New rows are
inserted into the table every day.

Performance of queries that filter the Product ID column have degraded significantly.

You need to improve the performance of the queries.

Which three actions should you perform in sequence? To answer, move the appropriate
actions from the list of actions to the answer area and arrange them in the correct order.

Answer:

88
Microsoft 70-764 : Practice Test

Explanation:

Step 1: Drop the clustered columnstore index

Step 2: Create a clustered rowstore index on ProductID.


Rowstore indexes perform best on queries that seek into the data, searching for a
particular value, or for queries on a small range of values. Use rowstore indexes with
transactional workloads since they tend to require mostly table seeks instead of table
scans.

Step 3: Create a nonclustered index on ProductID

Question No : 57

Note: This question is part of a series of questions that use the same or similar answer
choices. An answer choice may be correct for more than one question in the series. Each
question is independent of the other questions in this series. Information and details
provided in a question apply only to that question.

You manage a Microsoft SQL Server environment. You implement Transparent Data

89
Microsoft 70-764 : Practice Test
Encryption (TDE).

A user will assist in managing TDE.

You need to ensure that the user can view the TDE metadata while following the principle
of lease privilege.

Which permission should you grant?

A. DDLAdmin
B. db_datawriter
C. dbcreator
D. dbo
E. View Database State
F. View Server State
G. View Definition
H. sysadmin

Answer: G
Explanation:

Viewing the metadata involved with TDE requires the VIEW DEFINITION permissionon the
certificate.

References: https://docs.microsoft.com/en-us/sql/relational-
databases/security/encryption/transparent-data-encryption-tde

Question No : 58

Note: This question is part of a series of questions that present the same scenario. Each
question in the series contains a unique solution that might meet the stated goals. Some
question sets might have more than one correct solution, while others might not have a
correct solution.

90
Microsoft 70-764 : Practice Test
After you answer a question in this sections, you will NOT be able to return to it. As a
result, these questions will not appear in the review screen.

A company has a server that runs Microsoft SQL Server 2016 Web edition. The server has
a default instance that hosts a database named DB1.

You need to ensure that you can perform auditing at the database level for DB1.

Solution: You migrate DB1 to a named instance on a server that runs Microsoft SQL Server
2016 Enterprise edition.

Does the solution meet the goal?

A. Yes
B. No

Answer: A
Explanation:

All editions of SQL Server support server level audits. All editions support database level
audits beginning with SQL Server 2016 SP1. Prior to that, database level auditing was
limited to Enterprise, Developer, and Evaluation editions.

References:https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-
server-audit-database-engine

Question No : 59

You create a stored procedure that retrieves all of the rows from a table named Table1.

You need to recommend a solution to ensure that all of the statements in the stored
procedure can be executed if another transaction is modifying rows in Table1
simultaneously.

91
Microsoft 70-764 : Practice Test
What should you recommend?

A. Snapshot isolation
B. A database snapshot
C. Filegroups
D. Indexes

Answer: A
Explanation:

Once snapshot isolation is enabled, updated row versions for each transaction are
maintained in tempdb. A unique transaction sequence number identifies each transaction,
and these unique numbers are recorded for each row version. The transaction works with
the most recent row versions having a sequence number before the sequence number of
the transaction. Newer row versions created after the transaction has begun are ignored by
the transaction.

Reference: Transaction Isolation Levels

Question No : 60

Note: This question is part of a series of questions that present the same scenario. Each
question in the series contains a unique solution that might meet the stated goals. Some
question sets might have more than one correct solution, while others might not have a
correct solution.

After you answer a question in this sections, you will NOT be able to return to it. As a
result, these questions will not appear in the review screen.

A company has an on-premises Microsoft SQL Server environment and Microsoft Azure
SQL Database instances. The environment hosts several customer databases.

One customer reports that their database is not responding as quickly as the service level
agreements dictate. You observe that the database is fragmented.

You need to optimize query performance.

92
Microsoft 70-764 : Practice Test
Solution: You reorganize all indexes.

Does the solution meet the goal?

A. Yes
B. No

Answer: A
Explanation:

You can remedy index fragmentation by either reorganizing an index or by rebuilding an


index.

References: https://msdn.microsoft.com/en-us/library/ms189858(v=sql.105).aspx

Question No : 61

You are creating a database that will store usernames and credit card numbers for an
application.

You need to recommend a solution to store and reuse the credit card numbers in the
database.

What should you recommend? More than one answer choice may achieve the goal. Select
the BEST answer.

A. Data encryption
B. Transparent Data Encryption (TDE)
C. Encrypting File System (EPS)
D. Data hashing

Answer: B
Explanation:

93
Microsoft 70-764 : Practice Test
If we are going to encrypt credit card number for storage, then we should have Data
Encryption Key (DEK) for encrypting the credit card number.

Reference: http://msdn.microsoft.com/en-us/library/bb934049.aspx

Question No : 62

You deploy a SQL Server instance named SQLProd that uses SQL Server 2016.

You need to recommend a solution to monitor the transactions that are running currently
against SQLProd. The solution must minimize the amount of custom code required.

What should you recommend?

A. Statistics
B. A dynamic management view
C. A trigger
D. User-defined views

Answer: B
Explanation:

Dynamic management views and functions return server state information that can be used
to monitor the health of a server instance, diagnose problems, and tune performance.
Transactions can be monitored.

Reference: Dynamic Management Views and Functions (Transact-SQL)

Question No : 63 DRAG DROP

You use SQL Server 2016.

You need to create a single object that inserts a provided value into Table1, and then

94
Microsoft 70-764 : Practice Test
returns a count of the records in Table1.

Develop the solution by selecting and arranging the required code blocks in the correct
order. You may not need all of the code blocks.

Answer:

Explanation:
Box 1:

Box 2:

95
Microsoft 70-764 : Practice Test

Box 3:

Box 4:

References:
http://msdn.microsoft.com/en-us/library/ms187926.aspx
http://msdn.microsoft.com/en-us/library/ms345415.aspx

Question No : 64

You have a SQL Server 2016 environment that contains 20 servers.

The corporate security policy states that all SQL Server 2016 instances must meet specific
security standards.

You need to recommend a management strategy for the SQL Server 2016 servers.

What should you include in the recommendation?

More than one answer choice may achieve the goal. Select the BEST answer.

A. Multi server jobs


B. Policy-Based Management
C. Common criteria compliance

96
Microsoft 70-764 : Practice Test
D. Maintenance plans

Answer: B
Explanation:

Policy-Based Management is a system for managing one or more instances of SQL Server.
When SQL Server policy administrators use Policy-Based Management, they use SQL
Server Management Studio to create policies to manage entities on the server, such as the
instance of SQL Server, databases, or other SQL Server objects.

Reference:

Policy-Based Management How-to Topics

Question No : 65 DRAG DROP

You plan to deploy SQL Server 2016.

Your company identifies the following monitoring requirements for the database:

✑ An e-mail message must be sent if the SQL Server Authentication mode changes.
✑ An e-mail message must be sent if CPU utilization exceeds 90 percent.

You need to identify which feature meets each monitoring requirement.

Which features should you identify?

To answer, drag the appropriate feature to the correct monitoring requirement in the
answer area.

97
Microsoft 70-764 : Practice Test
Answer:

Explanation:

* Policy-Based Management is helpful in resolving the issues presented in the following


scenario:
A company policy prohibits enabling Database Mail or SQL Mail. A policy is created to
check the server state of those two features. An administrator compares the server state to
the policy. If the server state is out of compliance, the administrator chooses the Configure
mode and the policy brings the server state into compliance.

* Events are generated by SQL Server and entered into the Microsoft Windows application
log. SQL Server Agent reads the application log and compares events written there to
alerts that you have defined. When SQL Server Agent finds a match, it fires an alert, which
is an automated response to an event. In addition to monitoring SQL Server events, SQL
Server Agent can also monitor performance conditions and Windows Management
Instrumentation (WMI) events.
To define an alert, you specify:

98
Microsoft 70-764 : Practice Test
The name of the alert.
The event or performance condition that triggers the alert.
The action that SQL Server Agent takes in response to the event or performance condition.

Question No : 66 DRAG DROP

You define a table by using the following statement.

The Teachers table contains one million records. A sample record of the XML data output
is as follows:

You plan to create queries against the table based on grade.

You need to recommend which indexes should be applied to the XML fields. The solution
must meet the following requirements:

99
Microsoft 70-764 : Practice Test
✑ Reduce the amount of time required to query the table based on grade.
✑ Minimize the size of the index.

What should you recommend? To answer, drag the appropriate index types to the correct
fields. Each index type may be used once, more than once, or not at all. You may need to
drag the split bar between panes or scroll to view content.

Answer:

Explanation:

XML indexes fall into the following categories:


* Primary XML index
* Secondary XML index
The first index on the xml type column must be the primary XML index.

100
Microsoft 70-764 : Practice Test
Question No : 67 DRAG DROP

You need to recommend the actions that are required to partition a table.

In which order should the four actions be performed?

To answer, move the actions from the list of actions to the answer area and arrange them
in the correct order.

Answer:

Explanation:

Create a partitioned table using the AdventureWorks2012 database:

101
Microsoft 70-764 : Practice Test

CREATE PARTITION FUNCTION TransactionRangePF1 (DATETIME)


AS RANGE RIGHT FOR VALUES
(
'20071001', '20071101', '20071201', '20080101',
'20080201', '20080301', '20080401', '20080501',
'20080601', '20080701', '20080801'
);
GO

CREATE PARTITION SCHEME TransactionsPS1 AS PARTITION TransactionRangePF1


TO
(
[PRIMARY], [PRIMARY], [PRIMARY], [PRIMARY], [PRIMARY],
[PRIMARY], [PRIMARY], [PRIMARY], [PRIMARY], [PRIMARY],
[PRIMARY], [PRIMARY], [PRIMARY]
);
GO

CREATE TABLE dbo.TransactionHistory


(
TransactionID INT NOT NULL, -- not bothering with IDENTITY here
ProductID INT NOT NULL,
ReferenceOrderID INT NOT NULL,
ReferenceOrderLineID INT NOT NULL DEFAULT (0),
TransactionDate DATETIME NOT NULL DEFAULT (GETDATE()),
TransactionType NCHAR(1) NOT NULL,
Quantity INT NOT NULL,
ActualCost MONEY NOT NULL,
ModifiedDate DATETIME NOT NULL DEFAULT (GETDATE()),
CONSTRAINT CK_TransactionType
CHECK (UPPER(TransactionType) IN (N'W', N'S', N'P'))
)
ON TransactionsPS1 (TransactionDate);
GO

Question No : 68

102
Microsoft 70-764 : Practice Test
You have two databases named DB1 and DB2 that are located on the same server.

You plan to create a stored procedure named SProc1 in DB1.

SProc1 will query a table named Table2 in DB2.

You need to recommend a solution to ensure that SProc1 can access Table2 without
granting users direct access to Table2.

What should you include in the recommendation?

More than one answer choice may achieve the goal. Select the BEST answer.

A. Contained databases
B. Application roles
C. Cross-database ownership chaining
D. Digital certificates

Answer: B
Explanation:

An application role is a database principal that enables an application to run with its own,
user-like permissions. You can use application roles to enable access to specific data to
only those users who connect through a particular application. Unlike database roles,
application roles contain no members and are inactive by default.

Reference: Application Roles

Question No : 69

You are using dynamic management views to monitor an SQL Server server named SQL1.

A database administrator named Dba1 must monitor the health of SQL1.

You need to ensure that Dba1 can access dynamic management views for SQL1. The
solution must use the principle of least privilege.

103
Microsoft 70-764 : Practice Test
Which permissions should you assign to Dba1?

A. VIEW ANY DEFINITION


B. VIEW SERVER STATE
C. VIEW DEFINITION
D. CONTROL SERVER

Answer: B
Explanation: To query a dynamic management view or function requires SELECT
permission on object and VIEW SERVER STATE or VIEW DATABASE STATE permission.

Reference: Dynamic Management Views and Functions (Transact-SQL)

https://msdn.microsoft.com/en-us/library/ms188754.aspx

Question No : 70 DRAG DROP

You plan to deploy SQL Server 2012.

You are designing two stored procedures named USP_1 and USP_2 that have the
following requirements:

✑ Prevent data read by USP_1 from being modified by other active processes.
✑ Prevent USP_2 from performing dirty reads.

You need to recommend the isolation level for each stored procedure. The solution must
maximize concurrency.

Which isolation levels should you recommend?

To answer, drag the appropriate isolation level to the correct stored procedure in the
answer area.

104
Microsoft 70-764 : Practice Test

Answer:

Explanation:

Note:
* REPEATABLE READ
This isolation level includes the guarantees given by SNAPSHOT isolation level. In
addition, REPEATABLE READ guarantees that for any row that is read by the transaction,
at the time the transaction commits the row has not been changed by any other
transaction. Every read operation in the transaction is repeatable up to the end of the

105
Microsoft 70-764 : Practice Test
transaction.
* Committed Read is SQL Server's default isolation level. It ensures that an operation will
never read data another application has changed but not yet committed.

Question No : 71 DRAG DROP

Note: This question is part of a series of questions that use the same scenario. For your
convenience, the scenario is repeated in each question. Each question presents a different
goal and answer choices, but the text of the scenario is exactly the same in each question
in this series.

You have five servers that run Microsoft Windows 2012 R2. Each server hosts a Microsoft
SQL Server instance. The topology for the environment is shown in the following diagram.

You have an Always On Availability group named AG1. The details for AG1 are shown in
the following table.

106
Microsoft 70-764 : Practice Test
Instance1 experiences heavy read-write traffic. The instance hosts a database named
OperationsMain that is four terabytes (TB) in size. The database has multiple data files and
filegroups. One of the filegroups is read_only and is half of the total database size.

Instance4 and Instance5 are not part of AG1. Instance4 is engaged in heavy read-write I/O.

Instance5 hosts a database named StagedExternal. A nightly BULK INSERT process loads
data into an empty table that has a rowstore clustered index and two nonclustered rowstore
indexes.

You must minimize the growth of the StagedExternal database log file during the BULK
INSERT operations and perform point-in-time recovery after the BULK INSERT transaction.
Changes made must not interrupt the log backup chain.

You plan to add a new instance named Instance6 to a datacenter that is geographically
distant from Site1 and Site2. You must minimize latency between the nodes in AG1.

All databases use the full recovery model. All backups are written to the network location
\\SQLBackup\. A separate process copies backups to an offsite location. You should
minimize both the time required to restore the databases and the space required to store
backups. The recovery point objective (RPO) for each instance is shown in the following
table.

Full backups of OperationsMain take longer than six hours to complete. All SQL Server
backups use the keyword COMPRESSION.

You plan to deploy the following solutions to the environment. The solutions will access a
database named DB1 that is part of AG1.

The wait statistics monitoring requirements for the instances are described in the following

107
Microsoft 70-764 : Practice Test
table.

You need to configure a new replica of AG1 on Instance6.

How should you complete the Transact-SQL statement? To answer, drag the appropriate
Transact-SQL statements to the correct locations. Each Transact-SQL segment may be
used once, more than once, or not at all. You may need to drag the split bar between
panes or scroll to view content.

108
Microsoft 70-764 : Practice Test
Answer:

Explanation:

Scenario: You plan to add a new instance named Instance6 to a datacenter that is
geographically distant from Site1 and Site2. You must minimize latency between the nodes
in AG1.

109
Microsoft 70-764 : Practice Test

Box 1: REPLICA
MODIFY REPLICA ON modifies any of the replicas ofthe availability group.

Box 2: SYNCHRONOUS_COMMIT
You must minimize latency between the nodes in AG1
AVAILABILITY_MODE = { SYNCHRONOUS_COMMIT | ASYNCHRONOUS_COMMIT }
Specifies whether the primary replica has to wait for the secondary availability group to
acknowledge the hardening (writing) of the log records to disk before the primary replica
can commit the transaction on a given primary database.

FAILOVER AUTOMATIC (box 4) requires SYNCHRONOUS_COMMIT

Box 3: REPLICA
MODIFY REPLICA ON modifies any of the replicas of the availability group.

Box 4: AUTOMATIC
You must minimize latency between the nodes in AG1
FAILOVER_MODE = { AUTOMATIC | MANUAL }
Specifies the failover mode of the availability replica that you are defining.
FAILOVER_MODE is required in the ADD REPLICA ON clause and optional in the
MODIFY REPLICA ON clause.
AUTOMATIC enables automatic failover. AUTOMATIC is supported only if you also specify
AVAILABILITY_MODE = SYNCHRONOUS_COMMIT.

References:

Question No : 72 DRAG DROP

You plan to deploy SQL Server 2016.

You identify the following security requirements for the deployment:

✑ Users must be prevented from intercepting and reading the T-SQL statements
sent from the clients to the database engine.
✑ All database files and log files must be encrypted if the files are moved to another
disk on another server.

You need to identify which feature meets each security requirement. The solution must

110
Microsoft 70-764 : Practice Test
minimize processor overhead.

Which features should you identify?

To answer, drag the appropriate feature to the correct requirement in the answer area.

Answer:

Explanation:

111
Microsoft 70-764 : Practice Test

* Secure Sockets Layer (SSL) encryption enables transmitting encrypted data across the
network between an instance of SQL Server and a client application.
* Transparent data encryption (TDE) performs real-time I/O encryption and decryption of
the data and log files.

References:
Authentication in Reporting Services
Transparent Data Encryption (TDE)

Question No : 73

You are designing a Windows Azure SQL Database for an order fulfillment system. You
create a table named Sales.Orders with the following script.

Each order is tracked by using one of the following statuses:

✑ Fulfilled
✑ Shipped
✑ Ordered
✑ Received

You need to design the database to ensure that that you can retrieve the following
information:

✑ The current status of an order


✑ The previous status of an order.
✑ The date when the status changed.

The solution must minimize storage.

112
Microsoft 70-764 : Practice Test
More than one answer choice may achieve the goal. Select the BEST answer.

A. To the Sales.Orders table, add three columns named Status, PreviousStatus and
ChangeDate. Update rows as the order status changes.
B. Create a new table named Sales.OrderStatus that contains three columns named
OrderID, StatusDate, and Status. Insert new rows into the table as the order status
changes.
C. Implement change data capture on the Sales.Orders table.
D. To the Sales.Orders table, add three columns named FulfilledDate, ShippedDate, and
ReceivedDate. Update the value of each column from null to the appropriate date as the
order status changes.

Answer: B

Question No : 74

Note: This question is part of a series of questions that use the same or similar answer
choices. An answer choice may be correct for more than one question in the series. Each
question is independent of the other questions in this series. Information and details
provided in a question apply only to that question.

You are the database administrator for a company that hosts Microsoft SQL Server. You
manage both on-premises and Microsoft Azure SQL Database environments.

Clients connect to databases by using line-of-business applications. Developers connect by


using SQL Server Management Studio (SSMS).

You need to provide permissions to a service account that will be used to provision a new
database for a client.

Which permission should you grant?

A. DDLAdmin
B. db_datawriter
C. dbcreator
D. dbo
E. View Database State
F. View Server State
G. View Definition

113
Microsoft 70-764 : Practice Test
H. sysadmin

Answer: C
Explanation:

Members of the dbcreator fixed server role can create, alter, drop, and restore any
database.

References:https://docs.microsoft.com/en-us/sql/relational-
databases/security/authentication-access/server-level-roles

Question No : 75

A Microsoft SQL Server database named DB1 has two filegroups named FG1 and FG2.
You implement a backup strategy that creates backups for the filegroups.

DB1 experiences a failure. You must restore FG1 and then FG2.

You need to ensure that the database remains in the RECOVERING state until the
restoration of FG2 completes. After the restoration of FG2 completes, the database must
be online.

What should you specify when you run the recovery command?

A. the WITH NORECOVERY clause for FG1 and the WITH RECOVERY clause for FG2
B. the WITH RECOVERY clause for FG1 and the WITH RECOVERY clause for FG2
C. the WITH RECOVERY clause for both FG1 and FG2
D. the WITH NORECOVERY clause for both FG1 and FG2

Answer: A

Question No : 76 DRAG DROP

114
Microsoft 70-764 : Practice Test
You need to assign security to dev_role1.

How should you complete the code? To answer, drag the appropriate elements to the
correct locations. Each element may be used once, more than once, or not at all. You may
need to drag the split bar between panes or scroll to view content.

Answer:

Explanation:

* Scenario: Application developers must be denied direct access to the database tables.
Applications must be denied direct access to the tables.

Question No : 77
115
Microsoft 70-764 : Practice Test
Note: This question is part of a series of questions that present the same scenario. Each
question in the series contains a unique solution that might meet the stated goals. Some
question sets might have more than one correct solution, while others might not have a
correct solution.

After you answer a question in this sections, you will NOT be able to return to it. As a
result, these questions will not appear in the review screen.

A company has a server that runs Microsoft SQL Server 2016 Web edition. The server has
a default instance that hosts a database named DB1.

You need to ensure that you can perform auditing at the database level for DB1.

Solution: You migrate DB1 to the default instance on a server that runs Microsoft SQL
Server 2016 Standard edition.

Does the solution meet the goal?

A. Yes
B. No

Answer: B
Explanation:

All editions of SQL Server support server level audits. All editions support database level
audits beginning with SQL Server 2016 SP1. Prior to that, database level auditing was
limited to Enterprise, Developer, and Evaluation editions.

References:https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-
server-audit-database-engine

Question No : 78

You have a SQL Server 2016 environment that includes four servers. The servers are

116
Microsoft 70-764 : Practice Test
configured as shown in the following table.

You plan to configure Policy-Based Management to enforce the following rules:

✑ On Server1, enable SQL Server password policies and enable the default trace.
✑ On Server3, ensure that the names of user-defined stored procedures begin with
the prefix "usp_" and ensure that all databases use a case-sensitive collation.

You need to recommend which server you must configure as a Central Management
Server.

Which server should you recommend? (Each correct answer presents a complete solution.
Choose all that apply.)

A. Server1
B. Server2
C. Server3
D. Seiver4

Answer: A,C
Explanation:
Need Standard or Enterprise edition of SQL Server.

Question No : 79 HOTSPOT

You are configuring log shipping for a Microsoft SQL Server database named salesOrders.

You run the following Transact-SQL script:

117
Microsoft 70-764 : Practice Test

You need to determine the changes that the script has on the environment.

How does the script affect the environment? To answer, select the appropriate options in
the answer area.

NOTE: Each correct selection is worth one point.

118
Microsoft 70-764 : Practice Test

Answer:

Explanation:

119
Microsoft 70-764 : Practice Test

Box 1: is
The dedicated backup file share is \\localhost\Backup

Box 2: does not run


The only thing with a name related to ADATM-SQL11 is the schedule name.

Box 3: 72 hours
4320 minutes equals 72 hours.

Note: @backup_retention_period= ] backup_retention_period


Isthe length of time, in minutes, to retain the log backup file in the backup directory on the
primary server. backup_retention_period is int, with no default, and cannot be NULL.

Box 4: 15 minutes.
[ @freq_subday_type = ] freq_subday_type
Specifies the units for freq_subday_interval. freq_subday_typeis int, with a default of 0, and
can be one of these values.
Here it is 4, which means minutes.

[ @freq_subday_interval = ] freq_subday_interval
The number of freq_subday_type periods to occur between eachexecution of a job.
freq_subday_intervalis int, with a default of 0. Note: Interval should be longer than 10
seconds. freq_subday_interval is ignored in those cases where freq_subday_type is equal

120
Microsoft 70-764 : Practice Test
to 1.

Here it is 15.

References: https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-
procedures/sp-add-schedule-transact-sql
https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-
add-log-shipping-primary-database-transact-sql

Question No : 80

You have a query that is used by a reporting dashboard.

Users report that the query sometimes takes a long time to run.

You need to recommend a solution to identify what is causing the issue.

What should you recommend?

More than one answer choice may achieve the goal. Select the BEST answer.

A. Set the blocked process threshold, and then run SQL Server Profiler.
B. Set the blocked process threshold, and then create an alert.
C. Enable trace flag 1204, and then create an alert.
D. Create a job that queries the sys.dm_os_waiting_tasks dynamic management view.

Answer: B
Explanation:

Step 1: Turn on the blocked process report. This will look for any blocking taking 20
seconds or longer.

--Make sure you don't have any pending changes


SELECT *
FROM sys.configurations

121
Microsoft 70-764 : Practice Test
WHERE value <> value_in_use;
GO

exec sp_configure 'show advanced options', 1;


GO
RECONFIGURE
GO

exec sp_configure 'blocked process threshold (s)', 20;


GO
RECONFIGURE
GO
Step 2: Set up a trace to capture the blocked process report. Run it as a server side trace.

Reference: blocked process threshold Server Configuration Option

Question No : 81 DRAG DROP

You are the senior database administrator at Contoso, Ltd. You manage a SQL Server
2016 Instance, with multiple databases used for reporting.

You have recently hired a junior database administrator. You want this person to be able to
view the database structures on the server, but you do not want him or her to be able to
make changes or see the data in the tables.

The new hire's login credentials are as follows:

Login name: JFree

Password: Jx672$qse

You want the new hire to be required to change his password on his next login.

The code that is produced should execute no matter the initial database context in which it
is started.

You need to write the code required to give the new hire only the desired access, using the

122
Microsoft 70-764 : Practice Test
smallest number of steps. Develop the solution by selecting and arranging the required
code blocks in the correct order. You may not need all of the code blocks.

Answer:

Explanation:
Box 1:

123
Microsoft 70-764 : Practice Test

Box 2:

Note:
* MUST_CHANGE
Applies to: SQL Server 2008 through SQL Server 2016.
Applies to SQL Server logins only. If this option is included, SQL Server prompts the user
for a new password the first time the new login is used.

* The VIEW DEFINITION permission lets a user see the metadata of the securable on
which the permission is granted. However, VIEW DEFINITION permission does not confer
access to the securable itself. For example, a user that is granted only VIEW DEFINITION
permission on a table can see metadata related to the table in the sys.objects catalog view.
However, without additional permissions such as SELECT or CONTROL, the user cannot
read data from the table.

References:
CREATE LOGIN (Transact-SQL)
ALTER SERVER ROLE (Transact-SQL)

Question No : 82 DRAG DROP

You plan to install two SQL Server 2016 environments named Environment1 and
Environment.

Your company identifies the following availability requirements for each environment:

✑ Environment1 must have mirroring with automatic failover implemented.


✑ Environment2 must have AlwaysOn with automatic failover implemented.

You need to identify the minimum number of SQL Server 2016 servers that must be
deployed to each environment to ensure that all data remains available if a physical server
fails.

124
Microsoft 70-764 : Practice Test
How many servers should you identify?

To answer, drag the appropriate number to the correct environment in the answer area.

Answer:

Explanation:

References:
Database Mirroring (SQL Server)
Failover and Failover Modes (AlwaysOn Availability Groups)

125
Microsoft 70-764 : Practice Test

Question No : 83

You are creating a database that will store usernames and passwords for an application.

You need to recommend a solution to store the passwords in the database.

What should you recommend?

More than one answer choice may achieve the goal. Select the BEST answer.

A. One-way encryption
B. Encrypting File System (EFS)
C. Transparent Data Encryption (TDE)
D. Reversible encryption

Answer: C
Explanation:
* Transparent Data Encryption (TDE) is a special case of encryption using a symmetric
key. TDE encrypts an entire database using that symmetric key called the database
encryption key. The database encryption key is protected by other keys or certificates
which are protected either by the database master key or by an asymmetric key stored in
an EKM module.

* SQL Server provides the following mechanisms for encryption:


Transact-SQL functions
Asymmetric keys
Symmetric keys
Certificates
Transparent Data Encryption

Reference: Transparent Data Encryption (TDE)

Question No : 84

126
Microsoft 70-764 : Practice Test
You administer a SQL Server 2016 instance.

Users report that the SQL Server has seemed slow today. A large database was being
restored for much of the day, which could be causing issues.

You want to write a query of the system views that will report the following:

✑ Number of users that have a connection to the server


✑ Whether a user's connection is active
✑ Whether any connections are blocked
✑ What queries are being executed

Whether the database restore is still executing and, if it is, what percentage of the restore is
complete.

Which system objects should you use in your query to best achieve this task?

A. sys.dm_exec_requests, sys.dm_exec_sessions, sys.objects


B. sys.dm_exec_sessions, sys.dm_exec_query_stats,
sys.dm_exec_query_text,sys.objects
C. sys.sysprocesses, sys.dm_exec_query_text, sys.objects
D. sys.dm_exec_requests, sys.dm_exec_sessions, sys.dm_exec_query_text

Answer: D
Explanation:

* sys.dm_exec_requests
Returns information about each request that is executing within SQL Server.
* sys.dm_exec_sessions
Returns one row per authenticated session on SQL Server. sys.dm_exec_sessions is a
server-scope view that shows information about all active user connections and internal
tasks. This information includes client version, client program name, client login time, login
user, current session setting, and more.
* sys.dm_exec_query_text
Returns the text of the SQL batch that is identified by the specified sql_handle.

References:
sys.dm_exec_requests (Transact-SQL)
sys.dm_exec_sessions (Transact-SQL)

Incorrect:
* sys.dm_exec_query_stats

127
Microsoft 70-764 : Practice Test
Returns aggregate performance statistics for cached query plans in SQL Server. The view
contains one row per query statement within the cached plan, and the lifetime of the rows
are tied to the plan itself.
* sys.objects
Contains a row for each user-defined, schema-scoped object that is created within a
database.

Question No : 85 DRAG DROP

Note: This question is part of a series of questions that use the same scenario. For your
convenience, the scenario is repeated in each question. Each question presents a different
goal and answer choices, but the text of the scenario is exactly the same in each question
in this series.

You have five servers that run Microsoft Windows 2012 R2. Each server hosts a Microsoft
SQL Server instance. The topology for the environment is shown in the following diagram.

You have an Always On Availability group named AG1. The details for AG1 are shown in
the following table.

128
Microsoft 70-764 : Practice Test

Instance1 experiences heavy read-write traffic. The instance hosts a database named
OperationsMain that is four terabytes (TB) in size. The database has multiple data files and
filegroups. One of the filegroups is read_only and is half of the total database size.

Instance4 and Instance5 are not part of AG1. Instance4 is engaged in heavy read-write I/O.

Instance5 hosts a database named StagedExternal. A nightly BULK INSERT process loads
data into an empty table that has a rowstore clustered index and two nonclustered rowstore
indexes.

You must minimize the growth of the StagedExternal database log file during the BULK
INSERT operations and perform point-in-time recovery after the BULK INSERT transaction.
Changes made must not interrupt the log backup chain.

You plan to add a new instance named Instance6 to a datacenter that is geographically
distant from Site1 and Site2. You must minimize latency between the nodes in AG1.

All databases use the full recovery model. All backups are written to the network location
\\SQLBackup\. A separate process copies backups to an offsite location. You should
minimize both the time required to restore the databases and the space required to store
backups. The recovery point objective (RPO) for each instance is shown in the following
table.

129
Microsoft 70-764 : Practice Test
Full backups of OperationsMain take longer than six hours to complete. All SQL Server
backups use the keyword COMPRESSION.

You plan to deploy the following solutions to the environment. The solutions will access a
database named DB1 that is part of AG1.

The wait statistics monitoring requirements for the instances are described in the following
table.

You need to propose a new process for the StagedExternal database.

Which five actions should you recommended be performed in sequence? To answer, move
the appropriate actions from the list of actions to the answer area and arrange them in the
correct order.

130
Microsoft 70-764 : Practice Test
Answer:

Explanation:

131
Microsoft 70-764 : Practice Test
From scenario: Instance5 hosts a database named StagedExternal. A nightly BULK
INSERT process loads data into an empty table that has a rowstore clustered index and
two nonclustered rowstore indexes.
You must minimize the growth of the StagedExternaldatabase log file during the BULK
INSERT operations and perform point-in-time recovery after the BULK INSERT transaction.
Changes made must not interrupt the log backup chain.

All databases use the full recovery model.

References:

Question No : 86 HOTSPOT

A company has an on-premises Microsoft SQL Server environment and Microsoft Azure
SQL Database instanced. The environments host several customer databases.

You host a local database and a Stretch database that has a table named Members for one
specific customer.

You need to provide the customer with information about the space used in the databases.

In the table below, identify the query that provides the required information for each
database.

NOTE: Make only one selection in each column.

132
Microsoft 70-764 : Practice Test
Answer:

Explanation:

Local database: EXEC sp_spaceused N'Company.Members'

Question No : 87 DRAG DROP

You plan to deploy a database to SQL Azure.

You must create two tables named Table 1 and Table 2 that will have the following
specifications:

✑ Table1 will contain a date column named Column1 that will contain a null value
approximately 80 percent of the time.
✑ Table2 will contain a column named Column2 which is the product of two other
columns in Table2.

Both Table1 and Table2 will contain over one million rows.

133
Microsoft 70-764 : Practice Test
You need to recommend which options must be defined for the columns. The solution must
minimize the time it takes to retrieve data from the tables.

Which options should you recommend?

To answer, drag the appropriate options to the correct column in the answer area.

Answer:

Explanation:

* Sparse columns are ordinary columns that have an optimized storage for null values.
Sparse columns reduce the space requirements for null values at the cost of more
overhead to retrieve nonnull values. Consider using sparse columns when the space saved

134
Microsoft 70-764 : Practice Test
is at least 20 percent to 40 percent.
* A Persisted column would be faster to retrieve.
* A computed column is computed from an expression that can use other columns in the
same table. The expression can be a noncomputed column name, constant, function, and
any combination of these connected by one or more operators.
Unless otherwise specified, computed columns are virtual columns that are not physically
stored in the table. Their values are recalculated every time they are referenced in a query.
The Database Engine uses the PERSISTED keyword in the CREATE TABLE and ALTER
TABLE statements to physically store computed columns in the table. Their values are
updated when any columns that are part of their calculation change.

References: Use Sparse Columns


Specify Computed Columns in a Table

Question No : 88 HOTSPOT

You are planning the deployment of two new Always On Failover Cluster Instances (FCIs)
of Microsoft SQL Server to a single Windows Server Cluster with three nodes. The planned
configuration for the cluster is shown in the Server Layout exhibit. (Click the Exhibit button.)

The SAN team has configured storage for the cluster and sent the configuration to you in
the email shown in the SAN Team Email exhibit. (Click the Exhibit button.)

135
Microsoft 70-764 : Practice Test

Each node of the cluster has identical local storage available as shown in the Local
Storage exhibit. (Click the Exhibit button.)

All local storage is on SSD.

You need to plan specific configurations for the new cluster.

For each of the following statement, select Yes if the statement is true. Otherwise, select
No.

Answer:

136
Microsoft 70-764 : Practice Test

Question No : 89

Note: This question is part of a series of questions that use the same or similar answer
choices. An answer choice may be correct for more than one question in the series. Each
question is independent of the other questions in this series. Information and details
provided in a question apply only to that question.

You are examining information about users, sessions, and processes in an on-premises
Microsoft SQL Server 2016 Standard Edition server.

You need to identify waits for resources and return only the following information:

What should you use?

A. Activity Monitor
B. Sp_who3
C. SQL Server Management Studio (SSMS) Object Explorer
D. SQL Server Data Collector
E. SQL Server Data Tools (SSDT)
F. SQL Server Configuration Manager

Answer: E
Explanation:

SQL Server Data Tools (SSDT) is a Microsoft Visual Studio environment for creating
business intelligence solutions. SSDT features the Report Designer authoring environment,
where you can open, modify, preview, save, and deploy Reporting Services paginated

137
Microsoft 70-764 : Practice Test
report definitions, shared data sources, shared datasets, and report parts.

References: https://msdn.microsoft.com/en-us/library/hh272686(v=vs.103).aspx

Question No : 90

You have an SQL Server 2016 instance named SQL1.

SQL1 creates error events in the Windows Application event log.

You need to recommend a solution that will run an application when SQL1 logs a specific
error in the Application log.

Which SQL elements should you include in the recommendation? (Each correct answer
presents part of the solution. Choose all that apply.)

A. A policy
B. A maintenance plan
C. An alert
D. A job
E. A trigger

Answer: D,E
Explanation:

Use a trigger that starts a job which executes the application.

Reference: http://technet.microsoft.com/en-us/library/hh849759.aspx

Question No : 91

138
Microsoft 70-764 : Practice Test
You are troubleshooting an application that runs a query. The application frequently causes
deadlocks.

You need to identify the isolation level used by the query when a deadlock occurs.

What should you do?

More than one answer choice may achieve the goal. Select the BEST answer.

A. Query the sys.dm_exec_requests dynamic management view.


B. Create a trace in SQL Server Profiler that contains the Deadlock graph event.
C. Query the sys.dm_exec_sessions dynamic management view.
D. Enable trace flag 1222, and then view the SQL Server error log.

Answer: C
Explanation:

* sys.dm_exec_sessions
Returns one row per authenticated session on SQL Server. sys.dm_exec_sessions is a
server-scope view that shows information about all active user connections and internal
tasks.
Include the column:
transaction_isolation_level
smallint
Transaction isolation level of the session.
0 = Unspecified
1 = ReadUncomitted
2 = ReadCommitted
3 = Repeatable
4 = Serializable
5 = Snapshot
Is not nullable.

Reference: sys.dm_exec_sessions (Transact-SQL)

Question No : 92 HOTSPOT

139
Microsoft 70-764 : Practice Test
Note: This question is part of a series of questions that use the same scenario. For your
convenience, the scenario is repeated in each question. Each question presents a different
goal and answer choices, but the text of the scenario is exactly the same in each question
in this series.

You are a database administrator for a company that has an on-premises Microsoft SQL
Server environment and Microsoft Azure SQL Database instances. The environment hosts
several customer databases, and each customer uses a dedicated instance. The
environments that you manage are shown in the following table.

You need to configure the Contoso instance.

How should you complete the Transact-SQL statement? To answer, select the appropriate
Transact-SQL segments in the answer area.

140
Microsoft 70-764 : Practice Test

Answer:

141
Microsoft 70-764 : Practice Test
Explanation:

Box 1: show advanced options


Advanced configuration options are displayed by first setting show advanced option to 1.

Box 2: max worker threads


SQL Server uses the native thread services of the operating systems so that one or more
threads support each network that SQL Server supports simultaneously, another thread
handles database checkpoints, and a pool of threads handles all users. The default value
for max worker threads is 0. This enables SQL Server to automatically configure the
number of worker threads at startup. The default setting is best for most systems.

References:https://docs.microsoft.com/en-us/sql/database-engine/configure-
windows/configure-the-max-worker-threads-server-configuration-option

142
Microsoft 70-764 : Practice Test

Question No : 93

Note: This question is part of a series of questions that present the same scenario. Each
question in the series contains a unique solution that might meet the stated goals. Some
question sets might have more than one correct solution, while others might not have a
correct solution.

After you answer a question in this sections, you will NOT be able to return to it. As a
result, these questions will not appear in the review screen.

You need to configure a Microsoft SQL Server instance to ensure that a user named Mail1
can send mail by using Database Mail.

Solution: You add the DatabaseMailUserRole to Mail1 in the master database.

Does the solution meet the goal?

A. Yes
B. No

Answer: B
Explanation:

Database Mail is guarded by the database role DatabaseMailUserRole in the msdb


database, not the master database, in order to prevent anyone from sending arbitrary
emails. Database users or roles must be created in the msdb database and must also be a
member of DatabaseMailUserRole in order to send emails with the exception of sysadmin
who has all privileges.

Note: Database Mail was first introduced as a new feature in SQL Server 2005 and
replaces the SQL Mail feature found in previous versions.

References:http://www.idevelopment.info/data/SQLServer/DBA_tips/Database_Administrati
on/DBA_20.shtml

143
Microsoft 70-764 : Practice Test

Question No : 94

Note: This question is part of a series of questions that use the same or similar answer
choices. An answer choice may be correct for more than one question in the series. Each
question is independent of the other questions in this series. Information and details
provided in a question apply only to that question.

You have an on-premises server that runs Microsoft SQL Server 2016 Standard Edition.

You need to identify missing indexes.

What should you use?

A. Activity Monitor
B. Sp_who3
C. SQL Server Management Studio (SSMS) Object Explorer
D. SQL Server Data Collector
E. SQL Server Data Tools (SSDT)
F. SQL Server Configuration Manager

Answer: D
Explanation:

Data Collector can gather performance information from multiple SQL Server instances and
store it in a single repository. It has three built-in data collecting specifications (data
collectors) designed to collect the most important performance metrics. The information
collected by default is about disk usage, query statistics, and server activity.
The Query Statistics data collection set collects information about query statistics, activity,
execution plans and text on the SQL Server instance.
Missing indexes can be found with the execution plans.

References: https://www.sqlshack.com/sql-server-performance-monitoring-data-collector/

144
Microsoft 70-764 : Practice Test

Question No : 95

You have two SQL Server instances named SQLDev and SQLProd that have access to
various storage media.

You plan to synchronize SQLDev and SQLProd.

You need to recommend a solution that meets the following requirements:

✑ The database schemas must be synchronized from SQLDev to SQLProd.


✑ The database on SQLDev must be deployed to SQLProd by using a package.
✑ The package must support being deployed to Windows Azure SQL Database.

What should you recommend?

More than one answer choice may achieve the goal. Select the BEST answer.

A. A database snapshot
B. SQL Server Integration Services (SSIS)
C. Change data capture
D. A data-tier application

Answer: B
Explanation:

* SIS supports connections to SQL Database by using the ADO.NET provider. OLEDB is
not supported at this time. You can build the SSIS package connecting to SQL Database
and create the data flow tasks the same way as you would against a typical on-premise
SQL Server.

Reference: SSIS for Azure and Hybrid Data Movement

Question No : 96

145
Microsoft 70-764 : Practice Test
You are building a stored procedure for a Windows Azure SQL Database. The procedure
will add multiple rows to a table.

You need to design the stored procedure to meet the following requirements:

If any of the new rows violates a table constraint, then no further additions must be
attempted and all changes made by the stored procedure must be discarded.

If any errors occur, a row must be added to an audit table, and the original error must be
returned to the caller of the stored procedure.

What should you include in the design?

A. An explicit transaction that has XACT_ABORT disabled


B. An implicit transaction that has error handling enabled
C. An explicit transaction that has error handling enabled
D. An implicit transaction that has XACT.ABORT enabled

Answer: C
Reference:

http://technet.microsoft.com/en-us/library/ms175127(v=SQL.105).aspx

Question No : 97

Note: This question is part of a series of questions that use the same or similar answer
choices. An answer choice may be correct for more than one question in the series. Each
question is independent of the other questions in this series. Information and details
provided in a question apply only to that question.

A company has an on-premises Microsoft SQL Server environment and Microsoft Azure
SQL Database instances. The environment hosts a customer database named DB1.

Customers connect to hosted database instances by using line-of-business applications.


Developers connect by using SQL Server Management Studio (SSMS).

You need to grant the developers permission to alter views for DB1 while following the
principle of least privilege.

146
Microsoft 70-764 : Practice Test
Which permission should you grant?

A. DDLAdmin
B. db_datawriter
C. dbcreator
D. dbo
E. View Database State
F. View Server State
G. View Definition
H. sysadmin

Answer: A
Explanation:

To execute ALTER VIEW, at a minimum, ALTER permission on OBJECT is required.


Members of the db_ddladmin fixed database role can run any Data Definition Language
(DDL) command in a database.

References: https://technet.microsoft.com/en-us/library/ms190667(v=sql.90).aspx

Question No : 98 HOTSPOT

Note: This question is part of a series of questions that use the same scenario. For your
convenience, the scenario is repeated in each question. Each question presents a different
goal and answer choices, but the text of the scenario is exactly the same in each question
in this series.

You are a database administrator for a company that has an on-premises Microsoft SQL
Server environment and Microsoft Azure SQL Database instances. The environment hosts
several customer databases, and each customer uses a dedicated instance. The
environments that you manage are shown in the following table.

147
Microsoft 70-764 : Practice Test

You need to configure auditing for WDWDB.

In the table below, identify the event type that you must audit for each activity.

148
Microsoft 70-764 : Practice Test
Answer:

Question No : 99

You have a server named Server1 that has 2 processors.

You plan to deploy multiple instances of SQL Server 2016 to Server1. Each instance will
have multiple databases.

You need to recommend a method to set limits on processor time for each database.

What should you include in the recommendation?

More than one answer choice may achieve the goal. Select the BEST answer.

A. processor affinity
B. Max Degree of Parallelism
C. Windows System Resource Manager (WSRM)
D. Resource Governor

Answer: D
Explanation: SQL Server Resource Governor is a feature than you can use to manage
SQL Server workload and system resource consumption. Resource Governor enables you
to specify limits on the amount of CPU, physical IO, and memory that incoming application
requests can use.

Reference: Resource Governor

https://msdn.microsoft.com/en-us/library/bb933866(v=sql.120).aspx

149
Microsoft 70-764 : Practice Test

Question No : 100

You are designing a database named DB1.

Changes will be deployed to DB1 every Wednesday night.

You need to recommend a strategy to deploy the changes to DB1. The strategy must meet
the following requirements:

✑ The strategy must not disrupt backup operations.


✑ DB1 must be online while the changes are deployed.
✑ You must be able to undo quickly any changes made to objects.

What should you recommend?

More than one answer choice may achieve the goal. Select the BEST answer.

A. Perform a copy-only database backup before the changes are deployed. If the
deployment fails, restore the database to another server and recover the original objects
from the restored database.
B. Create a database snapshot. If the deployment fails, recover the objects from the
database snapshot.
C. Create a database snapshot. If the deployment fails, revert the database to the
database snapshot.
D. Perform a full database backup before the changes are deployed. If the deployment
fails, restore the database to another server and recover the original objects from the
restored database.

Answer: C
Reference:

Database Snapshots (SQL Server)

Question No : 101

You have a database hosted on SQL Server 2012 R2. The database contains 5 million
rows.

150
Microsoft 70-764 : Practice Test
You need to recommend a repeatable method to migrate the database to SQL Azure.

Which method should you recommend? More than one answer choice may achieve the
goal. Select the BEST answer.

A. Create a SQL Server Integration Services (SSIS) package, and then run the package.
B. Back up the database, and then restore the database.
C. Extract a data-tier application, and then import the application.
D. Generate scripts to create all of the all database objects and all of the data, and then
execute the scripts by using SQL Azure.

Answer: A
Explanation:

SQL Server Integration Services


Most flexibility
Data Transfer Efficiency: Good

/ SSIS can be used to perform a broad range of data migration tasks. SSIS provides
support for complex workflow and data transformation between the source and destination.
It is a good choice to transfer of data for databases that require many changes to work on
Microsoft Azure SQL Database. You can use SSIS data transfer packages with another
mechanism for transferring the database schema, such as a Data-tier Application package.
SSIS for Azure and Hybrid Data Movement

Incorrect:
Not D: Generate Scripts Wizard
Has explicit option for Azure SQL Database scripts generation
Data Transfer Efficiency: Poor

Good for smaller database

/ Using the Generate Scripts wizard to migrate a SQL Server database to Azure SQL
Database should be limited to:
Teams who have experience with the wizard.

Migrating simple databases that need few schema changes to run on Azure SQL
Database. The scripts generated from the source database can be modified before being
used to create the new version of the database on Azure SQL Database, but using a
database project in the SQL Server Data Tools has richer support for making schema
changes.

151
Microsoft 70-764 : Practice Test

Migrating small databases that do not have much data. The wizard generates scripts that
use insert statements instead of bulk copies to transfer the data. The insert statements can
be throttled when the tables contain too much data, and are not as fast as bulk copies.

Question No : 102

You have four databases that are accessed by using an Online Transaction Processing
(OLTP) application. The databases are stored on a server named SQL1 that has SQL
Server 2016 installed.

You plan to deploy an additional server that has SQL Server 2016 installed.

You need to design a high-availability solution for the databases that meets the following
requirements:

If SQL1 fails, the databases must be available.

Users must be able to run reports against a secondary copy of the databases.

What should you include in the design?

More than one answer choice may achieve the goal. Select the BEST answer.

A. AlwaysOn availability groups


B. Database mirroring
C. Log shipping
D. Failover Clustering

Answer: A
Explanation:

The 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.

152
Microsoft 70-764 : Practice Test

Reference: Failover and Failover Modes (AlwaysOn Availability Groups)

Question No : 103

Note: This question is part of a series of questions that use the same or similar answer
choices. An answer choice may be correct for more than one question in the series. Each
question is independent of the other questions in this series. Information and details
provided in a question apply only to that question.

You are examining information about users, sessions, and processed in an on-premises
Microsoft SQL Server Database Engine instance.

You need to return information about processes that are not idle, that belong to a specific
user, or that belong to a specific session.

What should you use?

A. Activity Monitor
B. sp_who3
C. SQL Server Management Studio (SSMS) Object Explorer
D. SQL Server Data Collector
E. SQL Server Data Tools (SSDT)
F. SQL Server Configuration Manager

Answer: B
Explanation:

Use sp_who3 to first view the current system load and to identify a session of interest. You
should execute the query several times to identify which session id is most consuming teh
system resources.

Parameters
sp_who3 null - who is active;
sp_who3 1 or 'memory' - who is consuming the memory;
sp_who3 2 or 'cpu' - who has cached plans that consumed the most cumulative CPU (top
10);

153
Microsoft 70-764 : Practice Test
sp_who3 3 or 'count' - who is connected and how many sessions it has;
sp_who3 4 or 'idle' - who is idle that has open transactions;
sp_who3 5 or 'tempdb' - who is running tasks that use tempdb (top 5); and,
sp_who3 6 or 'block' - who is blocking.

Question No : 104

You have a SQL Server 2016 database named DB1.

You plan to import a large number of records from a SQL Azure database to DB1.

You need to recommend a solution to minimize the amount of space used in the
transaction log during the import operation.

What should you include in the recommendation?

A. The bulk-logged recovery model


B. The full recovery model
C. A new partitioned table
D. A new log file
E. A new file group

Answer: A
Explanation:

Compared to the full recovery model, which fully logs all transactions, the bulk-logged
recovery model minimally logs bulk operations, although fully logging other transactions.
The bulk-logged recovery model protects against media failure and, for bulk operations,
provides the best performance and least log space usage.

Note:
The bulk-logged recovery model is a special-purpose recovery model that should be used
only intermittently to improve the performance of certain large-scale bulk operations, such
as bulk imports of large amounts of data.

Reference: Recovery Models (SQL Server)

154
Microsoft 70-764 : Practice Test

Question No : 105 HOTSPOT

You are the database administrator of a Microsoft SQL Server instance. Developers are
writing stored procedures to send emails using sp_send_dbmail. Database Mail is enabled.

You need to configure each account’s profile security and meet the following requirements:

In the table below. identify the profile type that must be used for each account.

NOTE: Make only one selection in each column.

Answer:

Explanation:

155
Microsoft 70-764 : Practice Test

SMTP1_Account1: Private Profile


When no profile_name is specified, sp_send_dbmail uses the default private profile for the
current user. If the user does not have a default private profile, sp_send_dbmail uses the
default public profile for the msdb database.

SMTP1_Account2: Default Profile


Execute permissions forsp_send_dbmail default to all members of the DatabaseMailUser
database role in the msdb database.

References:https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-
procedures/sp-send-dbmail-transact-sql

Question No : 106 CORRECT TEXT

You have a SQL Azure database named Database1.

You need to design the schema for a table named table1. Table1 will have less than one
million rows. Table1 will contain the following information for each row:

156
Microsoft 70-764 : Practice Test

The solution must minimize the amount of space used to store each row.

Which data types should you recommend for each column?

To answer, drag the appropriate data type to the correct column in the answer area.

Answer: <map><m x1="4" x2="187" y1="61" y2="106" ss="0" a="0" /><m x1="1" x2="186"
y1="115" y2="155" ss="0" a="0" /><m x1="4" x2="182" y1="171" y2="210" ss="0" a="0"
/><m x1="1" x2="181" y1="224" y2="260" ss="0" a="0" /><m x1="3" x2="185" y1="276"
y2="315" ss="0" a="0" /><m x1="1" x2="186" y1="327" y2="370" ss="0" a="0" /><m x1="1"
x2="184" y1="379" y2="422" ss="0" a="0" /><m x1="370" x2="551" y1="56" y2="104"
ss="1" a="0" /><m x1="369" x2="546" y1="121" y2="163" ss="1" a="0" /><m x1="368"
x2="549" y1="181" y2="224" ss="1" a="0" /><m x1="368" x2="553" y1="238" y2="284"
ss="1" a="0" /><c start="0" stop="0" /><c start="2" stop="1" /><c start="4" stop="2" /><c

157
Microsoft 70-764 : Practice Test
start="6" stop="3" /></map>
Explanation/Reference:
Data Types (Transact-SQL)

Question No : 107 DRAG DROP

You need to recommend a backup process for data warehouse database.

The solution must meet the following requirements:

✑ Ensure that if a hardware failure occurs, you can bring the database online without
losing more than 24 hours of transactions.
✑ Minimize the amount of administrative effort required to restore any lost data.
✑ Minimize the space used by transaction logs.

What should you include in the recommendation?

To answer, move the appropriate actions from the list of actions to the answer area and
arrange them in the correct order.

Answer:

158
Microsoft 70-764 : Practice Test
Explanation:
Box 1: Set the database to the simple recovery model.
Box 2: Perform a weekly full backup of the database.
Box 3: Perform a differential backup of the database every night.

Note:
* Simple recovery model
No log backups.
* Full recovery model
Requires log backups

Question No : 108 DRAG DROP

You are the database administrator for a Microsoft SQL Server instance. You develop an
Extended Events package to look for events related to application performance.

You need to change the event session to include SQL Server errors that are greater than
error severity 15.

Which five Transact-SQL segments should you use to develop the solution? To answer,
move the appropriate Transact-SQL segments from the list of Transact-SQL segments to
the answer area and arrange them in the correct order.

159
Microsoft 70-764 : Practice Test
Answer:

Explanation:

Step 1: ALTER EVENT SESSION Contoso1 ON SERVER

Step 2: ADD EVENT …

160
Microsoft 70-764 : Practice Test
Step 3: (ACTION ...

Step 4: WHERE...

Step 5: ) GO

Example: To start an Extended Events sessions in order to trap SQL Server errors with
severity greater than 10,just run the following script:

CREATE EVENT SESSION [error_trap] ON SERVER


ADD EVENT sqlserver.error_reported
(
ACTION
(package0.collect_system_time,package0.last_error,sqlserver.client_app_name,sqlserver.c
lient_hostname,sqlserver.database_id,sqlserver.database_name,sqlserver.nt_username,
sqlserver.plan_handle,sqlserver.query_hash,sqlserver.session_id,sqlserver.sql_text,sqlser
ver.tsql_frame,sqlserver.tsql_stack,sqlserver.username)
WHERE ([severity]>10)
)
ADD TARGET package0.event_file
(
SET filename=N'D:\Program Files\Microsoft SQL
Server\MSSQL11.MSSQLSERVER\MSSQL\XEvents\error_trap.xel'
)
WITH
(
STARTUP_STATE=OFF
)
GO

References:

Question No : 109 DRAG DROP

You have an SQL Server 2016 server.

You plan to create four stored procedures that will use transactions. The stored procedures
will be configured as shown in the following table.

161
Microsoft 70-764 : Practice Test

You need to recommend an isolation level for each stored procedure. The solution must
support the concurrency strategy of each stored procedure and must minimize locks.

What should you recommend? To answer, drag the appropriate isolation levels to the
correct stored procedures. Each isolation level may be used once, more than once, or not
at all. You may need to drag the split bar between panes or scroll to view content.

Answer:

Explanation:

162
Microsoft 70-764 : Practice Test

* SP1 SNAPSHOT
The transaction can only recognize data modifications that were committed before the start
of the transaction. Data modifications made by other transactions after the start of the
current transaction are not visible to statements executing in the current transaction. The
effect is as if the statements in a transaction get a snapshot of the committed data as it
existed at the start of the transaction.
* SP2: REPEATABLE READ
Specifies that statements cannot read data that has been modified but not yet committed
by other transactions and that no other transactions can modify data that has been read by
the current transaction until the current transaction completes.
* SP3: READ COMMITTED
Specifies that statements cannot read data that has been modified but not committed by
other transactions. This prevents dirty reads.
* SP4: SERIALIZABLE
SERIALIZABLE specification include:
/ No other transactions can modify data that has been read by the current transaction until
the current transaction completes.

Question No : 110 DRAG DROP

Note: This question is part of a series of questions that use the same scenario. For your
convenience, the scenario is repeated in each question. Each question presents a different
goal and answer choices, but the text of the scenario is exactly the same in each question
in this series.

163
Microsoft 70-764 : Practice Test
You are a database administrator for a company that has an on-premises Microsoft SQL
Server environment and Microsoft Azure SQL Database instances. The environment hosts
several customer databases, and each customer uses a dedicated instance. The
environments that you manage are shown in the following table.

You need to implement a process for importing data into WingDB.

Which three actions should you perform in sequence? To answer, move the appropriate
actions from the list of actions to the answer area and arrange them in the correct order.

164
Microsoft 70-764 : Practice Test

Answer:

Explanation:

165
Microsoft 70-764 : Practice Test

Step 1: Perform a full backup of the database and enable the bulk-logged recovery model.

Not: Simple recovery model.


With the Simple recovery model we cannot minimize data loss.

Step 2: Import the data

Step 3: Backup the tail of the transaction log.


For databases that use full and bulk-logged recovery, database backups are necessary but
not sufficient. Transaction log backups are also required.

Note: Three recovery models exist: simple, full, and bulk-logged. Typically, a database
uses the full recovery model or simple recovery model. A database can be switched to
another recovery model at any time.

References:

Question No : 111

Note: This question is part of a series of questions that use the same or similar answer
choices. An answer choice may be correct for more than one question in the series. Each
question is independent of the other questions in this series. Information and details
provided in a question apply only to that question.

166
Microsoft 70-764 : Practice Test
You are the database administrator for a company that hosts Microsoft SQL Server. You
manage both on-premises and Microsoft Azure SQL Database environments.

You plan to delegate encryption operations to a user.

You need to grant the user permission to implement cell-level encryption while following the
principle of least privilege.

Which permission should you grant?

A. DDLAdmin
B. db_datawriter
C. dbcreator
D. dbo
E. View Database State
F. View ServerState
G. View Definition
H. sysadmin

Answer: G
Explanation:

The following permissions are necessary to perform column-level encryption, or cell-level


encryption.

References:https://docs.microsoft.com/en-us/sql/relational-
databases/security/encryption/encrypt-a-column-of-data

Question No : 112

Note: This question is part of a series of questions that use the same or similar answer
choices. An answer choice may be correct for more than one question in the series. Each
question is independent of the other questions in this series. Information and details
provided in a question apply only to that question.

167
Microsoft 70-764 : Practice Test
You are the database administrator for a company that hosts Microsoft SQL Server. You
manage both on-premises and Microsoft Azure SQL Database environments.

One instance hosts a user database named HRDB. The database contains sensitive
human resources data.

You need to grant an auditor permission to view the SQL Server audit logs while following
the principle of least privilege.

Which permission should you grant?

A. DDLAdmin
B. db_datawriter
C. dbcreator
D. dbo
E. View Database State
F. View Server State
G. View Definition
H. sysadmin

Answer: F
Explanation:

Unless otherwise specified, viewing catalog views requires a principal to have one of the
following:

References: https://technet.microsoft.com/en-us/library/cc280386(v=sql.110).aspx

Question No : 113 HOTSPOT

You are planning to deploy log shipping for Microsoft SQL Server and store all backups on
a dedicated fileshare.

You need to configure the servers to perform each log shipping step.

168
Microsoft 70-764 : Practice Test
Which server instance should you configure to perform each action? To answer, select the
appropriate server instances in the dialog box in the answer area.

Answer:

169
Microsoft 70-764 : Practice Test
Explanation:

Note: Before you configure log shipping, you must create a share to make the transaction
log backups available to the secondary server.
SQL Server Log shipping allows you to automatically send transaction log backups from a
primary database on a primary server instance to one or more secondary databases on
separate secondary server instances. The transaction log backups are applied to each of
the secondary databases individually. An optional third server instance, known as the
monitor server, records the history and status of backup and restore operations and,
optionally, raises alerts if these operations fail to occur as scheduled.

Box 1: Primary server instance.


The primary server instance runs the backup job to back up the transaction log on the
primary database.
backup job: A SQL Server Agent job that performs the backup operation, logs history to the
local server and the monitor server, and deletes old backup files and history information.
When log shipping is enabled, the job category "Log Shipping Backup" is created on the
primary server instance.

170
Microsoft 70-764 : Practice Test
Box 2: Secondary server instance
Each of the three secondary server instances runs its own copy job to copy the primary log-
backup file to its own local destination folder.
copy job: A SQL Server Agent job that copies the backup files from the primary server to a
configurable destination on the secondary server and logs history on the secondary server
and the monitor server. When log shipping is enabled on a database, the job category "Log
Shipping Copy" is created on each secondary server in a log shipping configuration.

Box 3: Secondary server instance.


Each secondary server instance runs its own restore job to restore the log backup from the
local destination folder onto the local secondary database.
restore job: A SQL Server Agent job that restores the copied backup files to the secondary
databases. It logs history on the local server and the monitor server, and deletes old files
and old history information. When log shipping is enabled on a database, the job category
"Log Shipping Restore" is created on the secondary server instance.

References:https://docs.microsoft.com/en-us/sql/database-engine/log-shipping/about-log-
shipping-sql-server

Question No : 114

Note: This question is part of a series of questions that present the same scenario. Each
question in the series contains a unique solution that might meet the stated goals. Some
question sets might have more than one correct solution, while others might not have a
correct solution.

After you answer a question in this sections, you will NOT be able to return to it. As a
result, these questions will not appear in the review screen.

A company has an on-premises Microsoft SQL Server environment and Microsoft Azure
SQL Database instances. The environment hosts several customer databases.

One customer reports that their database is not responding as quickly as the service level
agreements dictate. You observe that the database is fragmented.

171
Microsoft 70-764 : Practice Test
You need to optimize query performance.

Solution: You run the DBCC CHECKDB command.

Does the solution meet the goal?

A. Yes
B. No

Answer: B
Explanation:

DBCC CHECKDB only checks the logical and physical integrity of all the objects in the
specified database. It does not update any indexes, and does not improve query
performance.

References:https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-
checkdb-transact-sql

Question No : 115

Note: This question is part of a series of questions that use the same or similar answer
choices. An answer choice may be correct for more than one question in the series. Each
question is independent of the other questions in this series. Information and details
provided in a question apply only to that question.

You collect performance metrics on multiple Microsoft SQL Server instances and store the
data in a single repository.

You need to examine disk usage, query statistics, and server activity without building
custom counters.

What should you use?

172
Microsoft 70-764 : Practice Test
A. Activity Monitor
B. Sp_who3 stored procedure
C. Object Explorer in the Microsoft SQL Server Management Studio (SSMS)
D. SQL Server Data Collector
E. SQL Server Data Tools (SSDT)
F. SQL Server Configuration Manager

Answer: D
Explanation:

The data collector is a core component of the data collection platform for SQL Server 2017
and the tools that are provided by SQL Server. The data collector provides one central
point for data collection across your database servers and applications. This collection
point can obtain data from a variety of sources and is not limited to performance data

Question No : 116 HOTSPOT

You manage a Microsoft-SQL Server database named sales Orders.

You need to verify the integrity of the database and attempt to repair any errors that are
found. Repair must not cause any data to be lost in the database.

How should you complete the DBCC command? To answer, select the appropriate options
in the answer area.

Answer:

173
Microsoft 70-764 : Practice Test

Explanation:

Box 1: CHECKDB
DBCC CHECKDB checks the logical and physical integrity of all the objects in the specified
database.

Partial syntax:
DBCC CHECKDB
[ ( database_name | database_id | 0
[ , NOINDEX
| , { REPAIR_ALLOW_DATA_LOSS | REPAIR_FAST | REPAIR_REBUILD } ]
….

Box 2: REPAIR_REBUILD
DBCC CHECKDB …REPAIR_ALLOW_DATA_LOSS | REPAIR_FAST |REPAIR_REBUILD
specifies that DBCC CHECKDB repair the found errors.
REPAIR_REBUILD performs repairs that have no possibility of data loss. This can include
quick repairs, such as repairing missing rows in non-clustered indexes, and more time-
consuming repairs, such as rebuilding an index.

References: https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-
checkdb-transact-sql

174
Microsoft 70-764 : Practice Test

Question No : 117

Note: This question is part of a series of questions that use the same scenario. For your
convenience, the scenario is repeated in each question. Each question presents a different
goal and answer choices, but the text of the scenario is exactly the same in each question
in this series.

You have five servers that run Microsoft Windows 2012 R2. Each server hosts a Microsoft
SQL Server instance. The topology for the environment is shown in the following diagram.

You have an Always On Availability group named AG1. The details for AG1 are shown in
the following table.

175
Microsoft 70-764 : Practice Test
Instance1 experiences heavy read-write traffic. The instance hosts a database named
OperationsMain that is four terabytes (TB) in size. The database has multiple data files and
filegroups. One of the filegroups is read_only and is half of the total database size.

Instance4 and Instance5 are not part of AG1. Instance4 is engaged in heavy read-write I/O.

Instance5 hosts a database named StagedExternal. A nightly BULK INSERT process loads
data into an empty table that has a rowstore clustered index and two nonclustered rowstore
indexes.

You must minimize the growth of the StagedExternal database log file during the BULK
INSERT operations and perform point-in-time recovery after the BULK INSERT transaction.
Changes made must not interrupt the log backup chain.

You plan to add a new instance named Instance6 to a datacenter that is geographically
distant from Site1 and Site2. You must minimize latency between the nodes in AG1.

All databases use the full recovery model. All backups are written to the network location
\\SQLBackup\. A separate process copies backups to an offsite location. You should
minimize both the time required to restore the databases and the space required to store
backups. The recovery point objective (RPO) for each instance is shown in the following
table.

Full backups of OperationsMain take longer than six hours to complete. All SQL Server
backups use the keyword COMPRESSION.

You plan to deploy the following solutions to the environment. The solutions will access a
database named DB1 that is part of AG1.

The wait statistics monitoring requirements for the instances are described in the following

176
Microsoft 70-764 : Practice Test
table.

You need to reduce the amount of time it takes to backup OperationsMain.

What should you do?

A. Modify the backup script to use the keyword SKIP in the FILE_SNAPSHOT statement.
B. Modify the backup script to use the keyword SKIP in the WITH statement
C. Modify the backup script to use the keyword NO_COMPRESSION in the WITH
statement.
D. Modify the full database backups script to stripe the backup across multiple backup files.

Answer: D
Explanation:

One of the filegroup is read_only should be as it only need to be backup up once. Partial
backups are useful whenever you want to exclude read-only filegroups. A partial backup
resembles a full database backup, but a partial backup does not contain all the filegroups.
Instead, for a read-write database, a partial backup contains the data in the primary
filegroup, every read-write filegroup, and, optionally, one or more read-only files. A partial
backup of a read-only database contains only the primary filegroup.

From scenario: Instance1 experiences heavy read-write traffic. The instance hosts a
database named OperationsMainthat is four terabytes (TB) in size. The database has
multiple data files and filegroups. One of the filegroups is read_only and is half of the total
database size.

References: https://docs.microsoft.com/en-us/sql/relational-databases/backup-
restore/partial-backups-sql-server

177
Microsoft 70-764 : Practice Test

Question No : 118 HOTSPOT

Note: This question is part of a series of questions that use the same scenario. For your
convenience, the scenario is repeated in each question. Each question presents a different
goal and answer choices, but the text of the scenario is exactly the same in each question
in this series.

You have five servers that run Microsoft Windows 2012 R2. Each server hosts a Microsoft
SQL Server instance. The topology for the environment is shown in the following diagram.

You have an Always On Availability group named AG1. The details for AG1 are shown in
the following table.

Instance1 experiences heavy read-write traffic. The instance hosts a database named
OperationsMain that is four terabytes (TB) in size. The database has multiple data files and
filegroups. One of the filegroups is read_only and is half of the total database size.

178
Microsoft 70-764 : Practice Test
Instance4 and Instance5 are not part of AG1. Instance4 is engaged in heavy read-write I/O.

Instance5 hosts a database named StagedExternal. A nightly BULK INSERT process loads
data into an empty table that has a rowstore clustered index and two nonclustered rowstore
indexes.

You must minimize the growth of the StagedExternal database log file during the BULK
INSERT operations and perform point-in-time recovery after the BULK INSERT transaction.
Changes made must not interrupt the log backup chain.

You plan to add a new instance named Instance6 to a datacenter that is geographically
distant from Site1 and Site2. You must minimize latency between the nodes in AG1.

All databases use the full recovery model. All backups are written to the network location
\\SQLBackup\. A separate process copies backups to an offsite location. You should
minimize both the time required to restore the databases and the space required to store
backups. The recovery point objective (RPO) for each instance is shown in the following
table.

Full backups of OperationsMain take longer than six hours to complete. All SQL Server
backups use the keyword COMPRESSION.

You plan to deploy the following solutions to the environment. The solutions will access a
database named DB1 that is part of AG1.

The wait statistics monitoring requirements for the instances are described in the following
table.

179
Microsoft 70-764 : Practice Test

You need to create the connection strings for the operations and reporting systems.

In the table below, identify the option that must be specified in each connection string.

NOTE: Make only one selection in each column.

Answer:

Explanation:

180
Microsoft 70-764 : Practice Test

Reporting system: Connect to any current read-only replica instance


We configure Read-OnlyAccess on an Availability Replica. We select Read-intent only.
Only read-only connections are allowed to secondary databases of this replica. The
secondary database(s) are all available for read access.

From Scenario: Reporting system: This solution accesses data inDB1with a login that is
mapped to a database user that is a member of the db_datareader role. The user has
EXECUTE permissions on the database. Queries make no changes to the data. The
queries must be load balanced over variable read-only replicas.

Operating system: Connect to the current primary replica SQL instance


By default both read-write and read-intent access are allowed to the primary replica and no
connections are allowed to secondary replicas of an Always On availability group.

From scenario: Operations system: This solution accesses data inDB1with a login that is
mapped to a database user that is a member of the db_datareader and db_datawriter
roles. The user has EXECUTE permissions on the database. Queries from the operations
system will perform both DDL and DML operations.

References:https://docs.microsoft.com/en-us/sql/database-engine/availability-
groups/windows/configure-read-only-access-on-an-availability-replica-sql-server

181
Microsoft 70-764 : Practice Test
Question No : 119 HOTSPOT

You deploy a Microsoft SQL Server instance to support a global sales application. The
instance includes the following tables: TableA and TableB.

TableA is a partitioned table that uses an incrementing integer number for partitioning. The
table has millions of rows in each partition. Most changes to the data in TableA affect
recently added data. The UPDATE STATISTICS for TableA takes longer to complete than
the allotted maintenance window.

Thousands of operations are performed against TableB each minute. You observe a large
number of Auto Update Statistics events for TableB.

You need to address the performance issues with each table.

In the table below, identify the action that will resolve the issues for each table.

NOTE: Make only one selection in each column.

Answer:

182
Microsoft 70-764 : Practice Test

Explanation:

Table A: Auto_update statistics off


Table A does not change much. There is no need to update the statistics on this table.

Table B: SET AUTO_UPDATE_STATISTICS_ASYNC ON

You can set the database to update statistics asynchronously:


ALTER DATABASE YourDBName
SET AUTO_UPDATE_STATISTICS_ASYNC ON

183
Microsoft 70-764 : Practice Test
If you enable this option then the Query Optimizer will run the query first and update the
outdated statistics afterwards. When you set this option to OFF, the Query Optimizer will
update the outdated statistics before compiling the query. This option can be useful in
OLTP environments

References:https://www.mssqltips.com/sqlservertip/2766/sql-server-auto-update-and-auto-
create-statistics-options/

184

You might also like