Auto restore multiple databases in One shot using powershell

Below script helps restore several databases on to a SQL Server instance in one go. We just have to place all the .bak files in a folder and execute the script. before running the script, its required to import SQLPS in the powershell prompt as below.

Save below script as restore_all.ps1

Execute the script like in below example.

Git | Frequently used commands

To check for any changes in the files.

View Change history and comments.

To see the change history per file

See changed files history

Commit the change

To revert back a commit

To create a clone of your local repository

To create a bare clone(A clone with the .git database alone) as a central repository

To see remote branches

Add/remove a remote branch

Push local changes to remote branch


If you want to start tracking a remote branch with git status command, run below command.


Continue reading “Git | Frequently used commands”

Automatically add Partition for Partitioned Tables

This stored procedure helps automatically create new partition on a new file group to an already partitioned table. I have tested the script in my testlab. Please review and let me know for any corrections if required.

Continue reading “Automatically add Partition for Partitioned Tables”

Failover Cluster Manager (cluadmin.msc) GUI crashes in Windows Server 2012

One fine day, I was given a project to deploy a failover cluster on Windows server 2012. I did all the usual steps. Enabled failover clustering feature, Validated and created the Windows cluster. But unfortunately, when I click on the cluster name or any group or resource in the Failover Cluster Manager GUI, below popup shoots out and the cluadmin.msc stops responding.FailoverCluster GUI Error Continue reading “Failover Cluster Manager (cluadmin.msc) GUI crashes in Windows Server 2012”

Install .net Framework 3.5 on Windows Server 2012

Normally until Windows Server 2008, we use to have the .net Framework available to enabled from Server features section in Server manager. We just have to enable the feature to install .net FW 3.5.

Here we ran into a situation where we had to install SQL Server 2014 on a Windows 2012 Server. .net Framework 3.5 was required for SQL 2014 and Windows 2012 didn’t have that by default. Also, unlike SQL Server 2008 or 2012, 2014 setup doesn’t install it by itself. It just say’s that it needs to be installed manually. We tried to enable the feature via Server manager, but it fails saying the source files doesn’t exist.

Below is how we finally managed to install .net 3.5.

  1. There is a folder named sxs in Windows Server 2012 / 2012R2 Install Disk. We extracted the sxs folder from a disk image and copied them over to C:\Softwares\Source\sxs folder on the target 2012 windows server.
  2. Open a powershell prompt and execute below command. It would take few minutes to complete and you now have .net Framework 3.5 on your Windows Server 2012.

MongoDB M102 Final Exam Completed!

Final: Question 1

Problems 1 through 3 are an exercise in running mongod’s, replica sets, and an exercise in testing of replica set rollbacks, which can occur when a former primary rejoins a set after it has previously had a failure.

Get the a.sh and a.js files from Download Handout link. Use a.bat instead of a.sh on Windows.

Start a 3 member replica set (with default options for each member, all are peers). (a.sh will start the mongod’s for you if you like.)

You will need to initiate the replica set yourself.

Continue reading “MongoDB M102 Final Exam Completed!”