Monthly Archives: May 2016

Restore a SQL Server Database with Different Methods

Database backups are generated as part of the business continuity planning procedure. Disasters with server or its database are a common scenario that takes place every now and then lead to the loss of an enormous amount of data. In … Continue reading

Posted in Backup and Restore | Tagged , | Leave a comment

The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

“The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)” error may occurs when executing PowerShell scripts using WMI query. There can be a few reasons for this error: The remote computer is blocked by the firewall. Solution: Open the Group … Continue reading

Posted in PowerShell | Tagged , , | Leave a comment

XML-> JSON document Example

Convert the XML document to JSON document example <person> <name>John</name> <age>25</age> <address> <city>New York</city> <postalCode>10021</postalCode> </address> <phones> <phone type=”home”>212-555-1234</phone> <phone type=”mobile”>646-555-1234</phone> </phones> </person>   { “name” : “John”, “age” : 25, “address” : { “city” : “New York”, “postalCode” : … Continue reading

Posted in JSON | Tagged , | 1 Comment

PowerShell : Scripting Logins, Role Assignments and Server Permissions Using PowerShell

This post is a continuation of Multiple DB refresh automation using PowerShell post . The OP requested me to automate the login transfer process as well. The script should generate an outfile and execute the file on the target server. <# .ProblemStatement Copying … Continue reading

Posted in PowerShell, SQL | Tagged , , | 6 Comments

MongoDB : Point in Time Restore/Recovery of MongoDB

This post demonstrates the methods of PIT recovery of the database. The step by step details of the recovery process is explained below The requirement for PIT restore/recovery is to setup a single node replica so that the oplogs can … Continue reading

Posted in MongoDB | Tagged , , , , , , , | Leave a comment

PowerShell – SQL Database Refresh -Restore – Multiple Databases

.SYNOPSIS The purpose of the script is to restore database/s from a database backup. The requirement is to refresh ‘n’ databases. .DESCRIPTION The advantage is that the flexibility of passing restoreDbList to restore specific group of databases. The Restore databases has … Continue reading

Posted in PowerShell, SQL | Tagged , , | 7 Comments

PowerShell – Backup Specific group of SQL Databases

<# .SYNOPSIS The purpose of the script is to initiate backup only for desired group of databases. The requirement is to refresh databases. .DESCRIPTION The advantage is that the flexibility of passing a list of specific group of databases for … Continue reading

Posted in PowerShell, SQL | Tagged , , , | 2 Comments

SQL Server : Could not load file or assembly ‘Microsoft.SqlServer.BatchParser, Version=10.0.0.0

I have recently encountered an issue with a third-party  backup application (Commvault) . I was trying to backup the databases on SQL 2014. It was throwing a below error “Description: Error encountered during backup. Error: [ Could not load file … Continue reading

Posted in SQL | Tagged | 3 Comments

PowerSehll : How to suppress the table heading and remove the blank space from a text file

There are a multiple ways to suppress and remove the first line from text file. The first scenario would be writing a suppressed heading to an output text file Or after writing, we can remove the line using trim function Or … Continue reading

Posted in PowerShell | Tagged , , | Leave a comment