Log in | Register

PowerShell Archives - SQL Server Blogs, Events, Webcasts, Videos, SQL Server learning & education PowerShell Archives - SQL Server Blogs, Events, Webcasts, Videos, SQL Server learning & education

PowerShell

SQLServerGeeks Annual Summit 2016 IS HAPPENING IN BANGALORE. HAVE YOU REGISTERED?

Setting SQL Server Start-up Parameters across Multiple Instances

Hello Geeks,

This is the first blog of the part of blogs set I am going to write for next few months. I have been working on a centralized approach for Database Administration. I know this has been mostly the case for bigger organisations. This blog series will target DBAs who are finding difficult to […]

SQL Server Database Migration : DB-Migrate V 5.0 : PowerShell Module to Migrate Databases

SQL Server Database Migration between sql instances is a time taking and a tedious task which becomes even more complicated when one has more than 10-12 databases to migrate.

This PowerShell module aims to automate manual task involved in SQL Server Database Migration.  A typical database migration involves below steps.

Move Logins between instances
Move database between instances
Fix […]

By |February 20th, 2014|Categories: Programming|Tags: , |Comments Off on SQL Server Database Migration : DB-Migrate V 5.0 : PowerShell Module to Migrate Databases

SQL Server Database Migration : DB-Migrate V 4.0 : PowerShell Module to Migrate Databases

This is an update on DB-Migrate Module. The change log is mentioned below.

Changes in SQL Server Database Migration PowerShell Module on 27th Dec 2012

Version Check. Move-Database function now checks for Source and Destination versions. As Sql Server doesn’t supports detach/attach method when moving database from higher to lower Instance, the function terminates.
Fixed a bug where in […]

By |December 27th, 2013|Categories: Programming|Tags: , |1 Comment

SQL Server Database Migration : DB-Migrate V 3.0 : PowerShell Module to Migrate Databases

This is an update on SQL Server Database Migration PowerShell Module. The change log is mentioned below.

Changes in DB-Migrate V3 on 25th Dec 2012

Reviewed by Aman Dhally – Powershell MVP. Thanks a lot Aman for review and your valuable comments.
Fixed bug when attaching databases with –IsCopy = false. Log file path isn’t included when attaching […]

By |December 25th, 2013|Categories: Programming|Tags: , |Comments Off on SQL Server Database Migration : DB-Migrate V 3.0 : PowerShell Module to Migrate Databases

SQL Server Copy table data from higher to lower SQL version using PowerShell

I came across a scenario where in I had to move database from SQL Server 2008R2 to SQL Server 2005. As most of you must be aware that
Detach/Attach and Backup/Restore doesn’t works in this case.  The only solution is to script out the database objects and data from SQL Server 2008R2 and then run […]

By |November 26th, 2013|Categories: Programming|Tags: , , , |2 Comments

SQL Server – Monitor SQL Server Services using Powershell

Last month on 26th June I delivered a webcastHow to Monitor SQL Servers using Powershell – Part 1 under Microsoft Lunch Time Banner.  For those who don’t know about Lunch Time Series – it’s a new series started by Microsoft MVPs that happens every alternate Wednesday at lunch time generally for one hour. The webcast […]

SQL Server Parse DBCC MemoryStatus using Powershell

A few days back I was resolving a memory issue which caused sql server to stop responding. I was able to figure out the issue by looking into SQL Server Parse DBCC MemoryStatus output. It was the full text search which was taking lot of memory. However, doing this I realised that examining DBCC […]

By |May 19th, 2013|Categories: Memory, Programming|Tags: , |Comments Off on SQL Server Parse DBCC MemoryStatus using Powershell

SQL Server Using Powershell to Move databases between Instances

It’s sometime needed to move database between instances as in when migrating to a different instance. Let’s see how this can be achieved with powershell. This script assumes that both the instances are on same server. This script only moves databases which don’t exist on the destination instance.

To start with, let’s define the source […]

By |March 29th, 2013|Categories: Programming|Tags: , , , , |Comments Off on SQL Server Using Powershell to Move databases between Instances

SQL Server Using Powershell to Move Logins between Instances

Moving logins between instances is one of the critical migration activities. Let’s see how it can be done in powershell with the help of SMO.When transferring logins, two things need to be looked at.

Create logins which don’t exist at destination and skipping the existing ones.
Switch default database to master if logins default database doesn’t […]

SQL Server Using Powershell to Move Indexes to New File group

Recently I was involved in a project where in non-clustered indexes were to be moved to a different file group for the sake of performance benefit. It has to be done for multiple databases. I came up with a SQL Server Using Powershell script to do the same.

An index can be moved to different […]

Newsletter_Footer