Forum Discussion

Skanska_ITCE's avatar
2 years ago

Create many bch files to restore SQL Server using powershell

I need some script to restore multiple ms sql server database. I don't wont to use db client gui because for many database it take long time and I want to automate this task.
Most of data about backup it is easy to retrieve using bplist but information about logical names (db and log) is missing.
How can i get this information from netbackup using command or API?

  • Hello

    You can use the NBU SQL GUI on the client to select the databases and create the scripts? Have you tried that?

  • Hello,

    VirgilDobos the customer has said that: " I don't wont to use db client gui".

    Skanska_ITCE i dont think this info is in basic NetBackup metadata. You must open backup image header to get it. I am not aware about any CLI tools except NBU SQL console or WebUI.

    If it is an alternate restore, you can also get these data from a live instance.

    Regards

    Michal

     

  • Hello,

    ok correction - try to play with bpflist. For example:

    bpflist -backupid sql01_1696708148

    It returns an output where you have also logical names. Its format is a bit complex, though.

    regards

    Michal

  • Thanks for this hint - bpflist give me all what I need, unfortunately this command is only on the "mastar server" but not on client machine