Detaching, encrypting, and attaching a database encrypted with EFS
There might be times when you do not want to stop the SQL Server service during database encryption; for example, when there are several databases running on that service and you do not want them to be unavailable. You can detach, encrypt, and attach the database instead.
Before you begin
Procedure
- Go to and stop the SQL Server service that hosts the AppScan® Enterprise database you are going to encrypt. The default service is SQL Server (MSSQLSERVER).
- Right-click the name of the service to open the properties dialog. On the Log on tab, select This account, enter the credentials of the service account, and then click OK.
- In the Services window, start the SQL Server that hosts the AppScan Enterprise database.
- In Windows™ Explorer, right-click the <databasename.mdf> file and go to OK. , and click
- Open Microsoft™ SQL Server Management Studio and connect to the SQL Server that serves that database.
- Under the 'Databases' tree, right-click the database you want to encrypt and click .
- In the Detach Database window, if there are open connections, select the Drop Connections check box and click OK.
- In Windows Explorer, right-click the <databasename.mdf> file and go to OK. , and click
- Repeat Steps 3 and 4 for the <databasename.ldf> file.
- In Microsoft SQL Server Management Studio, right-click the Databases tree, and choose Attach.
- In the Attach Databases window, click Add and navigate to the encrypted <databasename.mdf> file. Select it and click
- Repeat Step 11 for the <databasename.ldf> file.