Showing posts with label backup-restore. Show all posts
Showing posts with label backup-restore. Show all posts

Friday, February 24, 2012

Backup-Restore on Encrypted Columns

I have some columns that are encrypted using SQL Server 2005 built in
encryption. What happens when I backup and restore this database on another
server? Does SQL Server have to re-encrypt these columns on this new
server? The Master Key is different on the new server, right?
--IKEThe Service Master Key is different, yes. The Database Master Key and all
other keys in the database were carried over with your data.
So the only thing that you may need to do is to re-encrypt the Database
Master Key with the Service Master Key of the new server, if you had such SM
K
encryption on the old server as well. To do this, you need to do the
following steps while connected to the database:
-- open the database master key
OPEN MASTER KEY DECRYPTION BY PASSWORD = 'whatever_password'
-- re-encrypt with the current server's SMK
ALTER MASTER KEY ADD ENCRYPTION BY SERVICE MASTER KEY
For more info about these statements, see:
http://msdn2.microsoft.com/en-us/library/ms130214.aspx
http://msdn2.microsoft.com/en-us/library/ms186937.aspx
This scenario was also discussed here:
http://blogs.msdn.com/lcris/archive.../30/475822.aspx
Thanks
Laurentiu Cristofor [MSFT]
Software Design Engineer
SQL Server Engine
http://blogs.msdn.com/lcris/
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ike the Potato" wrote:

> I have some columns that are encrypted using SQL Server 2005 built in
> encryption. What happens when I backup and restore this database on anoth
er
> server? Does SQL Server have to re-encrypt these columns on this new
> server? The Master Key is different on the new server, right?
> --IKE
>
>

Monday, February 13, 2012

Backup vs Export data

Please, can anyone sort this out for me?

What is the difference between backup-restore and export-import data?
Thanks in advance :rolleyes:Export-Import uses DTS to transfer data directly between two databases. Backup dumps data to a file on a drive, and restore loads data from files.|||Thanks for anwering my post :)
So, in case of an emergency, If I do not have a backup, but I have exported data in an other database, I can import data again and everything would be ok?|||I would use backups because what the blinddude forgot to mention is that backups perserve the database objects as well (stored procedure, triggers, views, functions etc...) as well. If your environment is like mine, people are making changes all the time to this stuf.

Also, if you structure your disaster recovery correctly, you can achieve point in time recovery and minimize data loss.|||Well, you could import objects from a remote database as well, though transferring logins and permissions would be difficult.

The big reason (or one of them) for using backups is that you can maintain multiple backup files, allowing you to restore your database to any point in time, down to the minute if data corruption occurs. You cannot do this with import/export. DTS was not meant for data archiving or recoverability, and should not be used for such.|||Thanks for answering my post!
I think that I once used the Enterprise Manager and I was able to export Stored Procedures using the export data feature.
Isn t that possible on Management Studio?