Friday, March 9, 2012

Password protected BAK Files

Hello All,
Can anyone help me? I would like to put a password on BAK files everytime my
backup jobs run. So that when I restore a db from one of these BAK files, I
need to provide the password.
Thanks in Advance,
Tuoc"Tuoc" <anonymous@.discussions.microsoft.com> wrote in message
news:D9549303-3521-4C75-ABFB-685820FC140D@.microsoft.com...
quote:

> Can anyone help me? I would like to put a password on BAK files everytime

my backup jobs run. So that when I restore a db from one of these BAK files,
I need to provide the password.
quote:

>

If you are looking to secure your BAK files, consider using EFS (Encrypted
File System) for the folder that you dump your BAK files. Even if you could
make this work, file level passwords would not be of any value.
Steve|||SQL2000 only
BACKUP DATABASE pubs to DISK = 'c:\pubs.bak'
WITH PASSWORD = 'test'
If you try and restore this without a password, you get
RESTORE DATABASE pubs FROM DISK = 'c:\pubs.bak'
WITH REPLACE
Server: Msg 3279, Level 16, State 2, Line 1
Access is denied due to a password failure
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
To restore, you need the password e.g.
RESTORE DATABASE pubs FROM DISK = 'c:\pubs.bak'
WITH REPLACE,PASSWORD = 'test'
However, I've never really seen anyone use this. There's also the issue of
managing/generating/storing the passwords so they're not just hardcoded into
the jobs but using something like NEWID would probably do it but you would
have to store it with the backup filename somewhere so you could restore it
e.g.
declare @.p varchar(36) ; set @.p = NEWID()
declare @.file varchar(200) ; set @.file = '<generate filename>'
-- store password away somewhere secure with filename
BACKUP DATABASE pubs to DISK = @.file
WITH PASSWORD = @.p
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Tuoc" <anonymous@.discussions.microsoft.com> wrote in message
news:D9549303-3521-4C75-ABFB-685820FC140D@.microsoft.com...
quote:

> Hello All,
> Can anyone help me? I would like to put a password on BAK files everytime

my backup jobs run. So that when I restore a db from one of these BAK files,
I need to provide the password.
quote:

> Thanks in Advance,
> Tuoc
|||Tuoc
You also posted this on .server where there are quite a few reponses. Please
do not post the same questions on multiple newsgroups independently, so you
will not have to follow multiple threads of response, and so other people
won't waste time answering a question that has already been answered.
Thanks!
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Tuoc" <anonymous@.discussions.microsoft.com> wrote in message
news:D9549303-3521-4C75-ABFB-685820FC140D@.microsoft.com...
quote:

> Hello All,
> Can anyone help me? I would like to put a password on BAK files everytime

my backup jobs run. So that when I restore a db from one of these BAK files,
I need to provide the password.
quote:

> Thanks in Advance,
> Tuoc
|||Kalen,
I'm sorry about that.
Tuoc

No comments:

Post a Comment