n_srikanth4
asked on
Restore SSAS database using Windows PowerShell and SQL Server 2014 AMO
Hi Experts,
I am unable to restore the SSAS Cube 2014 database within the stipulated time (60 sec) and also the dialog box is not closed after the restoration is complete , not working as expected in SQL 2014 (using Power Shell)
Here is the link , I have used for the restoration of SSAS Cube 2008 , but the same is not working for SSAS 2014.
http://www.databasejournal .com/featu res/mssql/ article.ph p/3799636/ How-to-Res tore-an-SS AS-databas e-using-Wi ndows-Powe rShell-and -SQL-Serve r-2008-AMO .htm
Thanks,
SRK
I am unable to restore the SSAS Cube 2014 database within the stipulated time (60 sec) and also the dialog box is not closed after the restoration is complete , not working as expected in SQL 2014 (using Power Shell)
Here is the link , I have used for the restoration of SSAS Cube 2008 , but the same is not working for SSAS 2014.
http://www.databasejournal
Thanks,
SRK
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi SRK, Sorry for the delay response, in this case you can use this code. Save this code as .PS1 and call the script with error output redirection
let says .PS1 file location and name is D:\Shared\SSAS_Restore_Scr ipt.PS1
now command is: D:\Shared\SSAS_Restore_Scr ipt.PS1 2>&1 > D:\Shared\SSAS.txt
but how can I exit out of the power shell dialog window
stop-process -Id $PID --- For exit the window.
Please change the output file location and database name and file name accordingly.
let says .PS1 file location and name is D:\Shared\SSAS_Restore_Scr
now command is: D:\Shared\SSAS_Restore_Scr
but how can I exit out of the power shell dialog window
stop-process -Id $PID --- For exit the window.
Write-output "Restore process started" >D:\Shared\Restore_Log.txt
[Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices")
$servername=New-Object Microsoft.AnalysisServices.Server
$servername.connect("lap037")
$servername.restore("D:\SHAREd\Vendor2008_05262015.abf","Vendor2008",$true)
Type D:\Shared\SSAS.txt >>D:\Shared\Restore_Log.txt
Write-output "Restore process Completed" >>D:\Shared\Restore_Log.txt
stop-process -Id $PID
Please change the output file location and database name and file name accordingly.
ASKER