Latest developer linksBookmark and Share
 
HomeThis WeekTop MonthTop AlltimeSearchRegisterFAQ
  
 
Submit Your Link
Please login to submit your Link
 

Automated DPM SQL restore from one database to a reporting database???

Posted: Jan/22/2011   By: nikhil   Points:15   Category: .NET  - ASP.Net    Views:137   Vote Up (0)   Vote Down (0)    

Goal:  Nightly DPM 2010 restore from clustered SQL Production database to overwrite Production Reporting Database on same server.

I know this cannot be done via DPM 2010 GUI and needs to be approached via DPM's Powershell Cmdlets.  I'm just getting stuck in the forest of cmdlet syntax.  I'm not worried about how to schedule that (I'll just use task scheduler), I just need to figure out how to finish this script.

Here is where I am at so far (I know I have a bit to go still).  Any help would be apprecaited:

$pg = Get-ProtectionGroup -DPMServername <SERVER NAME> #Set dpm server

$ds = Get-Datasource - ProtectionGroup $pg[x]  # Get SQL Data protection group (x=protection group position in array)

$rp = Get-RecoveryPoint -Datasource $ds[x]  # Get SQL Database to restore from (x=database position in array)

$rp[-1] # Returns lastest recovery point for SQL Database to be restored from

so now that I have the recovery point for the source Database, how do I go about overwriting a different destination database on the same server and instance?  I think i have to use the following Cmdlets, but I need to nail down the syntax and get this completed asap (reminder: clustered instance of sql):

Get-RecoverableItem

New-RecoveryOption

Recover-RecoverableItem

 

Thank you in advance for your help :)

Ian

View Complete Post


Comments:
Be the first to comment this post.
 
Post Comment
Please login to post your comment
More Related Resources

How to import existing database into Webmatrix?

  

I am planning to use Webmatrix as a testing arena for creating and completing the preparation of a website before publishing it. Working with websites on local computer should be much faster than doing that on an online server.

That is why I downloaded a database that I have already created on my online host account, and wanted to import it into webmatrix to continue building my new website using Webmatrix. Here, I did not know how to imort the DB I downloaded from my host, into webmatrix. There is seemingly no way to do that, or to import tables into an existing DB on webmatrix. 

Is that not possible? 

2- I tried to create a new DB on webmatrix which is a part of installing Wordbress on WM (new site from web gallery --> Wordpress), but I get this error :

The database 'xxxx' could not be created. ---> MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts. ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:3306


I have installed PHP 5.2 and Mysql on Webmatrix. 


Why does this happen?


How to Restore Radio Button Values

  

Good morning WebMatrix Adventurers,

I read and implemented the sample form that teaches how to restore form variables after a postback; pretty cool.  However, my form includes radio buttons and I can't figure out how to restore the checked radio button after postback.  Any suggestions would be greatly appreciated. 


how to open a database in a webmatrix C# file?

  

In the webMatrix examples, which I have working, it's very easy to access a database. Only three lines are necessary to get up and going:

@{ 
    var db = Database.Open("LOS");  
    var selectQueryString = "SELECT * FROM wknTest"; 
} 

and a little later,

 @foreach(var row in db.Query(selectQueryString)){  

There's no using's, no connection strings, all that happens behind the scenes. But now I have enough complicated c# code that I want to separate it into a separate C# file. How would I do the above, but in a C# file residing in the app_code folder in a webMatrix project? 

WebMatrix must be creating the Database object behind the scenes.  So I'm really asking how do I have access to that.


Webmatrix.Data.Database.Query() method return type

  

I'm using the Webmatrix.Data.Database.Query method to return a result set in the following form

var myResult = db.Query("Select * from mytable");

How do you cast myResult to get the count of records returned? I'd like to do something like

   myResult.Count


Login Control with SQL Database

  

Hello,

I'm in a trouble with the Login Control of ASP.NET to check the credentials against an SQL Database.

I followed all the instructions from http://www.aspxcode.net/free-asp-net-login-source-code.aspx?Topics=How to Login With SQL Server Database but I have errors.

 

In a master page, I added a Login Control as follows:

<asp:LoginView ID="LoginView1" runat="server">
                <AnonymousTemplate>
                    <asp:Login ID="Login1" runat="server" OnAuthenticate="Login1_Authenticate" BorderPadding="0"
                        BorderStyle="None" BorderWidth="0px" EnableTheming="True" Font-Names="Arial"
                        Font-Size="X-Small" ForeColor="#333333" LoginButtonImageUrl="~/imgs/nav/en/Login.gif"
                        LoginButtonType="Image" TitleText="" TextLayout="TextOnTop" Width="120px" RememberMeText="Remember me.">
                        <CheckBoxStyle VerticalAlign="Middle" HorizontalAlign="Left" />
                        <InstructionTextStyle Font-Italic="True" ForeColor="Black" />
                        <LabelStyle HorizontalAlign="Left" Width="130px" />
                        <LoginButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="None" Font-Names="Arial"
                            Font-Size="X-Small" ForeColor="#284775" CssClass="loginBox" />
                        <TextBoxStyle Font-Size="X-Small" Width="120px" />
                        <TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="X-Small" ForeColor="White" />
                    </asp:Login>               
                </AnonymousTemplate>
                <LoggedInTemplate>
                    <asp:LoginName ID="LoginName1" runat="server" /><br />
                    <asp:LoginStatus ID="LoginStatus1" runat="server" />
                </LoggedInTemplate>
                </asp:LoginView>

 

Also, I have implemented an internet found class to the project to connect, OnAuthenticate, to the SQL Database. The code is the following:

Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.Configuration

Partial Class how_to_login_with_sql_server
    Inherits System.Web.UI.MasterPage

 &nb

When choosing POCO, First Model or the EDMX created from the database?

  

Good morning, this is my first post here.

I will make a system that will be sold at retail, placed in the clouds. The EDMX created from the database seemed the most natural choice since in reality the database exists and is already populated, it has a lot of data.

The First Model did not seem a natural solution since it is difficult today a completely new solution, and the examples I saw did not show me because I use it.

About POCO, what advantages do I have using it?

Thanks,

Bruno


Northwind database

  
I have to do an exercize where i am using Northwind sample database.  I am normally accustomed to linking to a database on another server.  Is there a way i can just include the Northwind database to my project.  In general, I need to find out how to link to the Northwind db so I can start querying and processing data.  thanks for your help

where to get northwind database

  

i need links from where i can  download northwind database both access and sql format

 

thanx

 


updating record in database ms access

  

In the table, I have ID, name, and photo.  After create a new record in the table.  I want to change the photo in the record. 

In the folder Images, the pix got update. But when I retreive the record to display on the form, it still shows the old image. Why does it like that?

Thanks for any reply here.

 


How to Detect Database Connection and Setup New Connectikonstring from ASP.NET WebPart

  

Hello All,

I am writing a series of WSS/MOSS webparts amongst which one will need to detect the current SQL Server database connection, prompt the user to setup a new connectionstring, and fire appropriate stored procedures to create a new database if needed. 

The user needs to be presented a textbox or label control with the current database connection.  I've never had to detect current database connection, what methods do I call for this?  If the desirable connection is not present, the web application needs to prompt the user to make a new database.  The user really won't make the database, they simply need to click the command button which will fire the stored procedure to create the database.

 

Please advise this noob on how to do this in a 3.5 webpart. Thanks much for your help and guidance!

Sid 


 
Categories:
.NET
Java
PHP
C/C++/VC++
HTML/XML
SAP
MainFrames
Data Warehousing
Testing
MySQL
SQL Server
Oracle
Javascript/VB Script
Others
Login
 
 
 
 
 Forgot password
 Contact Us   Terms Of use   Share your knowledge