INF: SQL Server 2000年ブロックしてデータを表示する方法

重要: このサポート技術情報 (以下「KB」) は、翻訳者による翻訳の代わりに、マイクロソフト機械翻訳システムによって翻訳されたものです。マイクロソフトは、お客様に、マイクロソフトが提供している全ての KB を日本語でご利用いただけるように、翻訳者による翻訳 KB に加え機械翻訳 KB も提供しています。しかしながら、機械翻訳の品質は翻訳者による翻訳ほど十分ではありません。誤訳や、文法、言葉使い、その他、たとえば日本語を母国語としない方が日本語を話すときに間違えるようなミスを含んでいる可能性があります。マイクロソフトは、機械翻訳の品質、及び KB の内容の誤訳やお客様が KB を利用されたことによって生じた直接または間接的な問題や損害については、いかなる責任も負わないものとします。マイクロソフトは、機械翻訳システムの改善を継続的に行っています。

英語版 KB:283725
この資料は、アーカイブされました。これは "現状のまま" で提供され、更新されることはありません。
概要
この資料では、次の資料、マイクロソフト サポート技術に記載されているジョブで作成されるトレース ファイルに含まれているブロックのデータを表示するために使用できるビューを定義します。
283696 INF: ジョブ SQL Server 2000年のパフォーマンスの監視とアクティビティ
これらのビューを作成する前に、ActivityTrace という名前は、SQL Server 2000年テーブルにトレース ファイルをインポートする必要があります。スクリプト、ストアド プロシージャを呼び出す trace_gettable、、SQL Server 2000年のテーブルには、トレース ファイルからデータをインポート、次の資料を定義します。
283784 INF: SQL Server 2000年の利用状況データの表示方法
下記記載のない限りブロックのデータを表示すると定義されているビューを使用します。
  • V_blocked ビューは、システム プロセス Id (Spid) がブロックされる. します。
  • V_blocking ビューのすべてのブロック関連する Spid が表示されます。
  • V_blockspids1 ビューは、ほかの spid をブロックしている Spid の一覧です。RowNumber 列のこのビュー ActivityTrace テーブルおよびトレース ファイルからの行番号です。ActivityTrace テーブル、v_blockspid1 ビューに表示する行の前に行の [TextData] 列を参照するのには、次のクエリを使用します。
    select TextData from ActivityTrace where RowNumber > 4080 and RowNumber < 5000						
    もう 1 つの変更番号 (5000)、上記のクエリの値には、RowNumber が v_blockspid1 に返されました。最初の番号を変更する (4080) を表示する前の行の数を反映します。たとえば、RowNumber 52365 v_blockspid1 を返し、ActivityTrace テーブル行の前に 20 行を表示したい場合は、次のステートメントを実行します。
    select TextData from ActivityTrace where RowNumber > 52345 and RowNumber < 52365					
  • V_blockspids2 ビューは、ほかの Spid をブロックしている Spid の一覧です。
詳細
CREATE    view v_blocked as select RowNumber,StartTime      ,TextData      ,cast(substring(BinaryData,1,2) as smallint) as [spid]      ,cast(substring(BinaryData,3,2) as smallint) as [kpid]      ,cast(substring(BinaryData,5,2) as smallint) as [blocked]      ,cast(substring(BinaryData,7,2) as binary(2)) as [waittype]      ,cast(substring(BinaryData,9,4) as int) as [waittime]      ,cast(substring(BinaryData,13,64) as nchar(32)) as [lastwaittype]      ,cast(substring(BinaryData,77,512) as nchar(256)) as [waitresource]      ,cast(substring(BinaryData,589,2) as smallint) as [dbid]      ,cast(substring(BinaryData,591,2) as smallint) as [uid]      ,cast(substring(BinaryData,593,4) as int) as [cpu]      ,cast(substring(BinaryData,597,8) as bigint) as [physical_io]      ,cast(substring(BinaryData,605,4) as int) as [memusage]      ,cast(substring(BinaryData,609,8) as datetime) as [login_time]      ,cast(substring(BinaryData,617,8) as datetime) as [last_batch]      ,cast(substring(BinaryData,625,2) as smallint) as [ecid]      ,cast(substring(BinaryData,627,2) as smallint) as [open_tran]      ,cast(substring(BinaryData,629,60) as nchar(30)) as [status]      ,cast(substring(BinaryData,689,86) as binary(86)) as [sid]      ,cast(substring(BinaryData,775,256) as nchar(128)) as [hostname]      ,cast(substring(BinaryData,1031,256) as nchar(128)) as [program_name]      ,cast(substring(BinaryData,1287,16) as nchar(8)) as [hostprocess]      ,cast(substring(BinaryData,1303,32) as nchar(16)) as [cmd]      ,cast(substring(BinaryData,1335,256) as nchar(128)) as [nt_domain]      ,cast(substring(BinaryData,1591,256) as nchar(128)) as [nt_username]      ,cast(substring(BinaryData,1847,24) as nchar(12)) as [net_address]      ,cast(substring(BinaryData,1871,24) as nchar(12)) as [net_library]      ,cast(substring(BinaryData,1895,256) as nchar(128)) as [loginame]      ,cast(substring(BinaryData,2151,128) as binary(128)) as [context_info]  from ActivityTrace where substring(TextData,1,8) = N'blocking'   and cast(substring(BinaryData,5,2) as smallint) != 0				
CREATE   view v_blocking asselect RowNumber,StartTime      ,TextData      ,cast(substring(BinaryData,1,2) as smallint) as [spid]      ,cast(substring(BinaryData,3,2) as smallint) as [kpid]      ,cast(substring(BinaryData,5,2) as smallint) as [blocked]      ,cast(substring(BinaryData,7,2) as binary(2)) as [waittype]      ,cast(substring(BinaryData,9,4) as int) as [waittime]      ,cast(substring(BinaryData,13,64) as nchar(32)) as [lastwaittype]      ,cast(substring(BinaryData,77,512) as nchar(256)) as [waitresource]      ,cast(substring(BinaryData,589,2) as smallint) as [dbid]      ,cast(substring(BinaryData,591,2) as smallint) as [uid]      ,cast(substring(BinaryData,593,4) as int) as [cpu]      ,cast(substring(BinaryData,597,8) as bigint) as [physical_io]      ,cast(substring(BinaryData,605,4) as int) as [memusage]      ,cast(substring(BinaryData,609,8) as datetime) as [login_time]      ,cast(substring(BinaryData,617,8) as datetime) as [last_batch]      ,cast(substring(BinaryData,625,2) as smallint) as [ecid]      ,cast(substring(BinaryData,627,2) as smallint) as [open_tran]      ,cast(substring(BinaryData,629,60) as nchar(30)) as [status]      ,cast(substring(BinaryData,689,86) as binary(86)) as [sid]      ,cast(substring(BinaryData,775,256) as nchar(128)) as [hostname]      ,cast(substring(BinaryData,1031,256) as nchar(128)) as [program_name]      ,cast(substring(BinaryData,1287,16) as nchar(8)) as [hostprocess]      ,cast(substring(BinaryData,1303,32) as nchar(16)) as [cmd]      ,cast(substring(BinaryData,1335,256) as nchar(128)) as [nt_domain]      ,cast(substring(BinaryData,1591,256) as nchar(128)) as [nt_username]      ,cast(substring(BinaryData,1847,24) as nchar(12)) as [net_address]      ,cast(substring(BinaryData,1871,24) as nchar(12)) as [net_library]      ,cast(substring(BinaryData,1895,256) as nchar(128)) as [loginame]      ,cast(substring(BinaryData,2151,128) as binary(128)) as [context_info]  from ActivityTrace where substring(TextData,1,8) = N'blocking'				
create view v_blockspids1 asselect top 100 percent       cast(substring(BinaryData,1,2) as smallint) as [spid]      ,min(RowNumber) as RowNumber  from ActivityTrace where substring(TextData,1,8) = N'blocking'   and cast(substring(BinaryData,5,2) as smallint) = 0   and cast(substring(BinaryData,1,2) as smallint) in      (select cast(substring(BinaryData,5,2) as smallint) as spid        from ActivityTrace       where cast(substring(BinaryData,5,2) as smallint) != 0) group by cast(substring(BinaryData,1,2) as smallint) order by cast(substring(BinaryData,1,2) as smallint)				
CREATE    view v_blockspids2 as select RowNumber,StartTime      ,TextData      ,cast(substring(BinaryData,1,2) as smallint) as [spid]      ,cast(substring(BinaryData,3,2) as smallint) as [kpid]      ,cast(substring(BinaryData,5,2) as smallint) as [blocked]      ,cast(substring(BinaryData,7,2) as binary(2)) as [waittype]      ,cast(substring(BinaryData,9,4) as int) as [waittime]      ,cast(substring(BinaryData,13,64) as nchar(32)) as [lastwaittype]      ,cast(substring(BinaryData,77,512) as nchar(256)) as [waitresource]      ,cast(substring(BinaryData,589,2) as smallint) as [dbid]      ,cast(substring(BinaryData,591,2) as smallint) as [uid]      ,cast(substring(BinaryData,593,4) as int) as [cpu]      ,cast(substring(BinaryData,597,8) as bigint) as [physical_io]      ,cast(substring(BinaryData,605,4) as int) as [memusage]      ,cast(substring(BinaryData,609,8) as datetime) as [login_time]      ,cast(substring(BinaryData,617,8) as datetime) as [last_batch]      ,cast(substring(BinaryData,625,2) as smallint) as [ecid]      ,cast(substring(BinaryData,627,2) as smallint) as [open_tran]      ,cast(substring(BinaryData,629,60) as nchar(30)) as [status]      ,cast(substring(BinaryData,689,86) as binary(86)) as [sid]      ,cast(substring(BinaryData,775,256) as nchar(128)) as [hostname]      ,cast(substring(BinaryData,1031,256) as nchar(128)) as [program_name]      ,cast(substring(BinaryData,1287,16) as nchar(8)) as [hostprocess]      ,cast(substring(BinaryData,1303,32) as nchar(16)) as [cmd]      ,cast(substring(BinaryData,1335,256) as nchar(128)) as [nt_domain]      ,cast(substring(BinaryData,1591,256) as nchar(128)) as [nt_username]      ,cast(substring(BinaryData,1847,24) as nchar(12)) as [net_address]      ,cast(substring(BinaryData,1871,24) as nchar(12)) as [net_library]      ,cast(substring(BinaryData,1895,256) as nchar(128)) as [loginame]      ,cast(substring(BinaryData,2151,128) as binary(128)) as [context_info]  from ActivityTrace where substring(TextData,1,8) = N'blocking'   and cast(substring(BinaryData,5,2) as smallint) = 0   and cast(substring(BinaryData,1,2) as smallint) in      (select cast(substring(BinaryData,5,2) as smallint) as spid        from ActivityTrace       where cast(substring(BinaryData,5,2) as smallint) != 0)				

警告: この記事は自動翻訳されています

プロパティ

文書番号:283725 - 最終更新日: 01/16/2015 21:22:33 - リビジョン: 5.0

  • kbnosurvey kbarchive kbinfo kbmt KB283725 KbMtja
フィードバック