해결 방안
The qview utiltity may need to be ran to read the content of queues, to remove corruptions from a queue, remove transactions from a queue to enable a stopped process to start, etc. At times it is very helpful to capture the session involving qview to a file for further analysis, for instructional purposes, etc. The number of messages can be very large and if the qview session was captured in a text file, it can be opened with an editor and easily searched, analyzed, etc. The script command in Unix comes in handy for this.
The following section describes the usage of the command with reference to qview.
To run the qview session with the script command, type the command and the filename for the transcript of the session to be stored. For example:
$ script qview.out (where $ denotes the OS prompt)
$ Script started, file is qview.out
Then begin the qview session:
$ qview -i
qview>qinit
qview>open p r
Queue INQUEUE4+P+o.ADC00P02-o.ADCBCP02 (y/n) <n>? n
Queue INQUEUE3+P+o.ADC00P02-o.ADCBCP02 (y/n) <n>? n
Queue INQUEUE5+P+o.ADC00P02-o.ADCBCP02 (y/n) <n>? y
Reader +PP+INQUEUE5+sp_opst+o.ADC00P02-o.ADCBCP02 (y/n) <n>? y
Current queue INQUEUE5+P+o.ADC00P02-o.ADCBCP02 user +PP+INQUEUE5+sp_opst+o.ADC00P02-o.ADCBCP02
qview> oread 0 5
Sque 6, qseq 2561622434, 04/08/06 19:35:06, 58612/224231392, transid 6, Insert, AABdrMADSAAAaaSAAA "OPS$SV_PRO2"."NORMALISED_EVENT", SCN 23454364591
Sque 6, qseq 2561623321, 04/08/06 19:35:06, 58612/224233256, transid 6, Insert, AABdrMADSAAAaaSAAB "OPS$SV_PRO2"."NORMALISED_EVENT", SCN 23454364592
Sque 6, qseq 2561624208, 04/08/06 19:35:06, 58612/224234816, transid 6, Insert, AABdrMADSAAAaaSAAC "OPS$SV_PRO2"."NORMALISED_EVENT", SCN 23454364592
Sque 6, qseq 2561625123, 04/08/06 19:35:06, 58612/224236456, transid 6, Insert, AABdrMADSAAAaaSAAD "OPS$SV_PRO2"."NORMALISED_EVENT", SCN 23454364592
Sque 6, qseq 2561626042, 04/08/06 19:35:06, 58612/224238040, transid 6, Insert, AABdrMADSAAAaaSAAE "OPS$SV_PRO2"."NORMALISED_EVENT", SCN 23454364592
qview>seekback
qview>exit
Press CTRL+D to end the script session. This will generate the file qview.out in the current directory. The file contains the screen shot (transcript) of the above session which can be analyzed.
$ <CTRL-D>
$ Script done, file is qview.out
If a filename is not specified after the script command, by default the file created for this session will be called typescript.