Sql Server : Create Master Key (database key)
- Posted by Sqltimes
- On May 7, 2014
- 0 Comments
Quick one today
Creating database master key is important and prerequisite to creating other certificates in a Sql Server database. Database Master key is at each database level and is stored in both the user database and in master database.
Some highlights of this database Master key:
- It is a symmetric key
- Used to protect other keys in the user databases
- Private keys of certificates
- Other symmetric keys
- Encrypted by password
- Algorithm used is AES_256
- Backup this key and store off-site, if you can.
1
2
3
4
5
|
-- -- Script to create master database key -- CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'W#$%#$5jsdfkl3q4w3kl;jsdfji' GO |
The copy of this database master key stored in master database and is encrypted with Service Master key stored at the instance level (master database).
Hope this helps,
0 Comments