dbTalk Databases Forums  

Using xp_cmdshell to backup AS databases

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Using xp_cmdshell to backup AS databases in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Roust_m
 
Posts: n/a

Default Using xp_cmdshell to backup AS databases - 08-20-2004 , 03:54 AM






Hi!
Trying to automate AS databases backup with xp_cmdshell. How should I
rewrite the following command to use it with xp_cmdshell?

"C:\Program Files\Microsoft Analysis Services\Bin\msmdarch" /a
MY_OLAPSERVER_NAME "D:\olap_data\" "CUBE_DB_NAME"
"F:\BACKUP\OLAP\CUBE_DB_NAME\CUBE_DB_NAME.cab"
"F:\BACKUP\OLAP\CUBE_DB_NAME\CUBE_DB_NAME.log"

I need something like this:


Declare @cmd varchar(2000)
Declare @dbname varchar(50)
select @dbname = 'MyDB'
select @cmd = 'C:\Program Files\Microsoft Analysis Services\Bin\msmdarch /a' + ...
exec master.dbo.xp_cmdshell @cmd

Thanks.

Reply With Quote
  #2  
Old   
Dave Wickert [MSFT]
 
Posts: n/a

Default Re: Using xp_cmdshell to backup AS databases - 08-20-2004 , 07:34 PM






And is the security credentials of the user running the process in the OLAP
Administrators group?
You may have to do so SQL Server RDBMS configuration changes to get this to
work.
And watch your quoting :-) double quotes might not flow out to the
commandline.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Roust_m" <roustam (AT) hotbox (DOT) ru> wrote

Quote:
Hi!
Trying to automate AS databases backup with xp_cmdshell. How should I
rewrite the following command to use it with xp_cmdshell?

"C:\Program Files\Microsoft Analysis Services\Bin\msmdarch" /a
MY_OLAPSERVER_NAME "D:\olap_data\" "CUBE_DB_NAME"
"F:\BACKUP\OLAP\CUBE_DB_NAME\CUBE_DB_NAME.cab"
"F:\BACKUP\OLAP\CUBE_DB_NAME\CUBE_DB_NAME.log"

I need something like this:


Declare @cmd varchar(2000)
Declare @dbname varchar(50)
select @dbname = 'MyDB'
select @cmd = 'C:\Program Files\Microsoft Analysis Services\Bin\msmdarch
/a' + ...
exec master.dbo.xp_cmdshell @cmd

Thanks.



Reply With Quote
  #3  
Old   
Roust_m
 
Posts: n/a

Default Re: Using xp_cmdshell to backup AS databases - 08-22-2004 , 04:14 AM



The security credentials are all Ok, but this is not the answer for my
question. I tried with this command but could not arrange all the
quotes to make it work. That is why I posted this on the forum.

"Dave Wickert [MSFT]" <dwickert (AT) online (DOT) microsoft.com> wrote

Quote:
And is the security credentials of the user running the process in the OLAP
Administrators group?
You may have to do so SQL Server RDBMS configuration changes to get this to
work.
And watch your quoting :-) double quotes might not flow out to the
commandline.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Roust_m" <roustam (AT) hotbox (DOT) ru> wrote in message
news:a388fd78.0408200054.5a3e4654 (AT) posting (DOT) google.com...
Hi!
Trying to automate AS databases backup with xp_cmdshell. How should I
rewrite the following command to use it with xp_cmdshell?

"C:\Program Files\Microsoft Analysis Services\Bin\msmdarch" /a
MY_OLAPSERVER_NAME "D:\olap_data\" "CUBE_DB_NAME"
"F:\BACKUP\OLAP\CUBE_DB_NAME\CUBE_DB_NAME.cab"
"F:\BACKUP\OLAP\CUBE_DB_NAME\CUBE_DB_NAME.log"

I need something like this:


Declare @cmd varchar(2000)
Declare @dbname varchar(50)
select @dbname = 'MyDB'
select @cmd = 'C:\Program Files\Microsoft Analysis Services\Bin\msmdarch
/a' + ...
exec master.dbo.xp_cmdshell @cmd

Thanks.

Reply With Quote
  #4  
Old   
Roustam Akhmetov
 
Posts: n/a

Default Re: Using xp_cmdshell to backup AS databases - 08-22-2004 , 04:23 AM



The security credentials are all Ok, but this is not the answer for my
question. I tried with this command but could not arrange all the
quotes to make it work. That is why I posted this on the forum.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #5  
Old   
James
 
Posts: n/a

Default Re: Using xp_cmdshell to backup AS databases - 08-24-2004 , 07:39 AM



The problem using msmdarch with xp_cmdshell is that the
security credentials is always a headache. U have to grant
the access right to the olap database folder as well.

But I suggest this walk around solution...
since u have the @cmd constructed, put ur script into a
SQL task in a DTS, then export this script to a batch
(.bat) file and run the bat file from server.


rgrds,
James Gan HJ


Quote:
-----Original Message-----
The security credentials are all Ok, but this is not the
answer for my
question. I tried with this command but could not
arrange all the
quotes to make it work. That is why I posted this on the
forum.

"Dave Wickert [MSFT]" <dwickert (AT) online (DOT) microsoft.com
wrote in message
news:<#ZCmQaxhEHA.4064 (AT) TK2MSFTNGP12 (DOT) phx.gbl>...
Quote:
And is the security credentials of the user running the
process in the OLAP
Administrators group?
You may have to do so SQL Server RDBMS configuration
changes to get this to
work.
And watch your quoting :-) double quotes might not flow
out to the
commandline.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties,
and confers no rights.

"Roust_m" <roustam (AT) hotbox (DOT) ru> wrote in message
news:a388fd78.0408200054.5a3e4654 (AT) posting (DOT) google.com...
Hi!
Trying to automate AS databases backup with
xp_cmdshell. How should I
rewrite the following command to use it with
xp_cmdshell?

"C:\Program Files\Microsoft Analysis
Services\Bin\msmdarch" /a
MY_OLAPSERVER_NAME "D:\olap_data\" "CUBE_DB_NAME"
"F:\BACKUP\OLAP\CUBE_DB_NAME\CUBE_DB_NAME.cab"
"F:\BACKUP\OLAP\CUBE_DB_NAME\CUBE_DB_NAME.log"

I need something like this:


Declare @cmd varchar(2000)
Declare @dbname varchar(50)
select @dbname = 'MyDB'
select @cmd = 'C:\Program Files\Microsoft Analysis
Services\Bin\msmdarch
/a' + ...
exec master.dbo.xp_cmdshell @cmd

Thanks.
.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.