Re: Password protected BAK Files
From: Jasper Smith (jasper_smith9_at_hotmail.com)
Date: 12/31/03
- Next message: Kalen Delaney: "Re: Password protected BAK Files"
- Previous message: Nancy Kafer: "Re: SQL Server Role Security"
- In reply to: Tuoc: "Password protected BAK Files"
- Next in thread: Kalen Delaney: "Re: Password protected BAK Files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 31 Dec 2003 19:47:04 -0000
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... > 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
- Next message: Kalen Delaney: "Re: Password protected BAK Files"
- Previous message: Nancy Kafer: "Re: SQL Server Role Security"
- In reply to: Tuoc: "Password protected BAK Files"
- Next in thread: Kalen Delaney: "Re: Password protected BAK Files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|