2. In TSET, on File menu, click Connect. Please use the user who has all the access rihts to the o!"ects used in the #uery to connect. $. %n Tools menu, click E&'ort. (. In E&'ort )rom Teradata *ata!ase window, click +uery under E&'ort ,y. -. .lso ty'e the incident num!er (i.e /EC*01234) in File name under E&'ort to. 3. .lso choose a directory in In )older under E&'ort to. 5. Click %6. 7. In E&'ort ,y +uery window, Paste the #uery in +uery. 7. .lso modi)y *e)ult *ata!ase i) the #uery is not )ully #uali8ed with data!ase name. 4. Click .dd. 19.In E&'ort ,y +uery window, click )ollowin o'tions under E&'ort %'tions: Choose .;; <%TE : I) the #uery is )ailin: *o not choose .ll i) your #uery is )ailin as this will cause another $319 with E&ecution Plans. SE;ECT: %!"ect *e8nitions /andom .=P Sam'les Statistics Cost Parameters Cost Pro8les. 11. Click %'tions... under E&'ort %'tions. 12. In E&'ort %'tions window, ty'e the incident num!er (i.e /EC*01234) in /.S ta and Cost ta. 1$. In /andom .=P Sam'les(/.S), click Select Ta!les... 1(. In E&'ort /andom .=P Sam'les window, select Ca'ture )rom .=Ps under /.S %'tions. 1-. Click Select .ll. 13. Click %6. 15. In Cost Parameters, click Select /ows... 17. In E&'ort Cost Parameters window, select Ca'ture Current Costs under Cost %'tions. 14. Click %6. 29. In E&'ort %'tions window, click %6. 21. In E&'ort !y +uery window, click E&'ort. (E&'ortin ... will start.) 22. %n the Tools menu, click Pack. 2$. In Pack window, look in the directory chosen in (3). 2(. Click or ty'e the mc) 8le with the incident num!er(i.e. /EC*01234.mc)). 2-. Click Pack. 23. .ttach the 'ack 8le with the incident num!er(i.e /EC*01234.'ack) to the incident. Query to identify what is being logged/enabled. SE;ECT >ser<ame ()ormat ?2(19)?,TIT;E ?;oed >sers?) ,*,+;/uleT!l..ccountStrin ()ormat ?2(12)?, Title ?.ccount?) ,*,+;/uleT!l.S+;Fla (Format ?2?,Title ?S+;?) ,*,+;/uleT!l.Te&tSi@e;imit (Format ?00004?, Title ?S+;AASi@e?) ,*,+;/uleT!l.E&'lainFla (Format ?2?,Title ?E&'?) ,*,+;/uleT!l.%!"Fla ()ormat ?2?,Title ?%!"?) ,*,+;/uleT!l.Ste'Fla ()ormat ?2?,Title ?St'?) ,*,+;/uleT!l.ThresholdFla (Format ?2?,Title ?ThrAASet?) ,*,+;/uleT!l.SummaryFla(Format ?2?,Title ?SumAASet?) ,C.SE 1BE< *,+;/uleT!l.Ty'e%)CriterionC 9 TBE< ?Ela'sedSec? 1BE< *,+;/uleT!l.Ty'e%)CriterionC 1 TBE< ?CP>Time (centisec)? 1BE< *,+;/uleT!l.Ty'e%)CriterionC 2 TBE< ?I%Count? 1BE< *,+;/uleT!l.Ty'e%)CriterionC $ TBE< ?CP>Time<orm (centisec)? 1BE< *,+;/uleT!l.Ty'e%)CriterionC ( TBE< ?Ela'sedTime (centisec)? E;SE ?<% C/ITE/I%<? E<* (TIT;E ?ThresholdAATrier?) ,*,+;/uleT!l.SummaryDal1(Format ?004?, Title ?SumAA;ow?) ,*,+;/uleT!l.SummaryDal2(Format ?004?,Title ?orAA=ed?) ,*,+;/uleT!l.SummaryDal$(Format ?0004?,Title ?ThrAABih?) F/%= *,C.*,+;/ules %/*E/ ,E 1,2F How to collect DBQL stepinfo if DBQL with stepinfo is not enabled. .logon <MachineName>/DBC,<DBC password> BEGIN QUERY LOGGING WITH STEPINFO ON <USERNAME>; .logoff .logon <MachineName>/<USERNAME>,<USERNAME password> <SQL> //<-- EXECUTE SQL .logoff; .logon <MachineName>/DBC,<DBC password> END QUERY LOGGING WITH STEPINFO ON <USERNAME>; .logoff AA ;oon to S+;.ssistant and e&'ort to E2CE; s'readsheet SEL * FROM DBQLSTEPTBL WHERE cast(CollectTimeStamp as DATE) = DATE AND QueryID in (SEL QueryID from DBC.DBQLOGTBL WHERE USERNAME = '<USERNAME>') ORDER BY 2,3,4,5; How to collect DBQL stepinfo for previous session if DBQL stepinfo is currently enabled. E2.=P;E 1: AA *,+; ste'in)o is re#uested )rom )ollowin: AA >ser<ame C GSmith AA SessionI* C 121- AA /e#uest<um C ( AA *ate C 12A93A19 AA ;oon to S+;.ssistant and e&'ort to E2CE; s'readsheet SEL * FROM DBQLSTEPTBL WHERE cast(CollectTimeStamp as DATE) = '2010-12- 06' AND QueryID in (SEL QueryID from DBC.DBQLOGTBL WHERE USERNAME = 'JSmith' and SessionID=1215 and RequestNum=4) order by 2,3,4,5; E2.=P;E 2: AA *,+; ste'in)o is re#uested )rom )ollowin: AA >ser<ame C GSmith AA S+; C sel count(H) )rom system)e.o'tIcostIta!leF AA *ate C 12A93A19 AA ;oon to S+;.ssistant and e&'ort to E2CE; s'readsheet SEL * FROM DBQLSTEPTBL WHERE cast(CollectTimeStamp as DATE) = '2010-12-06' AND QueryID in (SEL QueryID from DBC.DBQLOGTBL WHERE USERNAME = 'JSmith' and QueryText like 'sel count(*) from systemfe.opt_cost_table;') order by 2,3,4,5;