How to access DDBoost with PowerShell

Welcome Forums General PowerShell Q&A How to access DDBoost with PowerShell

This topic contains 5 replies, has 2 voices, and was last updated by

 
Participant
1 week ago.

  • Author
    Posts
  • #113968

    Participant
    Points: 0
    Rank: Member

    Hi,

    We use DDBoost to backup and restore our databases to a storage like SAN.

    How can I integrate PowerShell with DDBoost to backup or restore a database.

    Here it is a sample T-SQL command thru DDboost to refresh a dev database from production DB on different server:

    *********************************************************

    EXEC   @returnCode = dbo.emc_run_restore '

    -a NSR_DFA_SI_DD_HOST=pezdd01     (It is where our databases' backups are stored like SAN)

    -a NSR_DFA_SI_DD_USER=DDboost               (this is ddboost user which has access to the backups)

    -a NSR_DFA_SI_DEVICE_PATH=/SQLBoost_UGL     (path of the storage)

    -a "NSR_DFA_SI_DD_LOCKBOX_PATH=C:\Program Files\DPSAPPS\common\lockbox"

    -c ProdSERVER001                  (Source (Prod DB) server )

    -A DevSERVER001 (Target (Dev DB) server )

    -a "SKIP_CLIENT_RESOLUTION=TRUE"

    -C ""db_data"="I:\mssql\MSSQL12.MSSQLSERVER\MSSQL\DATA\TargetDB.mdf", "db_log"="J:\mssql\MSSQL12.MSSQLSERVER\MSSQL\Log\TargetDB_LOG.ldf""

    -f -S normal -d MSSQL:TargetDB MSSQL:SOURCEDB'

    *********************************************************

    Please let me know if need more clarification or detail.

    Thanks and regards in advance.

    Shoaib

  • #114001

    Participant
    Points: 65
    Published
    Rank: Member

    Don't know anything about DDBoost, but if its just an executable with some inputs, you can call it as if like you call it from any other shell(cmd.exe). More info on how you call DDBoost and its inputs will be good if you share and tell us the reason for opting PowerShell to execute this.

    • #114075

      Participant
      Points: 0
      Rank: Member

      Hi KVParasoon,

      Thanks for your prompt response.

      Actually this para is taken from a job which could refresh a dev database from backup of production DB.

      The reason to opt PS, there is no option to take input from users like which DB they want to refresh from which database i.e. TargetDB and SourceDB etc. in Script or Job in SQL Server Management Studio.

      So my intention to take input in PS and then pass the values to T-SQL or CLI then integrate into the job, so a user would run the script or click the job to run manually.

      Let me know if you need more info.

      Thanks.

      Shoaib

       

  • #114087

    Participant
    Points: 65
    Published
    Rank: Member

    you can create a script which takes these values via Parameters and create the sql query, a small example would be

    Param(
        [string]$TableName,
        [string]$Property,
        [string]$Server
    )
    $Query = @"
    Select $Property from $TableName
    "@
    
    $Query | Out-File -FilePath c:\Query.sql
    
    #Or calling an executable
    c:\SomeFile.exe -s $Server -t $TableName -p $Property
    

    You can do always everything in PowerShell, have fun automating your tasks...

    • #114142

      Participant
      Points: 0
      Rank: Member

      Hi KVParasoon,

      I have this sample script in PS, now please let me know how to pass these four values to SQL Script (T-SQL or CLI etc.):

      $targetdb = read-host -Prompt 'Which DB do you want to refresh (Target DB) '

      $targetserver = read-host -Prompt 'on What server '

      $sourcedb = read-host -Prompt 'Which DB do you want to refresh from (Source DB)'

      $Sourceserver = read-host -Prompt 'What is the source server '

      Thanks again for your time.

      Shoaib

  • #114148

    Participant
    Points: 65
    Published
    Rank: Member

    We are happy to help you, but from above conversations what I understood is that you miss basic understanding of PowerShell, so please take your time to understand basics of PowerShell, since you have few requirements to complete, it will be an easy task for you, you can start from

You must be logged in to reply to this topic.