Ich habe ein Skript, das Fehlermeldungen aus db2diag.log extrahieren. Ich muss die SQL-Abfragen extrahieren, die den Deadlock aus der folgenden Datei verursacht haben.wie grep unter sql Teil von db2 Fehlerprotokoll
Inhalt der Datei: 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"
Erforderliche Ausgabe: alle SQL-Abfragen
1. delete
from DMEXPLOG where CREATED < ?
2. select
* from DMEXPLOG where CREATED < ?
wie diese. Ich möchte alle SQL-Teile aus der Datei. Beliebige grep
oder Awk/sed
Lösung, um die erforderliche Ausgabe zu erhalten?
Plattform: Unix (AIX)
Bitte werfen Sie einen Blick auf [Editieren-Hilfe] übersetzt werden (http://stackoverflow.com/editing- Hilfe). – Cyrus