Your SlideShare is downloading. ×
0
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Using IMA for monitoring Ingres
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Using IMA for monitoring Ingres

691

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
691
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • GLF = General Library Facility
  • Transcript

    • 1. GEMINIT | Education© GEMINIT 2012 AUA-UK 2012Frédéric Barbierfrederic.barbier@geminit.beUsing IMAfor monitoring IngresAUA-UK ConferenceJune 19th 2012, London
    • 2. GEMINITAUA-UK 2012This work is licensed under the Creative Commons Attribution-NoDerivs 3.0 Unported License.To view a copy of this license, visit http://creativecommons.org/licenses/by-nd/3.0/.DisclaimerRepresentations, warranties and disclaimer. Unless otherwise mutually agreed to by the parties in writing, GEMINIT bvba offers thisdocumentation as-is and makes no representations or warranties of any kind concerning the work, express, implied, statutory orotherwise, including, without limitation, warranties of title, merchantability, fitness for a particular purpose, noninfringement, or theabsence of latent or other defects, accuracy, or the presence of absence of errors, whether or not discoverable.Limitation on liability. Except to the extent required by applicable law, in no event will GEMINIT bvba be liable to you on any legaltheory for any special, incidental, consequential, punitive or exemplary damages arising out of this license or the use of thework, even if GEMINIT bvba has been advised of the possibility of such damages.Using IMA for monitoring Ingres 2
    • 3. GEMINITAUA-UK 2012Using IMA for monitoring Ingres• Introduction & Concepts• Building the MIB• Using the MIB for monitoring• Case: lockmanUsing IMA for monitoring Ingres 3
    • 4. GEMINIT | Education© GEMINIT 2012 AUA-UK 2012Introduction & Concepts
    • 5. GEMINITAUA-UK 2012What is the IMA?• = Ingres Management Architecture• Provides access to Ingres process relatedinformation through SQL select update (limited)• Gateway• imadb database created at installation select * from ima_server_sessionsIntroduction & ConceptsUsing IMA for monitoring Ingres 5
    • 6. GEMINITAUA-UK 2012A few concepts• Managed processes• Managed objects• MIB6Introduction & ConceptsUsing IMA for monitoring Ingres
    • 7. GEMINITAUA-UK 2012Managed Processes• Processes which exposes internal managementdata.• We can monitor certain aspects of theseprocesses.• Examples: DBMS server(s), recovery server, nameserver, communication server(s).7Introduction & Concepts – ConceptsUsing IMA for monitoring Ingres
    • 8. GEMINITAUA-UK 2012Managed ProcessesIntroduction & Concepts – Concepts8Using IMA for monitoring IngresCommunicationServerDBMS ServerRecovery ServerName Server
    • 9. GEMINITAUA-UK 2012Managed Objects• Data structures (variables) in managed processes.• Hold information about the state of the process.• Value of type integer or varchar.• Example: varchar: query currently being executed by a usersession in a DBMS server integer: memory left in Query Storage Facility (QSF)9Introduction & Concepts – ConceptsUsing IMA for monitoring Ingres
    • 10. GEMINITAUA-UK 2012Managed ObjectsIntroduction & Concepts – Concepts10Using IMA for monitoring IngresCommunicationServerDBMS ServerRecovery ServerName Server
    • 11. GEMINITAUA-UK 2012Managed Objects• A managed object identified by: server: the managed process where it resides class: the type of information‐ effective user name, session identifier,... instance: the occurence of a class within a process‐ the session with identifier 0000000046913793224064 value: the actual value which is an integer or varchar‐ session identifier 000000004691379322406411Introduction & Concepts – ConceptsUsing IMA for monitoring Ingres
    • 12. GEMINITAUA-UK 2012Management Domain• Set of managed objects visible to the currentsession, i.e. session specific.• Initially only the DBMS server that a session isconnected with.• Management domain can be expanded: to other processes, to all processes in the local node, to processes in a remote node.12Introduction & Concepts – ConceptsUsing IMA for monitoring Ingres
    • 13. GEMINITAUA-UK 2012Management DomainIntroduction & Concepts – Concepts13Using IMA for monitoring IngresCommunicationServerDBMS ServerRecovery ServerName Server
    • 14. GEMINITAUA-UK 2012MIB• = Management Information Base• Collection of managed objects, presented a a setof tables.• A row in a table = an instance.14Introduction & Concepts – ConceptsUsing IMA for monitoring Ingres
    • 15. GEMINITAUA-UK 2012MIBIntroduction & Concepts – Concepts15Using IMA for monitoring IngresCommunicationServerDBMS ServerRecovery ServerName ServerMIB
    • 16. GEMINIT | Education© GEMINIT 2012 AUA-UK 2012Building the MIB
    • 17. GEMINITAUA-UK 2012Building the MIB• Creation of an IMA database• Managed objects• A simple MIB table• Meta data about managed objects• Relationships between MIB tables• Control objects• Summary17Using IMA for monitoring Ingres
    • 18. GEMINITAUA-UK 2012Creation of an IMA database• Database owned by $ingres• Database imadb created automatically• IMA tables are not normal tables Registered tables that map to managed objects Registered by user $ingres or ingres18Building the MIBUsing IMA for monitoring Ingrescreatedb –u’$ingres’ monitordb
    • 19. GEMINITAUA-UK 2012Managed Objects• Register table that will show managed objects.• Table ima_mib_objects in imadb.• One row for every managed object in themanagement domain, i.e. flat table.19Building the MIBUsing IMA for monitoring Ingres
    • 20. GEMINITAUA-UK 2012Managed ObjectsBuilding the MIB20Using IMA for monitoring Ingresregister table mon_mib_objects (server varchar(64) not null not defaultis SERVER,classid varchar(64) not null not defaultis CLASSID,instance varchar(64) not null not defaultis INSTANCE,value varchar(64) not null not defaultis VALUE,perms integer2 not null not defaultis PERMISSIONS)as import from objectswith update,dbms = IMA,structure = unique sortkeyed,key = (server, classid, instance);
    • 21. GEMINITAUA-UK 2012Managed ObjectsBuilding the MIB21Using IMA for monitoring Ingresregister table mon_mib_objects (server varchar(64) not null not defaultis SERVER,classid varchar(64) not null not defaultis CLASSID,instance varchar(64) not null not defaultis INSTANCE,value varchar(64) not null not defaultis VALUE,perms integer2 not null not defaultis PERMISSIONS)as import from objectswith update,dbms = IMA,structure = unique sortkeyed,key = (server, classid, instance);register table statement
    • 22. GEMINITAUA-UK 2012Managed ObjectsBuilding the MIB22Using IMA for monitoring Ingresdata from managed objects/processesregister table mon_mib_objects (server varchar(64) not null not defaultis SERVER,classid varchar(64) not null not defaultis CLASSID,instance varchar(64) not null not defaultis INSTANCE,value varchar(64) not null not defaultis VALUE,perms integer2 not null not defaultis PERMISSIONS)as import from objectswith update,dbms = IMA,structure = unique sortkeyed,key = (server, classid, instance);
    • 23. GEMINITAUA-UK 2012Managed ObjectsBuilding the MIB23Using IMA for monitoring Ingresone row per managed objectregister table mon_mib_objects (server varchar(64) not null not defaultis SERVER,classid varchar(64) not null not defaultis CLASSID,instance varchar(64) not null not defaultis INSTANCE,value varchar(64) not null not defaultis VALUE,perms integer2 not null not defaultis PERMISSIONS)as import from objectswith update,dbms = IMA,structure = unique sortkeyed,key = (server, classid, instance);
    • 24. GEMINITAUA-UK 2012Managed ObjectsBuilding the MIB24Using IMA for monitoring Ingresextended formatregister table mon_mib_objects (server varchar(64) not null not defaultis SERVER,classid varchar(64) not null not defaultis CLASSID,instance varchar(64) not null not defaultis INSTANCE,value varchar(64) not null not defaultis VALUE,perms integer2 not null not defaultis PERMISSIONS)as import from objectswith update,dbms = IMA,structure = unique sortkeyed,key = (server, classid, instance);
    • 25. GEMINITAUA-UK 2012Managed ObjectsBuilding the MIB25Using IMA for monitoring Ingrespermission maskmanaged processclass of managed objectinstance of managed objectcharacter value of managed objectregister table mon_mib_objects (server varchar(64) not null not defaultis SERVER,classid varchar(64) not null not defaultis CLASSID,instance varchar(64) not null not defaultis INSTANCE,value varchar(64) not null not defaultis VALUE,perms integer2 not null not defaultis PERMISSIONS)as import from objectswith update,dbms = IMA,structure = unique sortkeyed,key = (server, classid, instance);
    • 26. GEMINITAUA-UK 2012Managed ObjectsBuilding the MIB26Using IMA for monitoring Ingresmanaged object isuniquely identifiedby server, classidand instanceregister table mon_mib_objects (server varchar(64) not null not defaultis SERVER,classid varchar(64) not null not defaultis CLASSID,instance varchar(64) not null not defaultis INSTANCE,value varchar(64) not null not defaultis VALUE,perms integer2 not null not defaultis PERMISSIONS)as import from objectswith update,dbms = IMA,structure = unique sortkeyed,key = (server, classid, instance);
    • 27. GEMINITAUA-UK 2012Managed ObjectsBuilding the MIB27Using IMA for monitoring Ingressome managed objects areupdateable = control objectsregister table mon_mib_objects (server varchar(64) not null not defaultis SERVER,classid varchar(64) not null not defaultis CLASSID,instance varchar(64) not null not defaultis INSTANCE,value varchar(64) not null not defaultis VALUE,perms integer2 not null not defaultis PERMISSIONS)as import from objectswith update,dbms = IMA,structure = unique sortkeyed,key = (server, classid, instance);
    • 28. GEMINITAUA-UK 2012Managed Objects• Ingres 10 on Windows• Ingres 9.2.1 on Linux (Red Hat)28Building the MIBUsing IMA for monitoring IngresServer # Objects # ClassesName Server 1246 124DBMS Server 31122 1102Recovery Server 31017 1052Communication Server 1142 116Server # Objects # ClassesName Server 1154 116DBMS Server 32339 1109Recovery Server 32418 1050Communication Server 953 64Data Access Server 18976 88
    • 29. GEMINITAUA-UK 2012Managed Objects – Class ids• Examples:• Class ids form hierarchically structured name space levels separated by a period (.)‐ first level exp: experimental branch‐ second level: facility (ADF, CLF, DMF, GCF, SCF, ...)‐ third level: part of facility29Building the MIBUsing IMA for monitoring Ingresexp.adf.adg.dt_nameexp.clf.unix.cs.scb_bioexp.clf.unix.cs.scb_stk_sizeexp.dmf.dm0p.bm_bufcntexp.dmf.lg.ldb_d_first_laexp.gcf.gca.assoc.session_protocolexp.gcf.gcn.server.classexp.glf.mo.meta.classidexp.scf.scs.scb_query
    • 30. GEMINITAUA-UK 2012Managed Objects – Class ids• Managed objects per facility (Ingres 10, Linux)30Building the MIBUsing IMA for monitoring IngresClass id level 2 Countadf 33464clf 1965dmf 11590gcf 366glf 17998gwf 278psf 2qsf 60rdf 292scf 1099sxf 25majority for definitions of datatypes, operator and functionsmajority for metadata aboutmanaged objectsDMF cache, logging andlocking system, ...
    • 31. GEMINITAUA-UK 2012Managed Objects – Examples• exp.scf.scs.scb_query exp: experimental scf: system control facility (MO is owned by the SCF) scs: sequencer (in the scs code block) scb: session control block query: the current query31Building the MIBUsing IMA for monitoring Ingres
    • 32. GEMINITAUA-UK 2012Managed Objects – Examples• Other examples: exp.scf.scs.scb_self: session identifier exp.scf.scs.scb_euser: effective user exp.scf.scs.scb_database: the database the session isconnected with exp.dmf.dm0p.bm_hit: number of DMF cache hits exp.dmf.lk.lkd_stat.deadlock: number of deadlocks32Building the MIBUsing IMA for monitoring Ingres
    • 33. GEMINITAUA-UK 2012Managed Objects – InstancesBuilding the MIB33Using IMA for monitoring Ingresselect instance, valuefrom mon_mib_objectswhere classid = exp.scf.scs.scb_self;+----------------+----------------+|instance |value |+----------------+----------------+|00006984608 |00006984608 ||00006994400 |00006994400 ||00007004192 |00007004192 ||00007013984 |00007013984 ||00007023776 |00007023776 ||00007033568 |00007033568 ||00007043360 |00007043360 ||00007050816 |00007050816 ||00007058272 |00007058272 ||00007065728 |00007065728 ||00007082080 |00007082080 ||00007124032 |00007124032 ||00334561536 |00334561536 ||00334997824 |00334997824 ||00342819072 |00342819072 |+----------------+----------------+
    • 34. GEMINITAUA-UK 2012Managed Objects – InstancesBuilding the MIB34Using IMA for monitoring Ingres+--------------------------------------+----------------------------------------------------------------+|classid |value |+--------------------------------------+----------------------------------------------------------------+|exp.scf.scs.scb_client_connect |demodb ||exp.scf.scs.scb_client_host |GEMINIT-FB ||exp.scf.scs.scb_client_info |user=fb,host=GEMINIT-FB,tty=GEMINIT-FB,pid=8588,conn=demo||exp.scf.scs.scb_client_pid |8588 ||exp.scf.scs.scb_client_tty |GEMINIT-FB ||exp.scf.scs.scb_client_user |fb ||exp.scf.scs.scb_database |demodb ||exp.scf.scs.scb_dblockmode |shared ||exp.scf.scs.scb_dbowner |fb ||exp.scf.scs.scb_description |(unknown) ||exp.scf.scs.scb_euser |fb ||exp.scf.scs.scb_group | ||exp.scf.scs.scb_index |00342819072 ||exp.scf.scs.scb_lastquery | select * from airline ||exp.scf.scs.scb_pid |00000000000000009296 ||exp.scf.scs.scb_ptr |00342819072 ||exp.scf.scs.scb_query | ||exp.scf.scs.scb_role | ||exp.scf.scs.scb_ruser |fb ||exp.scf.scs.scb_s_name |fb ||exp.scf.scs.scb_self |00342819072 ||exp.scf.scs.scb_terminal |console |...+--------------------------------------+----------------------------------------------------------------+select classid, valuefrom mon_mib_objectswhere classid like exp.scf.scs.scb_%and instance = 00342819072 order by 1;
    • 35. GEMINITAUA-UK 2012A simple MIB table• Managed object values of the same instancebecome values in columns.• These tables are called crosstabs.35Building the MIBUsing IMA for monitoring Ingres
    • 36. GEMINITAUA-UK 2012A simple MIB tableBuilding the MIB36Using IMA for monitoring Ingresregister table statementregister table mon_sessions_simple (server varchar(64) not null not defaultis SERVER,session_id varchar(32) not null not defaultis exp.scf.scs.scb_self,effective_user varchar(32) not null not defaultis exp.scf.scs.scb_euser,db_name varchar(32) not null not defaultis exp.scf.scs.scb_database,session_query varchar(1000) not null not defaultis exp.scf.scs.scb_query)as import from tableswith dbms = IMA,structure = unique sortkeyed,key = (server, session_id);
    • 37. GEMINITAUA-UK 2012A simple MIB tableBuilding the MIB37Using IMA for monitoring Ingrescrosstabregister table mon_sessions_simple (server varchar(64) not null not defaultis SERVER,session_id varchar(32) not null not defaultis exp.scf.scs.scb_self,effective_user varchar(32) not null not defaultis exp.scf.scs.scb_euser,db_name varchar(32) not null not defaultis exp.scf.scs.scb_database,session_query varchar(1000) not null not defaultis exp.scf.scs.scb_query)as import from tableswith dbms = IMA,structure = unique sortkeyed,key = (server, session_id);
    • 38. GEMINITAUA-UK 2012A simple MIB tableBuilding the MIB38Using IMA for monitoring Ingresclass idsmanaged processregister table mon_sessions_simple (server varchar(64) not null not defaultis SERVER,session_id varchar(32) not null not defaultis exp.scf.scs.scb_self,effective_user varchar(32) not null not defaultis exp.scf.scs.scb_euser,db_name varchar(32) not null not defaultis exp.scf.scs.scb_database,session_query varchar(1000) not null not defaultis exp.scf.scs.scb_query)as import from tableswith dbms = IMA,structure = unique sortkeyed,key = (server, session_id);
    • 39. GEMINITAUA-UK 2012A simple MIB tableBuilding the MIB39Using IMA for monitoring Ingressession uniquelyidentified by serverprocess and session idregister table mon_sessions_simple (server varchar(64) not null not defaultis SERVER,session_id varchar(32) not null not defaultis exp.scf.scs.scb_self,effective_user varchar(32) not null not defaultis exp.scf.scs.scb_euser,db_name varchar(32) not null not defaultis exp.scf.scs.scb_database,session_query varchar(1000) not null not defaultis exp.scf.scs.scb_query)as import from tableswith dbms = IMA,structure = unique sortkeyed,key = (server, session_id);
    • 40. GEMINITAUA-UK 2012A simple MIB tableBuilding the MIB40Using IMA for monitoring Ingres+------------+-------------------------------+---------+------------------------------|session_id |effective_user |db_name |session_query+------------+-------------------------------+---------+------------------------------|00006984608 | <Dead Process Detector> | ||00006994400 | <Force Abort Thread> | ||00007004192 | <Group Commit Thread> | ||00007013984 | <Log Writer> | ||00007023776 | <Consistency Pt Thread> | ||00007033568 | <Event Thread> | ||00007043360 | <WriteBehind 2K> | ||00007050816 | <WriteBehind 4K> | ||00007058272 | <WriteBehind 8K> | ||00007065728 | <Replicator Queue Management> | ||00007082080 | <Terminator Thread> | ||00007124032 |$ingres |imadb ||00334561536 |$ingres |imadb ||00334997824 |$ingres |monitordb| select session_id, effective_|00342819072 |fb |demodb |+------------+-------------------------------+---------+------------------------------select session_id, effective_user, db_name, session_queryfrom mon_sessions_simple
    • 41. GEMINITAUA-UK 2012Meta data on managed objects• Which managed object classes can be used insame MIB table?• Managed objects with class id in namespace‘exp.glf.mo.meta’ represent meta data onmanaged objects. glf = General Library Facility41Building the MIBUsing IMA for monitoring Ingres
    • 42. GEMINITAUA-UK 2012Meta data on managed objects• Table registration42Building the MIBUsing IMA for monitoring Ingresregister table mon_mo_meta (server varchar(64) not null not default is SERVER,classid varchar(64) not null not default is exp.glf.mo.meta.classid,class varchar(64) not null not default is exp.glf.mo.meta.class,oid varchar(8) not null not default is exp.glf.mo.meta.oid,perms integer2 not null not default is exp.glf.mo.meta.perms,size integer2 not null not default is exp.glf.mo.meta.size,xindex varchar(64) not null not default is exp.glf.mo.meta.index)as import from tableswith dbms = IMA,structure = unique sortkeyed,key = (server, classid);
    • 43. GEMINITAUA-UK 2012Meta data on managed objectsBuilding the MIB43Using IMA for monitoring Ingresselect classid, perms, size, xindexfrom mon_mo_metawhere classid like exp.scf.scs_scb_% order by 1;+--------------------------------------+------+------+-----------------------+|classid |perms |size |xindex |+--------------------------------------+------+------+-----------------------+|exp.scf.scs.scb_client_connect | 9362| 0|exp.scf.scs.scb_index ||exp.scf.scs.scb_client_host | 9362| 0|exp.scf.scs.scb_index ||exp.scf.scs.scb_client_info | 9362| 4|exp.scf.scs.scb_index ||exp.scf.scs.scb_client_pid | 9362| 0|exp.scf.scs.scb_index ||exp.scf.scs.scb_client_tty | 9362| 0|exp.scf.scs.scb_index ||exp.scf.scs.scb_client_user | 9362| 0|exp.scf.scs.scb_index ||exp.scf.scs.scb_connect_limit | 9362| 4|exp.scf.scs.scb_index ||exp.scf.scs.scb_crash_session | 28050| 0|exp.scf.scs.scb_index ||exp.scf.scs.scb_database | 9362| 32|exp.scf.scs.scb_index ||exp.scf.scs.scb_description | 8192| 0|exp.scf.scs.scb_index ||exp.scf.scs.scb_euser | 9362| 32|exp.scf.scs.scb_index ||exp.scf.scs.scb_facility_index | 9362| 4|exp.scf.scs.scb_index ||exp.scf.scs.scb_facility_name | 9362| 0|exp.scf.scs.scb_index ||exp.scf.scs.scb_gca_assoc_id | 9362| 4|exp.scf.scs.scb_index ||exp.scf.scs.scb_group | 9362| 32|exp.scf.scs.scb_index ||exp.scf.scs.scb_index | 9362| 0|exp.scf.scs.scb_index ||exp.scf.scs.scb_lastquery | 8192| 0|exp.scf.scs.scb_index ||exp.scf.scs.scb_pid | 9362| 0|exp.scf.scs.scb_index ||exp.scf.scs.scb_query | 8192| 0|exp.scf.scs.scb_index ||exp.scf.scs.scb_remove_session | 28050| 0|exp.scf.scs.scb_index ||exp.scf.scs.scb_role | 9362| 32|exp.scf.scs.scb_index ||exp.scf.scs.scb_ruser | 9362| 32|exp.scf.scs.scb_index ||exp.scf.scs.scb_self | 9362| 0|exp.scf.scs.scb_index ||exp.scf.scs.scb_terminal | 9362| 16|exp.scf.scs.scb_index |...+--------------------------------------+------+------+-----------------------+
    • 44. GEMINITAUA-UK 2012Meta data on managed objects• Managed object classes which have same xindexcan be used in same MIB table.44Building the MIBUsing IMA for monitoring Ingres
    • 45. GEMINITAUA-UK 2012Relationships between MIB tables• Example from imadb45Building the MIBUsing IMA for monitoring Ingresima_locklistsvnodelocklist_idlocklist_logical_countlocklist_statuslocklist_lock_countlocklist_max_lockslocklist_name0locklist_name1locklist_server_pid (FK)locklist_session_id (FK)locklist_wait_idlocklist_related_llblocklist_related_llb_id_idlocklist_related_countima_server_sessionsserversession_idsession_ptreffective_userreal_userdb_namedb_ownerdb_lockserver_facilitysession_activityactivity_detailsession_querysession_terminalsession_groupsession_roleclient_hostclient_pidclient_terminalclient_userclient_connect_stringclient_infoapplication_codesession_nameserver_pidima_locksvnode (FK)lock_idlock_request_modelock_grant_modelock_statelock_attributesresource_idlocklist_id (FK)ima_resourcesvnode (FK)resource_idresource_grant_moderesource_convert_moderesource_keyresource_typeresource_database_idresource_table_idresource_index_idresource_page_numberresource_row_idresource_key6resource_lock_id0resource_lock_id1resource_invalidlock_id (FK)
    • 46. GEMINITAUA-UK 2012Control objects• Permissions column in mon_mib_objects andmon_mo_meta: who can read/write.• Some examples of managed objects that can beupdated: exp.scf.scs.scb_remove_sessionremove a session on a DBMS server exp.gwf.gwm.session.control.add_vnodeadd process of a vnode to the management domain exp.scf.scd.server.control.shutset a DBMS server shut46Building the MIBUsing IMA for monitoring Ingres
    • 47. GEMINITAUA-UK 2012Control objects - Example• Add all processes in local instance tomanagement domain (ex. in imadb)47Building the MIBUsing IMA for monitoring IngresUPDATE ima_mib_objectsSET value = DBMSINFO(‘IMA_VNODE’)WHERE classid = ‘exp.gwf.gwm.session.control.add_vnode’AND instance = ‘0’AND server = DBMSINFO(‘IMA_SERVER’);useful dbmsinfo parameters:• ima_vnode• ima_session• ima_server
    • 48. GEMINITAUA-UK 2012Control objects - Procedures• To simplify using some of these control objects, inthe imadb database you’ll find some databaseprocedures: ima_remove_session(session_id, server_id) ima_shut_server(server_id)48Building the MIBUsing IMA for monitoring Ingres
    • 49. GEMINITAUA-UK 2012Summary• Determine which information is required.• Identify the management objects of interestusing the tables: mon_mib_objects (ima_mib_objects in imadb), mon_mo_meta (check same xindex) (ima_mo_meta).• Identify the primary key for the MIB table, whichuniquely identifies each instance.• Identify the relationships between MIB tables, soyou know how to join.• Register a table.49Building the MIBUsing IMA for monitoring Ingres
    • 50. GEMINIT | Education© GEMINIT 2012 AUA-UK 2012Using the MIB for monitoring
    • 51. GEMINITAUA-UK 2012Using the MIB for monitoring• Monitoring• Real-time data• Historical data• Alerts51Using IMA for monitoring Ingres
    • 52. GEMINITAUA-UK 2012Monitoring• Different levels of detail: summarized/aggregated:‐ number of inbound and outbound connections percommunication server,‐ number of active transactions,‐ etc. fully detailed:‐ list of queries being executed,‐ list of database procedures in QSF cache,‐ list of locks,‐ etc.52Using the MIB for monitoringUsing IMA for monitoring Ingres
    • 53. GEMINITAUA-UK 2012Monitoring• Different ways to present: textual: formatted text, tabular: rows in a table, graphical: gauges, pie charts, bar charts, ...53Using the MIB for monitoringUsing IMA for monitoring Ingres
    • 54. GEMINITAUA-UK 2012Real-time data• MIB tables show only real-time information: reads are dirty, no transaction control on MIB tables (no locking).• Information presented in real-time monitoringreflects current status.• Retrieve data from the IMA tables and present it.• Examples: list of queries currently being executed, list of current inbound connections oncommunication server vs maximum possible, etc.54Using the MIB for monitoringUsing IMA for monitoring Ingres
    • 55. GEMINITAUA-UK 2012Historical data• Keep record of historical data ourselves• At regular time intervals, insert data from IMAtables into “normal” tables: trace• Useful for trend analysis, after-the-factanalysis, etc.55Using the MIB for monitoringUsing IMA for monitoring Ingrestimetrace 1 trace 2 trace 3 trace 4 trace 5 trace 6 trace 7
    • 56. GEMINITAUA-UK 2012Historical data – simple tracing• Trace = simple insert from select on MIB table(s)into normal table.• Have unique key for each row inserted.• Examples: DMF cache tracing,monitor the evolution of DMF cache info/stats, QSF and RDF cache tracing, number of inbound connections per communicationserver, etc.56Using the MIB for monitoringUsing IMA for monitoring Ingres
    • 57. GEMINITAUA-UK 2012Historical data – simple tracing - example• DMF cache tracing: at each trace insert current cache statistics to a trace table57Using the MIB for monitoringUsing IMA for monitoring Ingres
    • 58. GEMINITAUA-UK 2012Historical data – simple tracing - example• Step 1. Create trace table• Step 2. Create sequence for counter58Using the MIB for monitoringUsing IMA for monitoring Ingrescreate table trc_dmf_cache_stats asselect trc_counter = int4(0),trc_timestamp = date(now),s.*from ima_dmf_cache_stats swhere 1 = 0;create sequence trc_counter_dmf_cacheas integer4start with 1increment by 1nomaxvaluenocache;
    • 59. GEMINITAUA-UK 2012Historical data – simple tracing - example• Step 3. Create the trace procedure• Step 4. Perform trace (at regular intervals)• Step 5. Present/analyse the traced data59Using the MIB for monitoringUsing IMA for monitoring Ingrescreate procedure do_trace_dmf_cache_status =declarecounter = integer4 not null not default;begincounter = next value for trc_counter_dmf_cache;insert into trc_dmf_cache_statsselect :counter,date(now),s.*from ima_dmf_cache_stats s;commit;end;execute procedure do_trace_dmf_cache_status;
    • 60. GEMINITAUA-UK 2012Historical – advanced tracing• Trace = more than a simple insert.• Examples: keeping track of how long a transaction is active, keeping track of how long a transaction blocks othertransactions, keeping track of how long a resource is locked by asession.• Add some analysis to the trace.60Using the MIB for monitoringUsing IMA for monitoring Ingres
    • 61. GEMINITAUA-UK 2012Historical – advanced tracing – example• Query duration tracing: at each trace Check if query was there during previous trace:‐ if not, then insert the query in the tracing table,‐ if it was, then update the duration of the query in the tracetable. Optional:‐ Move ended queries to a history table.‐ Delete ended queries that did not take longer than a givennumber of seconds.61Using the MIB for monitoringUsing IMA for monitoring Ingres
    • 62. GEMINITAUA-UK 2012Historical – advanced tracing – example• Step 1. Register the MIB table• Step 2. Create the trace table62Using the MIB for monitoringUsing IMA for monitoring Ingresregister table mon_queries (server varchar(64) not null not default is SERVER,session_id varchar(32) not null not default is exp.scf.scs.scb_self,effective_user varchar(32) not null not default is exp.scf.scs.scb_euser,db_name varchar(32) not null not default is exp.scf.scs.scb_database,session_query varchar(1000) not null not default is exp.scf.scs.scb_query)as import from tableswith dbms = IMA,structure = unique sortkeyed,key = (server, session_id);create table trc_queries asselect begin_counter = int4(0),begin_timestamp = date(now),end_counter = int4(0),end_timestamp = date(now),q.*from mon_queries qwhere 1 = 0;
    • 63. GEMINITAUA-UK 2012Historical – advanced tracing – example• Step 3. Create sequence for counter• Step 4. Create the trace procedure (part 1)63Using the MIB for monitoringUsing IMA for monitoring Ingrescreate sequence trc_counter_queriesas integer4start with 1increment by 1nomaxvaluenocache;create procedure do_trace_queries =declarecounter = integer4 not null not default;begincounter = next value for trc_counter_dmf_cache;update trc_queries tfrom mon_queries qset end_counter = :counter,end_timestamp = date(now)where t.session_id = q.session_idand t.session_query = q.session_queryand q.session_query != and q.session_id != dbmsinfo(ima_session);set end counter andtimestamp for queriesthat were running atprevious trace
    • 64. GEMINITAUA-UK 2012Historical – advanced tracing – example• Step 4. Create the trace procedure (part 2)64Using the MIB for monitoringUsing IMA for monitoring Ingresinsert into trc_queriesselect :counter,date(now),:counter,date(now),q.*from mon_queries qwhere q.session_query != and q.session_id != dbmsinfo(ima_session)and not exists (select *from trc_queries twhere t.session_id = q.session_idand t.session_query = q.session_queryand t.end_counter = :counter);delete from trc_querieswhere end_counter = :counter - 1and interval(sec,end_timestamp - begin_timestamp) < 30;commit;end;insert queries thatwere not runningat previous traceremove queriesnot running longerthan 30 seconds
    • 65. GEMINITAUA-UK 2012Historical – advanced tracing – example• Step 5. Perform the trace• Step 6. Present/analyse the traced data65Using the MIB for monitoringUsing IMA for monitoring Ingresexecute procedure do_trace_queries;
    • 66. GEMINITAUA-UK 2012Alerts• Triggered when predefined conditions are met.• Action(s) performed when triggered.• Can use current IMA data (no tracing), historical data (with tracing):‐ check for conditions after each trace.• Implemented using scripting/programminglanguage: “external” actions cannot be executed in databaseprocedure.66Using the MIB for monitoringUsing IMA for monitoring Ingres
    • 67. GEMINITAUA-UK 2012Alerts - Examples• Conditions: a query taking longer than a given number ofseconds, the number of inbound connections on acommunication server exceeding 90% of themaximum, a transaction blocking other transactions for morethan a given number of seconds, the hit ratio of a DMF cache dropping under a givenpercentage, etc.67Using the MIB for monitoringUsing IMA for monitoring Ingres
    • 68. GEMINITAUA-UK 2012Alerts - Examples• Actions: sending an e-mail or any type of message, removing the blocking session, updating the status on a central monitoringdashboard, etc.68Using the MIB for monitoringUsing IMA for monitoring Ingres
    • 69. GEMINIT | Education© GEMINIT 2012 AUA-UK 2012Case: lockman
    • 70. GEMINITAUA-UK 2012Lockman• A tool to trace and analyze (b)locking problems: detailed information about blocking problems isstored in tables for further analysis.• This is a commercial tool developed by GEMINIT! contact lockman@geminit.be for further information• A few customers are already using it inproduction! helps to find‐ missing commits/rollbacks,‐ missing indexes,‐ long queries,‐ long transactions.Using IMA for monitoring Ingres 70
    • 71. GEMINITAUA-UK 2012Lockman• Modes: real-time: analysis of current situation tracing (as service):‐ keeps history of (b)locking problems‐ support for analysis of history• 2 levels of detail summary full detail• Interface: command line interface web interface in pipelineUsing IMA for monitoring Ingres 71
    • 72. GEMINITAUA-UK 2012Blocking hierarchiesSession A1Session B1 Session C1Session D1 Session E1Session F1 Session G1blocks blocksblocks blocksblocks blocksroot sessionsSession A2Session B2 Session C2Session E2blocks blocksblocksUsing IMA for monitoring Ingres 72
    • 73. GEMINITAUA-UK 2012Lockman features• Real-time Which sessions/transactions are currently blockingother sessions/transactions? Which sessions/transactions are currently blocked byother sessions/transactions? Which are the root blocking sessions? Show blocking hierarchy. What resources are locked by a session? Remove root blocking session.Using IMA for monitoring Ingres 73
    • 74. GEMINITAUA-UK 2012Lockman features• Analysis of tracing results Which sessions/transactions were blocking othersessions/transactions? Which sessions/transactions were blocked by othersessions/transactions? Which were the root blocking sessions? What resources were locked by a session?Using IMA for monitoring Ingres 74
    • 75. GEMINITAUA-UK 2012Lockman features• Filter results during analysis: on database, on table, on time.• Support for archiving of historal data.• Support for include scripts: contain lockman commands.• Support for command aliases: e.g. to translate, for command shortcuts.• Commands and output can be logged (by default)for later analysis.Using IMA for monitoring Ingres 75
    • 76. GEMINITAUA-UK 2012Lockman features• Alerter Types:‐ root blocking session,‐ blocking session,‐ blocked session,‐ Query. Condition:‐ longer than given number of seconds. Action:‐ execute lockman command(s),‐ run shell script, e.g. to send an e-mail.Using IMA for monitoring Ingres 76
    • 77. GEMINITAUA-UK 2012Lockman output example77Using IMA for monitoring IngresROOT LOCKING SESSION(S):DATABASE dbserver.dba.mydatabase********************************-----------------------------------------------------------------------------------------------* SESSION id: 0000000046913824268416 terminal: batchreal user: sarah effective user: sarahgroup: role:description: (unknown)CLIENT host: KCTXVS02 user: sarahprocess id: 149560 terminal: KCTXVS02connect string: prod::mydatabaseTRANSACTION id: 00004F72570D9E48+ SESSION(S) BLOCKED BY TRANSACTION- RESOURCE id: 1016 TABLE mydatabase.dba.mytablekey: KEY(TABLE,DB=4F8D9A0F,TABLE=[852,0])lock granted: exclusive, requested: exclusive, state: grantedQUERY description: (unknown)current query:previous query: UPDATE mytable SET col3 = X WHERE col3 = ABLOCKED SESSION(S). SESSION id: 0000000046913823834624 terminal: batchreal user: john effective user: johngroup: role:description: (unknown)CLIENT host: KCTXVS01 user: johnprocess id: 149561 terminal: KCTXVS01connect string: PROD::mydatabase/INGRESTRANSACTION id: 00004F72570D9E86QUERY description: (unknown)current query: SELECT col1, col2 FROM mytableprevious query: SELECT col1, col2 FROM mytable2RESOURCE id: 1016 TABLE mydatabase.dba.mytablekey: KEY(TABLE,DB=4F8D9A0F,TABLE=[852,0])lock granted: null, requested: intended shared, state: waiting
    • 78. GEMINIT | Education© GEMINIT 2012 AUA-UK 2012The End – Thank You!

    ×