Skip to content

Instantly share code, notes, and snippets.

@tckz
Created December 8, 2009 09:50
Show Gist options
  • Save tckz/251549 to your computer and use it in GitHub Desktop.
Save tckz/251549 to your computer and use it in GitHub Desktop.
SQLserverのデータベースミラーリングのフェイルオーバー
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | out-null
$server = new-object Microsoft.SqlServer.Management.Smo.Server("プリンシパルサーバ")
$db = $server.Databases["mirrortest"]
$db.ChangeMirroringState([Microsoft.SqlServer.Management.Smo.MirroringOption]::Failover)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment