What if your viewpoint stops working or there is a upgrade. At that point of time lots and lots of questions arise in your mind. How to know about running sessions, or rush a session, how to track ETL loads, how to change priority of a session…. Bla Bla Bla… below are the answers of all your questions . Or you can call them behind the scene codes of Viewpoint.
To check running Queries
Select * from table(monitersession(1,’*’,0)) As dt;
To check all active sessions by ETL
Select * from Table(moniterSession(1,’*’,0)) as Dt where username like ‘%USERNAME%’ and AMPSTATE =’ACTIVE’;
To check SQL for Active Session
Select substr(sqltextinfo,1,250)from Table(SYSLIB.Monitersqltext(1,Session_ID,16376)) As T2;
Change Session priority
Select set sessionaccount(1, SessionID, ‘Account_String’,’Y’);
Check if session is rushed
Select * from Table(Monitersession(1,’*’,0))As dt where sessionno = SessionID