都内で働くSEの技術的なひとりごと / Technical soliloquy of System Engineer working in Tokyo

都内でサラリーマンやってます。SQL Server を中心とした (2023年からは Azure も。) マイクロソフト系(たまに、OSS系などマイクロソフト以外の技術も...)の技術的なことについて書いています。日々の仕事の中で、気になったことを技術要素関係なく気まぐれに選んでいるので記事内容は開発言語、インフラ等ばらばらです。なお、当ブログで発信、発言は私個人のものであり、所属する組織、企業、団体等とは何のかかわりもございません。ブログの内容もきちんと検証して使用してください。英語の勉強のため、英語の

SQL Server 2014 Service Pack 2 is now Available !!! ということなので使ってみる

 先週から今週とかなり忙しく、週末もまともにブログを書けませんでした。最近、見てなかった SQL Server Blog に「SQL Server 2014 Service Pack 2 is now Available !!! 」とあったので、2014 に対して興味はなかったのですが、ちょっとみてみることにしました。
blogs.msdn.microsoft.com

 個人的に気になったものを二つほどチェックしてみます。

MAXDOP hint for DBCC CHECK* commands – This improvement addresses one of the connect feedback from customers and is useful to run DBCC CHECKDB with MAXDOP setting other than the sp_configure value. If MAXDOP exceeds the value configured with Resource Governor, the Database Engine uses the Resource Governor MAXDOP value, described in ALTER WORKLOAD GROUP (Transact-SQL). All semantic rules used with the max degree of parallelism configuration option are applicable when you use the MAXDOP query hint.

DBCC CHECKDB に MAXDOP 指定できるようになったんですね。下記のように指定します。

DBCC CHECKDB WITH MAXDOP=4;

 簡単に性能差を見てみましょう。使用する PC のスペックは下記の通りです。
f:id:koogucc11:20160717133607p:plain

  • MAXDOP = 1 の場合
    f:id:koogucc11:20160717134550p:plain
  • MAXDOP = 4 の場合
    f:id:koogucc11:20160717134559p:plain

 整合性チェックはバックアップ時などには必須なので、高速化されるのは助かりますね。

Database Cloning – Clone database is a new DBCC command added that allows Microsoft CSS to troubleshoot existing production databases by cloning the schema and metadata without the data. The clone is created with the command DBCC clonedatabase(‘source_database_name’, ‘clone_database_name’). Cloned databases should not be used in production environments. To see if a database has been generated from a clonedatabase you can use the following command, select DATABASEPROPERTYEX(‘clonedb’, ‘isClone’).The return value of 1 indicates the database is created from clonedatabase while 0 indicates it is not a clone.

 これはいいですね。「to troubleshoot existing production databases by cloning the schema and metadata without the data」で、統計情報などが取得できるだけでも、実行プランがおかしくなったときなどに重宝しそうです。試そうと思ったけど、2016 はまだサポートしていないんですね。SQL Server 2014 の環境がない....あとで試そう。それ以外にも魅力的な機能向上があるので、2014の環境も構築しよう。

 記事書き始めたころに地震がありました。下から突き上げるような感じでしたね。
f:id:koogucc11:20160717135551p:plain

備えないと、ですね。

非常用持ち出し袋36点セット リュックタイプの防災セット

非常用持ち出し袋36点セット リュックタイプの防災セット

東京防災

東京防災