Showing posts with label contain. Show all posts
Showing posts with label contain. Show all posts

Thursday, March 22, 2012

BACKUP SERVICE MASTER KEY TO FILE

Hello,
I would to create a backup file dynamically (the filename will contain
the hostname of the DB).
any idea how can I use a variable for that?
(a variable is easy to use for a regular database backup, but not for
a master key).
I wrote on the comment the error I get.
thanks, Yaniv
use master;
declare @.tmpStr varchar(200)
set @.tmpStr = 'c:\temp\DB_service_2.key'
-- working
BACKUP SERVICE MASTER KEY TO FILE = 'c:\temp\DB_service.key'
ENCRYPTION BY
PASSWORD = 't1t1t1t1t1'
-- error: Incorrect syntax near '@.tmpStr'
BACKUP SERVICE MASTER KEY TO FILE = @.tmpStr ENCRYPTION BY PASSWORD = 't1t1t1t1t1'
goYou can use dynamic SQL. Built the BACKUP command in a TSQL varchar variable, then execute it:
EXEC(@.sql)
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<yaniv.harpaz@.gmail.com> wrote in message
news:1170238336.716966.152710@.p10g2000cwp.googlegroups.com...
> Hello,
> I would to create a backup file dynamically (the filename will contain
> the hostname of the DB).
> any idea how can I use a variable for that?
> (a variable is easy to use for a regular database backup, but not for
> a master key).
> I wrote on the comment the error I get.
> thanks, Yaniv
> use master;
> declare @.tmpStr varchar(200)
> set @.tmpStr = 'c:\temp\DB_service_2.key'
> -- working
> BACKUP SERVICE MASTER KEY TO FILE = 'c:\temp\DB_service.key'
> ENCRYPTION BY
> PASSWORD = 't1t1t1t1t1'
> -- error: Incorrect syntax near '@.tmpStr'
> BACKUP SERVICE MASTER KEY TO FILE = @.tmpStr ENCRYPTION BY PASSWORD => 't1t1t1t1t1'
> go
>

Sunday, February 12, 2012

backup history: 3d party vendor

Hello,
It seems that the system table [backupset] does *not* contain backups ma
de by our 3d party backup
tool (Veritas), but only backups made by the SQL Server tools (Q.A., Agent c
ontrolled Tasks...).
Is this true?
How can I query the backup history of the 3d party tool?
(SQL S. 2000)
Thank You
JoachimJoachim
Please refer to
backupfile, backupmediafamily, backupmediaset, backupset, restorefile,
restorefilegroup, and restorehistory.
"Joachim Hofmann" <speicher@.freenet.de> wrote in message
news:4056CD31.45AC9D4B@.freenet.de...
> Hello,
> It seems that the system table [backupset] does *not* contain backups made[/co
lor]
by our 3d party backup
> tool (Veritas), but only backups made by the SQL Server tools (Q.A., Agent
controlled Tasks...).
> Is this true?
> How can I query the backup history of the 3d party tool?
> (SQL S. 2000)
> Thank You
> Joachim|||Uri Dimant wrote:
> Joachim
> Please refer to
> backupfile, backupmediafamily, backupmediaset, backupset, restorefile,
> restorefilegroup, and restorehistory.
Thanks, I think I found the jobs. What really confuses me: The columns with
"software" in their name
always contain 'Microsoft SQL Server', in spite of the backup was made by th
e 'Veritas' Tool.
i.e:
select distinct software_name
from backupmediaset
Joachim