SE の雑記

SQL Server の情報をメインに Microsoft 製品の勉強内容を日々投稿

Author Archive

Windows 上での Bash 実行についてあとで見るメモ

one comment

Build に合わせて情報が出てきたものですが。
われらが、ぺんぺん師匠がまとめてくださっています。ぺんぺん師匠、まじ、ぺんぺん。
Windows で Ubuntu バイナリ(bash)が動作することの概略

Windows 10でUbuntuのBashが動作可能に?
[速報]マイクロソフト、BashシェルをWindowsに搭載。Emacs、VT100などサポート。Build 2016

 

詳細はこちら。
CommandLine-Documentation
BASH Running in Ubuntu on Windows
Run Bash on Ubuntu on Windows
Ubuntu on Windows — The Ubuntu Userspace for Windows Developers
Developers can run Bash Shell and user-mode Ubuntu Linux binaries on Windows 10
開発者がWindows 10でBashシェルとユーザー モードのUbuntu Linuxバイナリを実行可能に

 

現状は、Ubuntu 14.04 LTS となっているようですが、Ubuntu 16.04 LTS への置き換えは行われるようですね。
apt でパッケージ入れたりと、Windows 上で Ubuntu 動いている感じで環境整えられるんですね。

今後の情報は、Windows Command Line  を見ておくとよさげです。

Channel9 の Running Bash on Ubuntu on Windows! がデモも含まれていておすすめです。
vi / gcc / Ruby の実行などが行われているデモが確認できるかと。

仕組みとしては以下のスライドが基本かと。

Windows 上で、Ubuntu のユーザーモード(ユーザーランド)が実行され、ネイティブの Linux のバイナリが実行できるようになっています。
システムコールについては、Windows のものをマッピングすることで、動作するようですね。

image

Linux Command Line on Windows / Windows Command Line Improvements (Day1) /  Windows Command Line Improvements (Day3) でも、このあたりの話があるようですので、ビデオが公開されるのをまとうかと。

Read the rest of this entry »

Written by Masayuki.Ozawa

3月 31st, 2016 at 1:49 am

Posted in その他

Tagged with

Linux の sqlcmd でセキュリティ接続 (-E) を使用してみる

leave a comment

昨年、Linux 版の sqlcmdや BCP の提供が開始されました。
Azure SQL Database: SQLCMD and BCP on Ubuntu Linux

これらのツールでは、セキュリティ接続 (-E オプション) がサポートされています。
image

Linux 版の場合、どのように動作するのかが気になって、Linux の勉強と合わせて触ってみた際のメモを。
Linux が理解できていないので、いくつかの手順が間違っているかもしれませんが…。

Linux は Ubuntu Server 14.04 を使用して検証を行っています。

Read the rest of this entry »

Written by Masayuki.Ozawa

3月 27th, 2016 at 1:04 pm

Posted in SQL Server

Tagged with ,

SQL Server 2016 で Temporal Table と Stretch Database を組み合わせて使用する

leave a comment

SQL Server 2016 の Temporal Table と Stretch Database は組み合わせることが可能です。
組み合わせることで、

  • Temporal Table の履歴テーブルを Stretch Database により SQL Database に格納する

というようなことができます。

Stretch Database
Stretch Database の概要

設定までの流れを軽く見ていきたいと思います。

なお、今回は  SQL Server 2016 RC1 を使用していますが、RC1 の Stretch Databas は RC0 とは異なり、SQL Server Stretch Database が使用されるのがデフォルトの動作となっています。

Read the rest of this entry »

Written by Masayuki.Ozawa

3月 21st, 2016 at 4:11 pm

Azure の仮想マシン上に構築された SQL Server のデータベースメールで SendGrid を使用する

leave a comment

Configure Database Mail on SQL Server Azure VM using T-SQL で紹介されている内容ですが、SQL Server の データベースメール のメール送信元として、SendGrid を使用することができます。

日本語の情報が少ないかなと思ったので、軽くまとめてみたいと思います。

Read the rest of this entry »

Written by Masayuki.Ozawa

3月 20th, 2016 at 2:17 pm

SQL Server 2016 のファイルスナップショットバックアップを使用してみる

leave a comment

機能としては知っていたのですが、あまり触っていなかったので情報収集としてまとめてみました。
現状の最新は SQL Server 2016 RC1 ですが、環境をまだ作っていなかったので CTP 3.3 で確認をしています。

基本的な情報としては、File-Snapshot Backups for Database Files in Azure を。

Read the rest of this entry »

Written by Masayuki.Ozawa

3月 20th, 2016 at 12:29 am

Posted in SQL Server

Tagged with ,

非対称ストレージを使用したクォーラムの設定

leave a comment

今まで設定したことがなかったのですが、Windows Server 2008 / Windows Server 2008 R2 SP1 に以下の Htofix を適用した環境では、クラスターで非対称ストレージ (非対称ディスク) を使用することができます。

2012 以降ではデフォルトで利用できるようですね。

Hotfix to add support for asymmetric storages to the Failover Cluster Management MMC snap-in for a failover cluster that is running Windows Server 2008 or Windows Server 2008 R2

軽く試してみた内容をまとめてみたいと思います。
ドキュメントとしては、以下が参考になります。
WSFC クォーラム モードと投票の構成 (SQL Server)
Building a High Availability and Disaster Recovery Solution by Using Failover Cluster Instances and Availability Groups
Configure and Manage the Quorum in a Windows Server 2012 Failover Cluster
Failover Cluster Step-by-Step Guide: Configuring the Quorum in a Failover Cluster
SQL Server HA and DR Design Patterns, Architectures, and Best Practices Using Microsoft SQL Server 2012 AlwaysOn

Read the rest of this entry »

Written by Masayuki.Ozawa

3月 19th, 2016 at 8:49 pm

SQL Server 2016 RC0 の Stretch Database を使用して Hot データと Cold データに分割する

leave a comment

SQL Server 2016 RC0 以前にもできたのかもしれませんが、先週気づきました。
Stretch Database が発表された際に、

  • ローカルに Hot データを格納
  • Azure に Cold データを格納

というような、説明がされることがありました。
そのようなデータを分割する方法をまとめてみたいと思います。
詳細については、以下を参照してください。
Stretch Database
Use a Filter Predicate to Select Rows to Migrate (Stretch Database)
Enable Stretch Database for a database
Read the rest of this entry »

Written by Masayuki.Ozawa

3月 15th, 2016 at 11:35 pm

Posted in SQL Server

Tagged with ,

SQL Server 2016 RC0 で使える新しい AlwaysOn のセカンダリの初期同期方法

leave a comment

SQL Server 2016 RC0 関連の情報を眺めていて知ったのですが、RC0 では、セカンダリの同期方法として「SEEDING_MODE = AUTOMATIC」という方法が追加されています。

High Availability Enhancements

[RC0] Direct seeding allows a secondary replica to be automatically seeded over the network (rather than manual seeding that requires a physical backup of the target database to be restored on the secondary). Direct seeding is specified by setting SEEDING_MODE=AUTOMATIC in the CREATE AVAILABILITY GROUP (Transact-SQL) or ALTER AVAILABILITY GROUP (Transact-SQL) statements. You must also specify GRANT CREATE ANY DATABASE with ALTER AVAILABILITY GROUP (Transact-SQL) on each secondary replica that is used with direct seeding.

これについて、少しまとめてみたいと思います。

Read the rest of this entry »

Written by Masayuki.Ozawa

3月 13th, 2016 at 9:47 pm

Posted in SQL Server

Tagged with ,

Data Driven を見ながらつらつらと

one comment

今週は、SQL Server 2016 RC0 / SQL Server on Linux / R Tools for Visual Studio が発表されました。
ビッグリリースが続く中で、Data Driven というイベントが開催されていますので、眺めながらつらつらと。

Read the rest of this entry »

Written by Masayuki.Ozawa

3月 11th, 2016 at 12:03 am

Posted in SQL Server

Tagged with

SQL Server 2016 RC0 の Stretch Database を使ってみる

one comment

SQL Server 2016 RC0 では、Stretch Database の仕組みに多少変化がありますので軽くまとめてみたいと思います。
Stretch Database は Azure にも関係がある機能ですので、SQL Server Stretch Database の価格 も併せて参照していただくとよいかと。

Read the rest of this entry »

Written by Masayuki.Ozawa

3月 9th, 2016 at 9:36 pm

Posted in SQL Server

Tagged with ,