Home » Microsoft » 70-462 v.2 » Which Transact-SQL statement should you use before attempting the restore?
You administer a Microsoft SQL Server 2012 database.
You configure Transparent Data Encryption (TDE) on the Orders database by using the following statements:
You attempt to restore the Orders database and the restore fails. You copy the encryption file to the original location.
A hardware failure occurs and so a new server must be installed and configured.
After installing SQL Server to the new server, you restore the Orders database and copy the encryption files to their original location. However, you are unable to access the database.
You need to be able to restore the database.
Which Transact-SQL statement should you use before attempting the restore?
A. Option A
B. Option B
C. Option C
D. Option D
Correct Answer: C
Explanation/Reference:
Explanation:
To create a database protected by transparent data encryption
The following procedures show you have to create a database protected by TDE using SQL Server Management Studio and by using Transact-SQL.
Using SQL Server Management Studio
1. Create a database master key and certificate in the master database.
2. Create a backup of the server certificate in the master database.
Etc.
In transact sql:
— Create a database master key and a certificate in the master database.
USE master ;
GO
CREATE MASTER KEY ENCRYPTION BY PASSWORD = ‘*rt@40(FL&dasl1’;
GO
CREATE CERTIFICATE TestSQLServerCert
WITH SUBJECT = ‘Certificate to protect TDE key’
GO
— Create a backup of the server certificate in the master database.
— The following code stores the backup of the certificate and the private key file in the default data location for this instance of SQL Server
— (C:Program FilesMicrosoft SQL ServerMSSQL13.MSSQLSERVERMSSQLDATA).
BACKUP CERTIFICATE TestSQLServerCert
TO FILE = ‘TestSQLServerCert’
WITH PRIVATE KEY
(
FILE = ‘SQLPrivateKeyFile’, ENCRYPTION BY PASSWORD = ‘*rt@40(FL&dasl1’
);
GO
Etc.
‘
References:
https://docs.microsoft.com/en-us/sql/relational-databases/security/encryption/move-a-tde-protected-database-to-another-sql-server