db2diag.logからエラー・メッセージを抽出するスクリプトがあります。私は下のファイルからデッドロックを引き起こしたSQLクエリを抽出する必要があります。db2エラー・ログからSQL部分の下にgrepする方法
ファイルの内容:log.txt
db2inst1 , WSCOMUSR , MESSAGE : ADM5501I DB2 is performing lock escalation. The affected application
is named "db2jcc_application", and is associated with the workload
name "SYSDEFAULTUSERWORKLOAD" and application ID
"173.10.105.33.59586.13011817552" at member "0". The total number of
locks currently held is "1249935", and the target number of locks to
hold is "624967". The current statement being executed is "delete
from DMEXPLOG where CREATED < ? ". Reason code "1"
db2inst1 , WSCOMUSR , MESSAGE : ADM5501I DB2 is performing lock escalation. The affected application
is named "db2jcc_application", and is associated with the workload
name "SYSDEFAULTUSERWORKLOAD" and application ID
"173.10.105.33.59586.13011817552" at member "0". The total number of
locks currently held is "1249935", and the target number of locks to
hold is "624967". The current statement being executed is "select
* from DMEXPLOG where CREATED < ?". Reason code "1"
必要な出力:すべてのSQLはこのような
1. delete
from DMEXPLOG where CREATED < ?
2. select
* from DMEXPLOG where CREATED < ?
を照会します。ファイルからすべてのSQLパーツが必要です。任意のgrep
またはAwk/sed
解決策を得るには?
プラットフォーム:UNIX(AIX)
で翻訳することができ、[編集ヘルプ]をご覧ください(http://stackoverflow.com/editing-助けて)。 – Cyrus