Task 10
You need to ensure that indexes are created automatically for all the databases on sql60152867. You may need to use SQL Server Management Studio and the Azure portal.
The Answer Is:
See the explanation part for the complete Solution.
Explanation:
Enable Automatic tuning at the server level and turn Create Index to On.
Microsoft states that Azure SQL Database automatic tuning can create indexes automatically, verify performance improvement, and roll back changes if performance regresses. Server-level automatic tuning settings are applied to all databases on the server by default, unless a database has its own override.
Azure Portal Method — Recommended for Simulation
Step 1: Open the SQL logical server
Sign in to the Azure portal.
Search for SQL servers.
Open:
sql60152867
Do not open only db1. The task says all databases on sql60152867, so configure this at the server level.
Step 2: Open Automatic tuning
In the SQL server left menu:
Go to Intelligent Performance.
Select Automatic tuning.
Microsoft’s documented path is to open the Azure SQL server in the portal and select Automatic tuning from the menu.
Step 3: Enable automatic index creation
On the Automatic tuning page, configure:
Setting
Value
Create index
On
Drop index
Leave unchanged unless required
Force last good plan
Leave unchanged unless required
The only required setting is:
Create index = On
Do not confuse this with Drop index. The task only asks to ensure indexes are created automatically.
Step 4: Apply the setting
Select Apply or Save.
Wait for the portal confirmation.
The setting is now configured at the SQL logical server level.
Important Database Inheritance Check
This is the part people miss.
Server-level automatic tuning applies to databases that inherit from the server. Microsoft states that individual databases can override server-level automatic tuning settings. Therefore, if the simulation shows any database with custom automatic tuning settings, set that database to Inherit from server or manually set Create index = On for that database.
For each database, the correct inherited state should be:
Automatic tuning = Inherit from server
Create index = Inherited / On
If a database is set to:
Custom
Create index = Off
then the server-level setting might not affect that database. Fix it.
Database-Level T-SQL Method
Use this only if the portal is unavailable or you need to correct a specific database override.
Connect to each database and run:
ALTER DATABASE CURRENT
SET AUTOMATIC_TUNING (
CREATE_INDEX = ON
);
Microsoft documents this exact syntax for enabling the CREATE_INDEX automatic tuning option by T-SQL on an individual Azure SQL Database.
To make an individual database inherit server settings, run:
ALTER DATABASE CURRENT
SET AUTOMATIC_TUNING = INHERIT;
But this must be executed inside each database, not from master as a single server-wide T-SQL command.
Verification with T-SQL
Connect to a database and run:
SELECT
name,
desired_state_desc,
actual_state_desc
FROM sys.database_automatic_tuning_options
WHERE name = ' CREATE_INDEX ' ;
Expected result:
name CREATE_INDEX
desired_state_desc ON or DEFAULT
actual_state_desc ON
If desired_state_desc is DEFAULT, that usually means the database is inheriting the server-level setting. The key result is:
actual_state_desc = ON
SSMS Clarification
SSMS can be used to verify or configure the setting per database using T-SQL, but it is not the best tool for the requirement as written.
Because the task says:
all the databases on sql60152867
the correct primary method is:
Azure portal > SQL server > Automatic tuning > Create index = On
Final Exam-Lab Action
Configure this:
SQL server: sql60152867
Automatic tuning
Create index: On
Apply
Then verify databases are inheriting the server setting or have CREATE_INDEX = ON.
That completes the task.
Task 2
You need to configure differential backups for the db1 Azure SQL database to be once a day instead of twice day. You may need to use SQL Server Management Studio and the Azure portal.
The Answer Is:
See the explanation part for the complete Solution.
Explanation:
Requirement: Configure differential backups for Azure SQL Database db1 to run once a day instead of twice a day.
Correct setting: Change Differential backup frequency from 12 Hours to 24 Hours.
Azure SQL Database supports differential backup frequency of either 12 hours or 24 hours. A 12-hour frequency means twice per day; a 24-hour frequency means once per day. Microsoft also notes that 24-hour differential backup frequency can increase restore time compared with 12-hour frequency.
Method 1 — Azure Portal Method
This is the best method for the simulation.
Step 1: Open the Azure SQL logical server
Sign in to the Azure portal.
Search for SQL servers.
Open the logical SQL server that hosts database db1.
Do not start from SQL Server Management Studio for this task. The differential backup frequency is an Azure SQL backup policy setting, not a normal T-SQL database setting.
Step 2: Open the Backups page
In the SQL server left menu, select Backups.
Select the Retention policies tab.
Microsoft’s documented portal path is to go to the logical SQL server, select Backups, then select the Retention policies tab.
Step 3: Select database db1
In the list of databases, locate db1.
Select the checkbox next to db1.
Select Configure policies from the action bar.
Step 4: Change the differential backup frequency
In the policy configuration pane:
Find Differential backup frequency.
Change it from:
12 Hours
to:
24 Hours
Leave the PITR retention period unchanged unless the task specifically tells you to change it.
Select Apply or Save.
Microsoft’s documented option is exactly 12 Hours or 24 hours under Differential backup frequency.
Method 2 — Azure CLI Method
Use this if the simulation provides Cloud Shell.
az sql db str-policy set \
--resource-group < resource-group-name > \
--server < server-name > \
--name db1 \
--retention-days < current-retention-days > \
--diffbackup-hours 24
Example:
az sql db str-policy set \
--resource-group RG1 \
--server sql60152867 \
--name db1 \
--retention-days 7 \
--diffbackup-hours 24
Microsoft documents az sql db str-policy set with --diffbackup-hours 24 for changing active database differential backup frequency. Valid values are 12 or 24 hours.
Be careful: do not guess the retention days blindly in a real environment. In the exam lab, use the existing retention value shown in the portal unless the task also asks you to change retention.
Method 3 — PowerShell Method
Use this if Azure PowerShell is available.
Set-AzSqlDatabaseBackupShortTermRetentionPolicy `
-ResourceGroupName " < resource-group-name > " `
-ServerName " < server-name > " `
-DatabaseName " db1 " `
-RetentionDays < current-retention-days > `
-DiffBackupIntervalInHours 24
Microsoft documents Set-AzSqlDatabaseBackupShortTermRetentionPolicy with -DiffBackupIntervalInHours 24 for setting Azure SQL Database differential backup frequency.
SSMS / T-SQL Clarification
For this task, SSMS is not the right tool to change the setting.
There is no normal ALTER DATABASE T-SQL command in Azure SQL Database to change automated differential backup frequency. Microsoft documents this change through:
Azure portal
Azure CLI
PowerShell
REST API
not SSMS/T-SQL.
You may use SSMS only to confirm the database exists and is accessible, but the backup frequency setting must be changed from Azure management tools.