sysmaster.sql 209 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822
  1. {**************************************************************************}
  2. {* *}
  3. {* Licensed Materials - Property of IBM and/or HCL *}
  4. {* *}
  5. {* IBM Informix Dynamic Server *}
  6. {* Copyright IBM Corporation 2001, 2013 *}
  7. {* (c) Copyright HCL Technologies Ltd. 2017. All Rights Reserved. *}
  8. {* *}
  9. {**************************************************************************}
  10. { }
  11. { Title: sysmaster.sql }
  12. { Description: }
  13. { create sysmaster database and SMI tables }
  14. { }
  15. { NOTE: Ensure that any changes in the schema of the "sysmaster" database }
  16. { OR changes in the corresponding shared memory structure defns }
  17. { are reflected *appropriately* in ALL the files below: }
  18. { rsam/sysmaster.sql.IUS, }
  19. { rsam/rsmem.h, }
  20. { rsam/rspseudo.h and }
  21. { rsam/rspseudo.c }
  22. { }
  23. { ************************************************************************* }
  24. { Create Pseudo Tables }
  25. set lock mode to wait;
  26. create database sysmaster with log;
  27. database sysmaster exclusive;
  28. set environment delimident off;
  29. { databases }
  30. create table informix.sysdbspartn
  31. (
  32. partnum integer, { table id for systables }
  33. created integer, { date created }
  34. owner char(32), { user name of creator }
  35. name char(128), { database name }
  36. flags smallint { flags indicating logging }
  37. );
  38. create unique index informix.sysdbs_nameix on sysdbspartn(name);
  39. revoke all on informix.sysdbspartn from public as informix;
  40. grant select on informix.sysdbspartn to public as informix;
  41. { join for partnums to table names }
  42. create table informix.systabnames
  43. (
  44. partnum integer, { table id for table }
  45. dbsname char(128), { database name }
  46. owner char(32), { table owner }
  47. tabname char(128), { table name }
  48. collate char(32), { collation assoc with database }
  49. dbsnum integer { dbspace number }
  50. );
  51. create unique index informix.systabs_pnix on systabnames(partnum);
  52. create index informix.systabs_pnix2 on systabnames(dbsnum);
  53. revoke all on informix.systabnames from public as informix;
  54. grant select on informix.systabnames to public as informix;
  55. { Raw Disk }
  56. create table informix.sysrawdsk { Internal Use Only }
  57. (
  58. pg_chunk integer, { physical page address - chunk }
  59. pg_offset integer, { physical page address - offset}
  60. offset smallint, { bytes into page }
  61. loc char(23), { location representation }
  62. hexdata char(40), { 16 bytes hexdumped from offset}
  63. ascdata char(16) { 16 bytes ascii-dumped }
  64. );
  65. create unique index informix.sysrawdskidx on sysrawdsk (pg_chunk, pg_offset, offset);
  66. revoke all on informix.sysrawdsk from public as informix;
  67. { Page Headers }
  68. create table informix.syspaghdr
  69. (
  70. pg_partnum integer, { partition number of page }
  71. pg_pagenum integer, { logical page number in partn }
  72. pg_chunk integer, { pg_chunk - calculated value }
  73. pg_offset integer, { pg_offset - calculated value }
  74. pg_stamp integer, { pg_stamp }
  75. pg_chksum smallint, { pg_chksum }
  76. pg_pagesize smallint, { pg_pagesize }
  77. pg_nslots smallint, { pg_nslots }
  78. pg_flags smallint, { pg_flags }
  79. pg_frptr smallint, { pg_frptr }
  80. pg_frcnt smallint, { pg_frcnt }
  81. pg_next integer, { pg_pgnext }
  82. pg_prev integer, { pg_pgprev }
  83. pg_chunk_disk integer, { pg_chunk - value from disk }
  84. pg_offset_disk integer { pg_offset - value from disk }
  85. );
  86. create unique index informix.syspaghdridx on syspaghdr (pg_partnum, pg_pagenum);
  87. create unique index informix.syspaghdridx_idx2 on syspaghdr (pg_chunk, pg_offset);
  88. revoke all on informix.syspaghdr from public as informix;
  89. grant select on informix.syspaghdr to public as informix;
  90. { Slot Tables }
  91. create table informix.sysslttab { Internal Use Only }
  92. (
  93. partnum integer, { partition number of page }
  94. pagenum integer, { logical page number in partn }
  95. slotnum smallint, { slot number on page }
  96. slotptr smallint, { slot pointer }
  97. slotlen smallint, { slot length }
  98. slotflg smallint { slot flag }
  99. );
  100. create unique index informix.sysslttabidx on sysslttab (partnum, pagenum, slotnum);
  101. revoke all on informix.sysslttab from public as informix;
  102. grant select on informix.sysslttab to public as informix;
  103. { Slot Data }
  104. create table informix.syssltdat { Internal Use Only }
  105. (
  106. partnum integer, { partition number of page }
  107. pagenum integer, { logical page number in partn }
  108. slotnum smallint, { slot number on page }
  109. slotoff smallint, { slot offset }
  110. loc char(28), { location representation }
  111. hexdata char(40), { 16 bytes hexdumped from offset}
  112. ascdata char(16) { 16 bytes ascii dumped }
  113. );
  114. create unique index informix.syssltdatidx on
  115. syssltdat (partnum, pagenum, slotnum, slotoff);
  116. revoke all on informix.syssltdat from public as informix;
  117. { Chunk Free List }
  118. create table informix.syschfree
  119. (
  120. chknum integer, { chunk number }
  121. extnum integer, { extent number in chunk }
  122. start integer, { physical addr of start }
  123. leng integer { length of extent }
  124. );
  125. create unique index informix.syschfreeidx on syschfree (chknum, extnum);
  126. revoke all on informix.syschfree from public as informix;
  127. grant select on informix.syschfree to public as informix;
  128. { Symbol Table }
  129. create table informix.syssymtab
  130. (
  131. location integer, { index into ex_symtable }
  132. address int8, { symbol address }
  133. last_address int8, { last address in symbol }
  134. size integer, { size to next symbol }
  135. name char(40), { symbol name }
  136. extra integer { symbol extra }
  137. );
  138. revoke all on informix.syssymtab from public as informix;
  139. grant select on informix.syssymtab to public as informix;
  140. { Profiling Data }
  141. create table informix.sysproftab
  142. (
  143. vpid integer, { VP id }
  144. index integer, { histogram index }
  145. address int8, { histogram address }
  146. count integer { histogram count }
  147. );
  148. revoke all on informix.sysproftab from public as informix;
  149. grant select on informix.sysproftab to public as informix;
  150. { Partition Headers }
  151. create table informix.sysptnhdr
  152. (
  153. partnum integer, { table's partnum }
  154. flags integer, { partition flags }
  155. rowsize integer, { rowsize (max for variable) }
  156. ncols smallint, { number of varchar or blob columns }
  157. nkeys smallint, { number of indexes }
  158. nextns smallint, { number of extents }
  159. pagesize smallint, { page size }
  160. created integer, { date created }
  161. serialv integer, { current serial value }
  162. fextsiz integer, { first extent size ( in pages ) }
  163. nextsiz integer, { next extent size ( in pages ) }
  164. nptotal integer, { number of pages allocated }
  165. npused integer, { number of pages used }
  166. npdata integer, { number of data pages }
  167. octptnm integer, { OCT partnum (optical blobs only) }
  168. lockid integer, { table lock id }
  169. nrows bigint, { number of data rows }
  170. ninserts bigint, { # inserts }
  171. nupdates bigint, { # updates }
  172. ndeletes bigint, { # deletes }
  173. cur_serial8 int8, { Current serial8 value }
  174. cur_bigserial bigint, { Current bigserial value }
  175. dbsnum integer, { dbspace number of partition }
  176. pta_oldvers smallint, { Inplace alter }
  177. pta_newvers smallint, { Inplace alter }
  178. pta_bmpagenum integer, { Inplace alter }
  179. pta_totpgs integer, { Inplace alter }
  180. pta_opems_allocd integer, { Inplace alter }
  181. pta_opems_filled integer, { Inplace alter }
  182. glscollname char(32), { gls locale }
  183. flags2 integer, { partition flags2 }
  184. sid integer
  185. );
  186. create unique index informix.sysptnhdridx on sysptnhdr (partnum);
  187. create index informix.sysptnhdridx2 on sysptnhdr (dbsnum);
  188. revoke all on informix.sysptnhdr from public as informix;
  189. grant select on informix.sysptnhdr to public as informix;
  190. { Partition Key Descriptions }
  191. create table informix.sysptnkey { Internal Use Only }
  192. (
  193. partnum integer, { partnum for partition }
  194. keynum smallint, { keynumber for key }
  195. flags smallint, { key flags }
  196. rootnode int8, { logical pagenum for root node }
  197. nparts smallint, { number of parts in key }
  198. keylen smallint, { key length }
  199. kpartno smallint, { partno for this part }
  200. kpstart smallint, { offset into row of the part }
  201. kpleng smallint, { length of this part }
  202. kptype smallint { type of this part }
  203. );
  204. create unique index informix.sysptnkeyidx on sysptnkey (partnum, keynum, kpartno);
  205. revoke all on informix.sysptnkey from public as informix;
  206. grant select on informix.sysptnkey to public as informix;
  207. { Partition Extent Descriptions }
  208. create table informix.sysptnext { Internal Use Only }
  209. (
  210. pe_partnum integer, { partnum for this partition }
  211. pe_extnum smallint, { extent number }
  212. pe_chunk integer, { chunk number for this extent }
  213. pe_offset integer, { chunk offset for this extent }
  214. pe_size integer, { size of this extent }
  215. pe_log integer { logical page for start }
  216. );
  217. create unique index informix.sysptnextidx on sysptnext (pe_partnum, pe_extnum);
  218. revoke all on informix.sysptnext from public as informix;
  219. grant select on informix.sysptnext to public as informix;
  220. { Partition Column Descriptions }
  221. create table informix.sysptncol { Internal Use Only }
  222. (
  223. partnum integer, { partnum for this partition }
  224. colnum smallint, { column number }
  225. coloff smallint, { offset into row }
  226. colblob smallint, { blobspace num if blob }
  227. colsize smallint, { column size }
  228. colflags smallint, { flags for column }
  229. coltype smallint { data type of column }
  230. );
  231. create unique index informix.sysptncolidx on sysptncol (partnum, colnum);
  232. revoke all on informix.sysptncol from public as informix;
  233. grant select on informix.sysptncol to public as informix;
  234. { Partition Bit Maps }
  235. create table informix.sysptnbit
  236. (
  237. pb_partnum integer, { partnum for this partition }
  238. pb_pagenum integer, { logical pagenum represented }
  239. pb_bitmap integer { bitmap value for page }
  240. );
  241. create unique index informix.sysptnbitidx on sysptnbit (pb_partnum, pb_pagenum);
  242. revoke all on informix.sysptnbit from public as informix;
  243. grant select on informix.sysptnbit to public as informix;
  244. { Active Partition Headers }
  245. create table informix.sysactptnhdr
  246. (
  247. address int8,
  248. partnum integer, { table's partnum }
  249. pn_flags integer, { partition flags }
  250. rowsize smallint, { rowsize (max for variable) }
  251. ncols smallint, { number of varchar or blob columns }
  252. nkeys smallint, { number of indexes }
  253. nextns smallint, { number of extents }
  254. pagesize smallint, { page size }
  255. created integer, { date created }
  256. cur_serial4 integer, { current serial value }
  257. cur_bigserial bigint, { current bigserial value }
  258. cur_serial8 int8, { current serial value }
  259. fextsiz integer, { first extent size ( in pages ) }
  260. nextsiz integer, { next extent size ( in pages ) }
  261. nptotal integer, { number of pages allocated }
  262. npused integer, { number of pages used }
  263. npdata integer, { number of data pages }
  264. lockid integer, { table lock id }
  265. nrows bigint, { number of data rows }
  266. ninserts bigint, { # inserts }
  267. nupdates bigint, { # updates }
  268. ndeletes bigint, { # deletes }
  269. flags integer,
  270. ucount integer,
  271. chunk integer,
  272. offset integer,
  273. lastidxpn integer,
  274. nextns1 integer,
  275. nextns2 integer,
  276. badkeys integer,
  277. altstmp integer,
  278. ocount integer,
  279. skstamp integer,
  280. pta_oldvers smallint,
  281. pta_newvers smallint,
  282. pta_bmpagenum integer,
  283. pta_totpgs integer,
  284. pta_opems_allocd integer,
  285. pta_opems_filled integer,
  286. glscollname char(32),
  287. pf_rqlock bigint,
  288. pf_wtlock bigint,
  289. pf_deadlk bigint,
  290. pf_dltouts bigint,
  291. pf_isread bigint,
  292. pf_iswrite bigint,
  293. pf_isrwrite bigint,
  294. pf_isdelete bigint,
  295. pf_bfcread bigint,
  296. pf_bfcwrite bigint,
  297. pf_seqscans bigint,
  298. pf_dskreads bigint,
  299. pf_dskwrites bigint,
  300. pn_flags2 integer { partition flags2 }
  301. );
  302. create unique index informix.sysactptnhdridx on sysactptnhdr (partnum);
  303. revoke all on informix.sysactptnhdr from public as informix;
  304. grant select on informix.sysactptnhdr to public as informix;
  305. { rsam thread control blocks }
  306. create table informix.sysrstcb { Internal Use Only }
  307. (
  308. indx integer, { index into rstcb table (rs_number) }
  309. address int8, { addr of rstcb structure }
  310. txp int8, { addr of txp }
  311. localtxp int8, { addr of local txp (XA only) }
  312. tmptxp int8, { addr of temp file txp }
  313. savetxp int8,
  314. next int8, { addr of next on active or free list }
  315. tmpdepth integer, { depth of temp file ops }
  316. rmid integer, { XA Resource Manager ID }
  317. xrecvrpos smallint,
  318. iserrno integer, { rsam errno number }
  319. isrecnum integer, { current rowid }
  320. isfragnum integer, { current fragment number }
  321. flags integer, { flags for rstcb }
  322. uid integer, { user id }
  323. asyncerr int8, { address of async error }
  324. username char(32), { user name }
  325. timeout smallint, { lock timeout counter }
  326. nxtthread int8, { addr of next if >1 threads }
  327. sid integer, { session id }
  328. scb int8, { addr of scb }
  329. ostcb int8, { addr of ostcb }
  330. gentcb int8, { addr of gentcb }
  331. tid integer, { thread id }
  332. join smallint, { thread will join others }
  333. mttcb int8, { addr of mt thread cb }
  334. aio int8, { addr of aio request struct }
  335. mirror_aio int8, { addr of mirror req struct }
  336. lkwait int8, { waiting for this lock }
  337. lkwttype integer, { lock type waiting for }
  338. bfwait int8, { waiting for this buffer }
  339. bfwtflag smallint, { buffer wait type flag }
  340. txwait int8, { waiting for this transaction }
  341. txsusp int8, { suspended transaction }
  342. wtlist int8, { addr of next waiter on lock }
  343. wtthrlist int8, { addr of next thread in trans }
  344. bflist int8, { addr of next waiter on buff }
  345. txlist int8, { addr of next waiter on tx }
  346. xamts smallint, { flag to run as MTS/DTC }
  347. lbufwake int8, { addr of log buffer for wake up}
  348. nreads integer, { number of reads }
  349. nwrites integer, { number of writes }
  350. tolist int8, { addr of next in timeout list }
  351. nopens integer, { size of open table }
  352. nfiles integer, { size of file table }
  353. opentab int8, { open table }
  354. opfree int8,
  355. nextopen int8,
  356. filetab int8, { file table open files }
  357. hfiles int8, { hash into file table }
  358. flfree int8, { file table free descriptors }
  359. nfilesopen int8, { num of file table open files }
  360. tmprow int8, { temp space for row }
  361. tmpsize integer, { size of tmprow space }
  362. cmprow int8, { temp space for compressed row }
  363. rcmprow int8, { temp space for reading cmprow }
  364. rowupdatep int8, { address of row update info ** }
  365. isbisfd integer, { isfd for isb* routines }
  366. blobptr int8, { ptr to current open blob }
  367. blobrarea int8, { blobpage buffer read area }
  368. blobrszbuf integer, { size of blob buffer read area }
  369. blobrbufp int8, { addr of blob buffer read }
  370. blobwarea int8, { blobpage buffer write area }
  371. blobwszbuf integer, { size of blob buffer write area}
  372. blobwbufp int8, { addr of blob buffer write }
  373. blobcarea int8, { blobpage buffer copy area }
  374. blobcszbuf integer, { size of blob buffer copy area }
  375. blobcbufp int8, { addr of blob buffer copy }
  376. blobpiecesp int8, { addr of blobpieces struct ** }
  377. affp int8,
  378. afid int8,
  379. afcnt smallint,
  380. udrcbcnt smallint,
  381. operrno integer, { error in optical subsystem }
  382. dolinkchk integer, { do link checks in btchknode }
  383. nnode integer, { next node for link check }
  384. pnode integer, { prev node for link check }
  385. rsamdebug integer, { do rsam debugging checks }
  386. lastlock integer, { last lock granted }
  387. bufferlogging integer, { do buffered logging }
  388. abcpytab int8, { auxiliary bcpy table }
  389. abcpytabmult integer, { size multiple for aux bcpy tab}
  390. logbuff int8, { normal log buffer }
  391. logbuff_beg int8,
  392. undologbuff int8, { undo log buffer }
  393. tmplogrec int8,
  394. btp int8, { addr of current bt struct ** }
  395. rkeysfree int8,
  396. turbonum integer,
  397. pnfd_count integer, { num rsfd's for rollfwd/rollbk }
  398. svptnum integer, { savepoint number }
  399. numsorts integer, { number of open sorts allowed }
  400. srttab int8, { addr of sort table }
  401. srttmpdir int8, { ptr to sort temp dir pathname }
  402. srtfileid integer, { file id for sort file }
  403. privdata int8, { generic pointer to private mem}
  404. precnum integer,
  405. rootaddr integer, { root node of idx being built }
  406. relocking integer, { relock on recovery }
  407. pitstop int8,
  408. pitaction integer,
  409. debugerrno integer,
  410. bfheld_count integer,
  411. logbu int8,
  412. arcbu int8,
  413. physrecvr int8,
  414. logrecvr int8,
  415. recvryflag integer,
  416. logs int8,
  417. auditp int8,
  418. nexttrace integer,
  419. ntraces integer,
  420. traces int8,
  421. trflags integer,
  422. opsubbuf int8,
  423. opbuf int8,
  424. opbufsize integer,
  425. blobtxtabp int8,
  426. nblobtxs integer,
  427. maxnbtxs integer,
  428. onut_bufflist int8,
  429. onut_cb int8,
  430. upf_rqlock bigint, { number of locks requested }
  431. upf_wtlock bigint, { ... lock waits }
  432. upf_deadlk bigint, { ... deadlocks detected }
  433. upf_lktouts bigint, { ... lock timeouts }
  434. upf_lgrecs bigint, { ... log records written }
  435. upf_isread bigint, { ... reads }
  436. upf_iswrite bigint, { ... writes }
  437. upf_isrwrite bigint, { ... rewrites }
  438. upf_isdelete bigint, { ... deletes }
  439. upf_iscommit bigint, { ... commits }
  440. upf_isrollback bigint, { ... rollbacks }
  441. upf_longtxs bigint, { ... long transactions }
  442. upf_bufreads bigint, { ... buffer reads }
  443. upf_bufwrites bigint, { ... buffer writes }
  444. upf_logspuse bigint, { % log space currently used }
  445. upf_logspmax bigint, { max % of logspace ever used }
  446. upf_seqscans bigint, { number of sequential scans }
  447. upf_totsorts bigint,
  448. upf_dsksorts bigint,
  449. upf_srtspmax bigint,
  450. nlocks integer, { number of locks currently held}
  451. lktout smallint, { lock timeout counter }
  452. lkthreadlist int8, { next thread in same tx wtg }
  453. lkwaittime float, { time spent waiting on locks }
  454. iowaittime float, { time spent waiting on disk io }
  455. upf_niowaits integer, { Number of disk IO waits }
  456. upf_idxbufreads integer { Number of index buffer reads }
  457. );
  458. create unique index informix.sysrstcbidx on sysrstcb (indx);
  459. create unique index informix.sysrstcbaddr on sysrstcb (address);
  460. --Note that sysrstcbscb will only be used for equality lookups
  461. create unique index informix.sysrstcbscb on sysrstcb (scb) hash on (scb) with 2 buckets;
  462. revoke all on informix.sysrstcb from public as informix;
  463. grant select on informix.sysrstcb to public as informix;
  464. { Transactions }
  465. create table informix.systxptab { Internal Use Only }
  466. (
  467. indx integer, { index into transaction table }
  468. address int8, { address of transaction struct }
  469. latchp int8, { address of transaction latch }
  470. next int8, { addr of next on active or free list }
  471. gtridp int8, { address of gtrid }
  472. txid integer, { id of transaction }
  473. flags integer, { transaction flags }
  474. desc integer, { flags describing the transaction }
  475. logbeg integer, { loguniq containing BEGIN }
  476. logbeg_pos integer, { logical log begin work logpos }
  477. loguniq integer, { loguniq of last record }
  478. logpos integer, { logpos of last record }
  479. dlklist int8, { used for deadlk detection }
  480. deadflag smallint, { flag for deadlock detection }
  481. mgmquery int8, { tx_query }
  482. lkwaitcnt smallint, { # of threads waiting on locks }
  483. lklist int8, { list of locks held }
  484. lklatchp int8, { addr of private lock latch ** }
  485. owner int8, { addr of owner (rstcb_t *) }
  486. wtlist int8, { users waiting for this tx }
  487. ptlist int8, { list of partitions dropped }
  488. nlocks integer, { number of locks held }
  489. lkwait smallint, { lock wait timeout }
  490. splevel smallint, { savepoint level }
  491. isolevel smallint, { isolation level }
  492. locktablep int8, { addr of table locks table ** }
  493. svptcnt integer, { number of savepoints alloc'ed }
  494. svuniqp int8, { addr of savepoint loguniqs ** }
  495. svposp int8, { addr of savepoint logpos's ** }
  496. longtx smallint, { this is long transaction }
  497. nsusp smallint, { number of suspends for tx }
  498. stamp integer, { activity time stamp }
  499. istar_coord char(128), { istar coordinator }
  500. sblock int8, { ptr to dynamic shm block }
  501. sqlptr int8, { ptr to first ismalloc piece }
  502. nremotes smallint, { # of rem thread activations }
  503. begstamp integer, { stamp at time of BEGIN WORK }
  504. mts_ref_count integer, { Reference count for MTS }
  505. mts_tbranch int8, { List of prepared GTRIDS for MTS }
  506. rb_time char(20) { Estimated rollback time }
  507. );
  508. create unique index informix.systxpidx on systxptab (indx);
  509. create unique index informix.systxpaddr on systxptab (address);
  510. revoke all on informix.systxptab from public as informix;
  511. grant select on informix.systxptab to public as informix;
  512. { XA Transactions }
  513. create table informix.sysxatab { Internal Use Only }
  514. (
  515. indx integer, { index into transaction table }
  516. address int8, { address of transaction struct }
  517. tx_flags integer, { transaction flags }
  518. tb_flags integer, { transaction branch flags }
  519. isolevel smallint, { isolation level }
  520. timeout smallint, { timeout }
  521. format_id integer, { format ID }
  522. gtridlen integer, { GTRID length }
  523. bquallen integer,
  524. data char(256)
  525. );
  526. revoke all on informix.sysxatab from public as informix;
  527. grant select on informix.sysxatab to public as informix;
  528. { Locks }
  529. create table informix.syslcktab { Internal Use Only }
  530. (
  531. indx integer, { index into lock table }
  532. address int8, { addr of lock structure }
  533. hash int8, { addr of next in hash bucket }
  534. same int8, { list of same locks }
  535. wtlist int8, { list of waiters (rstcb *) }
  536. owner int8, { owner of lock (rtx *) }
  537. list int8, { list of owner's locks }
  538. type smallint, { type of lock }
  539. flags smallint, { lock flags }
  540. bsize smallint, { size of bytes key }
  541. keynum smallint, { keynum of item lock }
  542. rowidr integer, { real rowid if key lock }
  543. partnum integer, { partnum lock is on }
  544. rowidn integer, { key value locked }
  545. dipnum integer, { pagenum if deleted item }
  546. grtime integer { time lock was granted }
  547. );
  548. create unique index informix.syslckidx on syslcktab (indx);
  549. create unique index informix.syslckaddr on syslcktab (address);
  550. revoke all on informix.syslcktab from public as informix;
  551. grant select on informix.syslcktab to public as informix;
  552. { Buffer Pools }
  553. create table informix.sysbufpool
  554. (
  555. indx integer, { index into buffer pool list }
  556. address int8, { address of buffer pool structure }
  557. bufsize integer, { buffer page size in bytes }
  558. nbuffs integer, { number of buffers in buffer pool }
  559. buff_header int8, { address of buffer headers }
  560. nlrus smallint, { number of LRUs }
  561. mindirty float, { pct of dirty pages cleaning stops }
  562. maxdirty float, { pct of dirty pages cleaning starts }
  563. dskreads int8, { number of physical block reads }
  564. pagreads int8, { number of pages read from disk }
  565. bufreads int8, { number of buffer cache reads }
  566. dskwrites int8, { number of physical block writes }
  567. pagwrites int8, { number of pages written to disk }
  568. bufwrites int8, { number of buffer cache writes }
  569. bufwrites_sinceckpt int8, { number of buffer cache writes since last checkpoint }
  570. bufwaits int8, { number of buffer waits }
  571. ovbuff int8, { number of buffer pool overflows }
  572. flushes int8, { number of buffer flush calls }
  573. fgwrites int8, { number of foreground writes }
  574. lruwrites int8, { number of lru writes }
  575. chunkwrites int8, { number of chunk writes }
  576. lru_time_total float, { time spent cleaning LRUs }
  577. lru_calls int8 { number of times LRU cleaning invoked }
  578. );
  579. create unique index informix.sysbfpoolidx on sysbufpool (indx);
  580. revoke all on informix.sysbufpool from public as informix;
  581. grant select on informix.sysbufpool to public as informix;
  582. { Buffer Headers }
  583. create table informix.sysbufhdr { Internal Use Only }
  584. (
  585. indx integer, { index into buffer table }
  586. address int8, { address of buffer structure }
  587. bpoolindx smallint, { which buffer pool }
  588. latchp int8, { ptr to buffer latch }
  589. bhforw int8, { forward pointer in hash list }
  590. bhback int8, { backward pointer in hash list }
  591. blforw int8, { forward pointer in lru list }
  592. blback int8, { backward pointer in lru list }
  593. bflags integer, { buffer flags }
  594. berror smallint, { i/o error }
  595. reusecnt integer, { how often buff is reused }
  596. lrunum integer, { last lru this buff was on }
  597. chunk integer, { physical page addr - chunk }
  598. offset integer, { physical page addr - offset }
  599. pagemem int8, { ptr to page in shared memory }
  600. owner int8, { owner with lock (rstcb *) }
  601. wtlist int8, { list of waiters for buff lock }
  602. sharecnt smallint, { count of users sharing buff }
  603. xflags smallint, { type of lock on buffer }
  604. ostamp integer, { stamp of oldest update not flushed }
  605. lsnuq integer, { LSN entries of oldest update }
  606. lsnpos integer, { not flushed }
  607. bufsize integer { buffer page size }
  608. );
  609. create unique index informix.sysbufhdridx on sysbufhdr (bpoolindx, indx);
  610. create unique index informix.sysbufhdraddr on sysbufhdr (address);
  611. revoke all on informix.sysbufhdr from public as informix;
  612. grant select on informix.sysbufhdr to public as informix;
  613. { Dbspace Table }
  614. create table informix.sysdbstab { Internal Use Only }
  615. (
  616. address int8, { address of dbspace structure }
  617. dbsnum integer, { dbspace number }
  618. flags integer, { dbspace flags }
  619. fchunk integer, { first chunk in dbspace }
  620. nchunks integer, { number of chunks in dbspace }
  621. created integer, { date created }
  622. prtpage integer, { partition partition starts at }
  623. partp int8, { ptr to partp in partition tab }
  624. pagesize integer, { BLOB page size }
  625. bcolcnt integer, { number of blob columns ref }
  626. create_size float, { Min size of chunk (for SP) }
  627. extend_size float, { Min chunk extension (for SP) }
  628. level0 integer, { time of last level 0 archive }
  629. stamp0 integer, { timestamp last level 0 archive}
  630. logid0 integer, { logid for last level 0 archive}
  631. logpos0 integer, { log pos last level 0 archive }
  632. level1 integer, { time of last level 1 archive }
  633. stamp1 integer, { timestamp last level 1 archive}
  634. logid1 integer, { logid for last level 1 archive}
  635. logpos1 integer, { log pos last level 1 archive }
  636. level2 integer, { time of last level 2 archive }
  637. stamp2 integer, { timestamp last level 2 archive}
  638. logid2 integer, { logid for last level 2 archive}
  639. logpos2 integer, { log pos last level 2 archive }
  640. logid integer, { log id (for logical restore) }
  641. logpos integer, { log pos (for logical restore) }
  642. oldlogid integer, { oldest log id (for log resto) }
  643. lastlogid integer, { last log id (for log resto) }
  644. rest_time integer, { time of last physical restore }
  645. arc_pit integer, { PIT to terminate log replay }
  646. name char(128), { dbspace name }
  647. owner char(32), { dbspace owner }
  648. sbcflag integer, { SBlob default create flags }
  649. sboflag integer, { SBlob default open flags }
  650. max_size int8, { Max size of space in MB }
  651. tenant_partnum integer { multi-tenant dbs systables }
  652. );
  653. create unique index informix.sysdbstab_dbsnum on sysdbstab (dbsnum);
  654. revoke all on informix.sysdbstab from public as informix;
  655. grant select on informix.sysdbstab to public as informix;
  656. { Chunk Table }
  657. create table informix.syschktab { Internal Use Only }
  658. (
  659. address int8, { address of chunk structure }
  660. chknum smallint, { chunk number }
  661. nxchunk smallint, { number of next chunk in dbsp }
  662. pagesize integer, { page size }
  663. fpage integer, { page offset of chunk in dbsp }
  664. offset int8, { pages offset into device (in
  665. units of base page size) }
  666. chksize integer, { pages in chunk }
  667. nfree integer, { free pages in chunk }
  668. mdsize integer, { metadata pages in chunk }
  669. udsize integer, { user data pages in chunk }
  670. udfree integer, { free user data pages in chunk }
  671. dbsnum smallint, { dbspace number }
  672. overhead integer, { blob freemap overhead }
  673. flags integer, { chunk flags }
  674. namlen smallint, { length of device pathname }
  675. fname char(256), { device pathname }
  676. reads integer, { number of read ops }
  677. writes integer, { number of write ops }
  678. pagesread integer, { number of pages read }
  679. pageswritten integer, { number of pages written }
  680. readtime float, { time spent reading (usecs) }
  681. writetime float { time spent writing (usecs) }
  682. );
  683. create unique index informix.syschktab_chknum on syschktab (chknum);
  684. revoke all on informix.syschktab from public as informix;
  685. grant select on informix.syschktab to public as informix;
  686. { Mirror Chunk Table }
  687. create table informix.sysmchktab { Internal Use Only }
  688. (
  689. address int8, { address of chunk structure }
  690. chknum smallint, { chunk number }
  691. nxchunk smallint, { number of next chunk in dbsp }
  692. pagesize integer, { page size }
  693. fpage integer, { page offset of chunk in dbsp }
  694. offset int8, { pages offset into device (in
  695. units of base page size) }
  696. chksize integer, { pages in chunk }
  697. nfree integer, { free pages in chunk }
  698. mdsize integer, { metadata pages in chunk }
  699. udsize integer, { user data pages in chunk }
  700. udfree integer, { free user data pages in chunk }
  701. dbsnum smallint, { dbspace number }
  702. overhead integer, { blob freemap overhead }
  703. flags integer, { chunk flags }
  704. namlen smallint, { length of device pathname }
  705. fname char(256), { device pathname }
  706. reads integer, { number of read ops }
  707. writes integer, { number of write ops }
  708. pagesread integer, { number of pages read }
  709. pageswritten integer, { number of pages written }
  710. readtime float, { time spent reading (usecs) }
  711. writetime float { time spent writing (usecs) }
  712. );
  713. create unique index informix.sysmchktab_chknum on sysmchktab (chknum);
  714. revoke all on informix.sysmchktab from public as informix;
  715. grant select on informix.sysmchktab to public as informix;
  716. { Fast version of Chunk Table }
  717. create table informix.syschktab_fast { Internal Use Only }
  718. (
  719. address int8, { address of chunk structure }
  720. chknum smallint, { chunk number }
  721. nxchunk smallint, { number of next chunk in dbsp }
  722. pagesize integer, { page size }
  723. fpage integer, { page offset of chunk in dbsp }
  724. offset int8, { pages offset into device (in
  725. units of base page size) }
  726. chksize integer, { pages in chunk }
  727. nfree integer, { free pages in chunk }
  728. mdsize integer, { metadata pages in chunk }
  729. udsize integer, { user data pages in chunk }
  730. udfree integer, { free user data pages in chunk }
  731. dbsnum smallint, { dbspace number }
  732. overhead integer, { blob freemap overhead }
  733. flags integer, { chunk flags }
  734. namlen smallint, { length of device pathname }
  735. fname char(256), { device pathname }
  736. reads integer, { number of read ops }
  737. writes integer, { number of write ops }
  738. pagesread integer, { number of pages read }
  739. pageswritten integer, { number of pages written }
  740. readtime float, { time spent reading (usecs) }
  741. writetime float { time spent writing (usecs) }
  742. );
  743. create unique index informix.syschktab_chknum_f on syschktab_fast (chknum);
  744. revoke all on informix.syschktab_fast from public as informix;
  745. grant select on informix.syschktab_fast to public as informix;
  746. { Fast version of Mirror Chunk Table }
  747. create table informix.sysmchktab_fast { Internal Use Only }
  748. (
  749. address int8, { address of chunk structure }
  750. chknum smallint, { chunk number }
  751. nxchunk smallint, { number of next chunk in dbsp }
  752. pagesize integer, { page size }
  753. fpage integer, { page offset of chunk in dbsp }
  754. offset int8, { pages offset into device (in
  755. units of base page size) }
  756. chksize integer, { pages in chunk }
  757. nfree integer, { free pages in chunk }
  758. mdsize integer, { metadata pages in chunk }
  759. udsize integer, { user data pages in chunk }
  760. udfree integer, { free user data pages in chunk }
  761. dbsnum smallint, { dbspace number }
  762. overhead integer, { blob freemap overhead }
  763. flags integer, { chunk flags }
  764. namlen smallint, { length of device pathname }
  765. fname char(256), { device pathname }
  766. reads integer, { number of read ops }
  767. writes integer, { number of write ops }
  768. pagesread integer, { number of pages read }
  769. pageswritten integer, { number of pages written }
  770. readtime float, { time spent reading (usecs) }
  771. writetime float { time spent writing (usecs) }
  772. );
  773. create unique index informix.sysmchktab_chknum_f on sysmchktab_fast(chknum);
  774. revoke all on informix.sysmchktab_fast from public as informix;
  775. grant select on informix.sysmchktab_fast to public as informix;
  776. { Log file info }
  777. create table informix.syslogfil { Internal Use Only }
  778. (
  779. address int8, { address of logfile structure }
  780. number smallint, { logfile number }
  781. flags smallint, { logfile flags }
  782. fillstamp integer, { stamp when last filled }
  783. filltime integer, { time when last filled }
  784. uniqid integer, { logfile uniqid }
  785. chunk integer, { physical address of start - chunk }
  786. offset integer, { physical address of start - offset}
  787. size integer, { pages in logfile }
  788. used integer { pages used in logfile }
  789. );
  790. create unique index informix.syslogfilnum on syslogfil (number);
  791. revoke all on informix.syslogfil from public as informix;
  792. grant select on informix.syslogfil to public as informix;
  793. { Btclean Request info }
  794. create table informix.sysbtcreq { Internal Use Only }
  795. (
  796. indx integer, { index into btcreq table }
  797. address int8, { address of btclean structure }
  798. hash int8, { next in hash list }
  799. next int8, { next in busy/free list }
  800. partnum integer, { partnum of request }
  801. pagenum integer, { pagenum of request }
  802. keynum smallint, { keynum of request }
  803. putcnt smallint { count of puts for this req }
  804. );
  805. create unique index informix.sysbtcreqidx on sysbtcreq (indx);
  806. revoke all on informix.sysbtcreq from public as informix;
  807. grant select on informix.sysbtcreq to public as informix;
  808. { Trace buffer }
  809. create table informix.systraces { Internal Use Only }
  810. (
  811. type char(8), { event type }
  812. file char(14), { source file trace is from }
  813. lineno integer, { line # in source file }
  814. stamp integer, { stamp when traced }
  815. time integer, { time when traced }
  816. userp int8, { user who traced (rstcb *) }
  817. trans int8, { tx who traced (rtx *) }
  818. data1 int8, { data value 1 }
  819. data2 int8, { data value 2 }
  820. data3 int8, { data value 3 }
  821. data4 int8, { data value 4 }
  822. data5 int8 { data value 5 }
  823. );
  824. create index informix.systrac_stampidx on systraces (stamp);
  825. revoke all on informix.systraces from public as informix;
  826. grant select on informix.systraces to public as informix;
  827. { Open Partition Table }
  828. create table informix.sysptntab { Internal Use Only }
  829. (
  830. address int8, { address of partition structure}
  831. condp int8, { ptr to condition struct }
  832. latchp int8, { ptr to latch struct ** }
  833. flags smallint, { partition flags }
  834. ucount integer, { usage count }
  835. partnum integer, { partition number }
  836. tablock integer, { table lock id }
  837. chunk integer, { physaddr of partition pg - chunk }
  838. offset integer, { physaddr of partition pg - offset }
  839. lastrowszp int8, { size of last alloc'ed row }
  840. lastrowpnp int8, { last page alloc'ed for row }
  841. lastidxpn integer, { last page alloc'ed for index }
  842. extnsp1 int8, { initial extent list address }
  843. nextns1 smallint, { number of initial extents }
  844. extnsp2 int8, { new extent list address }
  845. nextns2 smallint, { number of new extents }
  846. badkeys integer, { badkey bitmap }
  847. ptlist int8, { next in list of dropped tables }
  848. altstmp integer, { time stamp of last alter }
  849. ocount integer, { open count }
  850. skstamp integer, { stamp of last table update }
  851. glscollname char(32), { GLS collation name }
  852. localep int8, { locale pointer }
  853. pf_rqlock bigint, { lock requests }
  854. pf_wtlock bigint, { lock waits }
  855. pf_deadlk bigint, { deadlocks }
  856. pf_lktouts bigint, { lock timeouts }
  857. pf_dskreads bigint, { disk reads }
  858. pf_isread bigint, { reads }
  859. pf_dskwrites bigint, { disk writes }
  860. pf_iswrite bigint, { writes }
  861. pf_isrwrite bigint, { rewrites }
  862. pf_isdelete bigint, { deletes }
  863. pf_bfcread bigint, { buffer reads }
  864. pf_bfcwrite bigint, { buffer writes }
  865. pf_seqscans bigint, { sequential scans }
  866. dbsnum integer { dbspace number }
  867. );
  868. create unique index informix.sysptntab_pnix on sysptntab (partnum);
  869. create index informix.sysptntab_pnix2 on sysptntab (dbsnum);
  870. revoke all on informix.sysptntab from public as informix;
  871. grant select on informix.sysptntab to public as informix;
  872. { Shared Memory }
  873. create table informix.sysshmem { Internal Use Only }
  874. (
  875. address int8, { address in shmem to dump }
  876. loc char(10), { location representation }
  877. hexdata char(40), { 16 bytes hexdumped from addr }
  878. ascdata char(16) { 16 bytes ascii-dumped }
  879. );
  880. create unique index informix.sysshmemidx on sysshmem (address);
  881. revoke all on informix.sysshmem from public as informix;
  882. { Shared Memory Header }
  883. create table informix.sysshmhdr { Internal Use Only }
  884. (
  885. number integer, { unique identifier for element }
  886. name char(32), { name of rhead_t element }
  887. value int8 { value of rhead_t element }
  888. );
  889. create unique index informix.sysshmhdr_numix on sysshmhdr(number);
  890. revoke all on informix.sysshmhdr from public as informix;
  891. grant select on informix.sysshmhdr to public as informix;
  892. { Configuration parameters }
  893. create table informix.syscfgtab
  894. (
  895. cf_id integer, { unique numeric identifier }
  896. cf_name char(128), { config parameter name }
  897. cf_flags integer, { flags }
  898. cf_original char(513), { value in ONCONFIG at boottime }
  899. cf_effective char(513), { value effectively in use }
  900. cf_default char(513) { value by default }
  901. );
  902. create index informix.syscfgtabix1 on syscfgtab(cf_id);
  903. revoke all on informix.syscfgtab from public as informix;
  904. grant select on informix.syscfgtab to public as informix;
  905. { Session control blocks }
  906. create table informix.sysscblst { Internal Use Only }
  907. (
  908. sid integer, { session id }
  909. address int8, { address of session structure }
  910. currheap int8, { ptr to memory heap }
  911. poolp int8, { ptr to private session pool }
  912. breakflag integer, { stop current processing }
  913. urgent integer, { message from tbmode }
  914. killflag integer, { stop all processing }
  915. neterrno integer, { network error number }
  916. flags integer, { session flags }
  917. local smallint, { user is local if set }
  918. tlatchp int8, { latch protecting thread list }
  919. threadlist int8, { ptr to first thread in list }
  920. next int8, { next session in list }
  921. uid integer, { user id }
  922. username char(32), { user name }
  923. gid integer, { primary group id }
  924. nsuppgids integer, { number of supplementary gids }
  925. suppgidsp int8, { ptr to suppl'ry gids table }
  926. clienttype integer, { client type }
  927. pid integer, { process id of fe program }
  928. progname char(256), { fe program name }
  929. ttyin char(16), { tty name for users stdin }
  930. ttyout char(16), { tty name for users stdout }
  931. ttyerr char(16), { tty name for users stderr }
  932. cwd char(256), { users cwd }
  933. hostname char(256), { users host name }
  934. connected integer, { time that user connected }
  935. argc integer, { count of args sent }
  936. argvp int8, { ptr to arg table }
  937. envvarp int8, { ptr to env var table }
  938. numenvvars integer, { number of env vars }
  939. sizeenvtab integer, { size of env var table }
  940. sqscb int8, { ptr to sql control block }
  941. netscb int8, { ptr to net control block }
  942. class integer, { VP class }
  943. memtotal integer, { Total memory for this session }
  944. memused integer { Used memory for this session }
  945. {
  946. Temporarily disable this change to avoid CONVERSION issue between
  947. interim releases due to rolling upgrade requirement.
  948. session_limit_locks integer,
  949. session_limit_memory integer,
  950. session_limit_tempspace integer,
  951. session_limit_logspace integer,
  952. session_limit_txn_time integer
  953. }
  954. );
  955. create unique index informix.sysscblst_sidix on sysscblst(sid DESC);
  956. revoke all on informix.sysscblst from public as informix;
  957. grant select on informix.sysscblst to public as informix;
  958. { Thread control blocks }
  959. create table informix.systcblst { Internal Use Only }
  960. (
  961. tid integer, { thread id }
  962. address int8, { address of thread structure }
  963. stackp int8, { ptr to threads stack }
  964. tnext int8, { next thread in global list }
  965. tprev int8, { prev thread in global list }
  966. lock int8, { thread struct protection }
  967. next int8, { next thread in special list }
  968. prev int8, { prev thread in special list }
  969. joinlist int8, { head of joined threads list }
  970. joinnext int8, { next in joined threads list }
  971. joinee int8, { thread this thread joined }
  972. joinresult integer, { result of join }
  973. initialroutine int8, { initial thread procedure }
  974. initialarg int8, { initial arg }
  975. name char(12), { thread name }
  976. self int8, { this thread's address }
  977. state integer, { thread state }
  978. statedesc char(10), { thread state description }
  979. statedetail char(30), { thread state detailed descr }
  980. flags integer, { flags }
  981. wait_time integer, { wait time accumulator }
  982. detach integer, { thread detach mode }
  983. priority integer, { thread priority }
  984. class integer, { user defined thread class }
  985. vpid integer, { vpid where thread is running }
  986. bind_vp int8, { vp on which thread must run }
  987. bind_priv integer, { thread has been bound }
  988. private_data int8, { ptr to private data }
  989. wtmutexp int8, { ptr to mutex waiting on }
  990. wtcondp int8, { ptr to condition waiting on }
  991. sleep_time integer, { seconds slept + start time }
  992. start_wait integer, { sleep start time }
  993. pcount integer, { number of valid p elements }
  994. padrp int8, { ptr to padr table }
  995. pvalp int8, { ptr to pval table }
  996. last_run_time integer, { total time thread has run }
  997. wakeup_count integer, { number of stacked wakeups }
  998. tstatp int8, { ptr to thread TSTAT_T struct }
  999. wstatp int8, { ptr to thread WSTAT_T struct }
  1000. wreason integer, { reason for thread to be wait }
  1001. wait_reason char(18), { reason for thread to be wait }
  1002. num_sched int8, { number of times thread sched }
  1003. cpu_time float { time spent running on vp }
  1004. );
  1005. create unique index informix.systcblst_tidix on systcblst(tid);
  1006. revoke all on informix.systcblst from public as informix;
  1007. grant select on informix.systcblst to public as informix;
  1008. { VP info }
  1009. create table informix.sysvplst { Internal Use Only }
  1010. (
  1011. vpid integer, { VP id }
  1012. address int8, { address of VP struct }
  1013. pid integer, { unix process id }
  1014. usecs_user float, { number of usecs of user time }
  1015. usecs_sys float, { number of usecs of system time}
  1016. scputimep int8, { ptr to saved cputime (tms) }
  1017. rcputimep int8, { ptr to reset cputime (tms) }
  1018. class integer, { class of VP }
  1019. classname char(19), { classname of VP }
  1020. readyqueue int8, { ptr to ready queue tab (TCB_Q)}
  1021. num_ready integer, { number of ready threads }
  1022. flags integer, { VP flags }
  1023. next int8, { next in idle list }
  1024. prev int8, { prev in idle list }
  1025. semid integer, { semid for this VP }
  1026. lock int8, { VP protection }
  1027. total_semops int8, { Total times VP slept on a semop }
  1028. total_busy_wts int8, { Total VP busy waits }
  1029. total_yields int8, { Total VP yields }
  1030. total_spins int8, { Total spins while busy waiting }
  1031. steal_attempts int8, { }
  1032. steal_attempts_suc int8, { }
  1033. idle_search int8, { }
  1034. idle_search_suc int8, { }
  1035. vp_poll_scheds int8, { }
  1036. vp_mt_naps int8, { }
  1037. vp_cache_size int8, { size of the vp cache }
  1038. vp_cache_allocs int8, { }
  1039. vp_cache_miss int8, { }
  1040. vp_cache_frees int8, { }
  1041. vp_cache_drain int8, { }
  1042. vp_cache_nblocks int8, { current number of blocks }
  1043. thread_run float, { total thread run time on vp }
  1044. thread_idle float, { total time running idle thread}
  1045. thread_poll_idle float { inline poll thread idle time }
  1046. );
  1047. create unique index informix.sysvplst_vpidix on sysvplst(vpid);
  1048. revoke all on informix.sysvplst from public as informix;
  1049. grant select on informix.sysvplst to public as informix;
  1050. { Data Replication control block }
  1051. create table informix.sysdrcb { Internal Use Only }
  1052. (
  1053. address int8, { address of drcb structure }
  1054. version integer, { drcb version }
  1055. lock int8, { drcb lock }
  1056. type integer, { drcb server type }
  1057. name char(128), { drcb server name;128=IDENTSIZE}
  1058. intvl integer, { dr buffer flush interval }
  1059. timeout integer, { dr network timeout }
  1060. drauto integer, { dr auto }
  1061. dridxauto integer, { dr idxauto }
  1062. lostfound char(256), { dr lost+found pathname }
  1063. state integer, { dr server state }
  1064. failrecvr integer, { dr failure recovery flags }
  1065. pingtime integer, { dr last ping time }
  1066. sessiontid int8, { dr session thread }
  1067. pingtid int8, { dr ping thread }
  1068. applytid int8, { dr apply thread }
  1069. recvrtid int8, { logcial recovery thread }
  1070. scb int8, { dr scb }
  1071. client_type integer, { dr client type }
  1072. no_kill integer, { dr no_kill flag }
  1073. no_clients integer, { dr no_clients flag }
  1074. lgr_scb int8, { logcical recovery scb }
  1075. lgr_rstcb int8, { logcical recovery rstcb }
  1076. lgr_bufsize integer, { logical recovery buffer size }
  1077. lgr_numbufs integer, { number logcial recovery buffers}
  1078. ckptaddr int8, { dr last ckpt address }
  1079. cpflag integer, { dr cpflag }
  1080. bufflag integer, { dr bufflag }
  1081. lg_offs integer, { dr lg_offs }
  1082. ll int8, { dr logical log info }
  1083. bufcur int8, { dr current buffer }
  1084. bqempty int8, { dr empty q }
  1085. bqfull int8 { dr full q }
  1086. );
  1087. revoke all on informix.sysdrcb from public as informix;
  1088. grant select on informix.sysdrcb to public as informix;
  1089. { CDR queued info table }
  1090. create table informix.syscdrq { Internal Use Only }
  1091. (
  1092. srvid integer, { CDR server id }
  1093. repid integer, { CDR replicate id }
  1094. srcid integer, { CDR source server id }
  1095. srvname char(128), { target server name }
  1096. replname char(128), { collection or replicate name }
  1097. srcname char(128), { source server name }
  1098. bytesqued integer { number of bytes queued }
  1099. );
  1100. create unique index informix.syscdrq_idx on syscdrq(srvid,repid,srcid);
  1101. revoke all on informix.syscdrq from public as informix;
  1102. grant select on informix.syscdrq to public as informix;
  1103. { CDR trans. processed info table }
  1104. create table informix.syscdrtx { Internal Use Only }
  1105. (
  1106. srvid integer, { CDR server id }
  1107. srvname char(128), { target server name }
  1108. txprocssd integer, { number of trans. processed }
  1109. txcmmtd integer, { number of trans. committed }
  1110. txabrtd integer, { number of trans. aborted }
  1111. rowscmmtd integer, { number of rows committed }
  1112. rowsabrtd integer, { number of rows aborted }
  1113. txbadcnt integer { number of trans. bad commit time }
  1114. );
  1115. create unique index informix.syscdrtx_idx on syscdrtx(srvid);
  1116. revoke all on informix.syscdrtx from public as informix;
  1117. grant select on informix.syscdrtx to public as informix;
  1118. { CDR server }
  1119. create table informix.syscdrs { Internal Use Only }
  1120. (
  1121. servid integer, { server id }
  1122. servname char(128), { server name }
  1123. cnnstate char(1), { connection state }
  1124. cnnstatechg integer, { time connection status changed }
  1125. servstate char(1), { server state }
  1126. ishub char(1), { hub flag }
  1127. isleaf char(1), { leaf flag }
  1128. rootserverid integer, { root server id }
  1129. forwardnodeid integer, { forward node server id }
  1130. timeout integer { idle connection timeout }
  1131. );
  1132. create unique index informix.syscdrs_idx on syscdrs(servid);
  1133. revoke all on informix.syscdrs from public as informix;
  1134. grant select on informix.syscdrs to public as informix;
  1135. { CDR in memory send progress table }
  1136. create table informix.syscdrprog { Internal Use Only }
  1137. (
  1138. dest_id integer,
  1139. group_id integer,
  1140. source_id integer,
  1141. key_acked_srv integer,
  1142. key_acked_lgid integer,
  1143. key_acked_lgpos integer,
  1144. key_acked_seq integer,
  1145. tx_stamp_1 integer,
  1146. tx_stamp_2 integer
  1147. );
  1148. create unique index informix.syscdrprog_idx
  1149. on syscdrprog(dest_id, group_id, source_id);
  1150. revoke all on informix.syscdrprog from public as informix;
  1151. { CDR in memory receive progress table }
  1152. create table informix.syscdrrecvqprog { Internal Use Only }
  1153. (
  1154. dest_id integer,
  1155. group_id integer,
  1156. source_id integer,
  1157. key_acked_srv integer,
  1158. key_acked_lgid integer,
  1159. key_acked_lgpos integer,
  1160. key_acked_seq integer,
  1161. tx_stamp_1 integer,
  1162. tx_stamp_2 integer,
  1163. total_failed_rows integer
  1164. );
  1165. create unique index informix.syscdrrecvqprog_idx
  1166. on syscdrrecvqprog(dest_id, group_id, source_id);
  1167. revoke all on informix.syscdrrecvqprog from public as informix;
  1168. { CDR in memory control queue progress table }
  1169. create table informix.syscdrcntrlqprog { Internal Use Only }
  1170. (
  1171. dest_id integer,
  1172. group_id integer,
  1173. source_id integer,
  1174. key_queued_srv integer,
  1175. key_queued_lgid integer,
  1176. key_queued_lgpos integer,
  1177. key_queued_seq integer,
  1178. key_acked_srv integer,
  1179. key_acked_lgid integer,
  1180. key_acked_lgpos integer,
  1181. key_acked_seq integer
  1182. );
  1183. create unique index informix.syscdrcntrlqprog_idx
  1184. on syscdrcntrlqprog(dest_id, group_id, source_id);
  1185. revoke all on informix.syscdrcntrlqprog from public as informix;
  1186. grant select on informix.syscdrcntrlqprog to public as informix;
  1187. { CDR in memory queues }
  1188. create table informix.syscdrsend_txn { Internal Use Only }
  1189. (
  1190. ctkeyserverid integer,
  1191. ctkeyid integer,
  1192. ctkeypos integer,
  1193. ctkeysequence integer,
  1194. ctstamp bigint,
  1195. ctcommittime integer,
  1196. ctuserid integer,
  1197. ctfromid integer
  1198. );
  1199. create unique index informix.syscdrsend_tidx on syscdrsend_txn(ctstamp);
  1200. revoke all on informix.syscdrsend_txn from public as informix;
  1201. { Reorganizations that are active or finished }
  1202. create table informix.sysreorgops {Customer use }
  1203. (
  1204. id integer,
  1205. dbname char(128),
  1206. owner char(32),
  1207. tabname char(128),
  1208. threadid integer,
  1209. dbsnum integer,
  1210. partnum integer,
  1211. status char(20),
  1212. substatus integer,
  1213. errno integer
  1214. );
  1215. revoke all on informix.sysreorgops from public as informix;
  1216. grant select on informix.sysreorgops to public as informix;
  1217. create table informix.syscdrack_txn { Internal Use Only }
  1218. (
  1219. ctkeyserverid integer,
  1220. ctkeyid integer,
  1221. ctkeypos integer,
  1222. ctkeysequence integer,
  1223. ctstamp bigint,
  1224. ctcommittime integer,
  1225. ctuserid integer,
  1226. ctfromid integer
  1227. );
  1228. create unique index informix.syscdrack_tidx on syscdrack_txn(ctstamp);
  1229. revoke all on informix.syscdrack_txn from public as informix;
  1230. create table informix.syscdrctrl_txn { Internal Use Only }
  1231. (
  1232. ctkeyserverid integer,
  1233. ctkeyid integer,
  1234. ctkeypos integer,
  1235. ctkeysequence integer,
  1236. ctstamp bigint,
  1237. ctcommittime integer,
  1238. ctuserid integer,
  1239. ctfromid integer
  1240. );
  1241. create unique index informix.syscdrctrl_tidx on syscdrctrl_txn(ctstamp);
  1242. revoke all on informix.syscdrctrl_txn from public as informix;
  1243. create table informix.syscdrsync_txn { Internal Use Only }
  1244. (
  1245. ctkeyserverid integer,
  1246. ctkeyid integer,
  1247. ctkeypos integer,
  1248. ctkeysequence integer,
  1249. ctstamp bigint,
  1250. ctcommittime integer,
  1251. ctuserid integer,
  1252. ctfromid integer
  1253. );
  1254. create unique index informix.syscdrsync_tidx on syscdrsync_txn(ctstamp);
  1255. revoke all on informix.syscdrsync_txn from public as informix;
  1256. create table informix.syscdrrecv_txn { Internal Use Only }
  1257. (
  1258. ctkeyserverid integer,
  1259. ctkeyid integer,
  1260. ctkeypos integer,
  1261. ctkeysequence integer,
  1262. ctstamp bigint,
  1263. ctcommittime integer,
  1264. ctuserid integer,
  1265. ctfromid integer
  1266. );
  1267. create unique index informix.syscdrsrecv_tidx on syscdrrecv_txn(ctstamp);
  1268. revoke all on informix.syscdrrecv_txn from public as informix;
  1269. create table informix.syscdrsend_buf { Internal Use Only }
  1270. (
  1271. cbflags integer,
  1272. cbsize integer,
  1273. cbkeyserverid integer,
  1274. cbkeyid integer,
  1275. cbkeypos integer,
  1276. cbkeysequence integer,
  1277. cbgroupid integer,
  1278. cbcommittime integer
  1279. );
  1280. create unique index informix.syscdrsend_bidx
  1281. on syscdrsend_buf(cbkeyserverid, cbkeyid, cbkeypos, cbkeysequence);
  1282. revoke all on informix.syscdrsend_buf from public as informix;
  1283. create table informix.syscdrack_buf { Internal Use Only }
  1284. (
  1285. cbflags integer,
  1286. cbsize integer,
  1287. cbkeyserverid integer,
  1288. cbkeyid integer,
  1289. cbkeypos integer,
  1290. cbkeysequence integer,
  1291. cbgroupid integer,
  1292. cbcommittime integer
  1293. );
  1294. create unique index informix.syscdrack_bidx
  1295. on syscdrack_buf(cbkeyserverid, cbkeyid, cbkeypos, cbkeysequence);
  1296. revoke all on informix.syscdrack_buf from public as informix;
  1297. create table informix.syscdrctrl_buf { Internal Use Only }
  1298. (
  1299. cbflags integer,
  1300. cbsize integer,
  1301. cbkeyserverid integer,
  1302. cbkeyid integer,
  1303. cbkeypos integer,
  1304. cbkeysequence integer,
  1305. cbgroupid integer,
  1306. cbcommittime integer
  1307. );
  1308. create unique index informix.syscdrctrl_bidx
  1309. on syscdrctrl_buf(cbkeyserverid, cbkeyid, cbkeypos, cbkeysequence);
  1310. revoke all on informix.syscdrctrl_buf from public as informix;
  1311. create table informix.syscdrsync_buf { Internal Use Only }
  1312. (
  1313. cbflags integer,
  1314. cbsize integer,
  1315. cbkeyserverid integer,
  1316. cbkeyid integer,
  1317. cbkeypos integer,
  1318. cbkeysequence integer,
  1319. cbgroupid integer,
  1320. cbcommittime integer
  1321. );
  1322. create unique index informix.syscdrsync_bidx
  1323. on syscdrsync_buf(cbkeyserverid, cbkeyid, cbkeypos, cbkeysequence);
  1324. revoke all on informix.syscdrsync_buf from public as informix;
  1325. create table informix.syscdrrecv_buf { Internal Use Only }
  1326. (
  1327. cbflags integer,
  1328. cbsize integer,
  1329. cbkeyserverid integer,
  1330. cbkeyid integer,
  1331. cbkeypos integer,
  1332. cbkeysequence integer,
  1333. cbgroupid integer,
  1334. cbcommittime integer
  1335. );
  1336. create unique index informix.syscdrrecv_bidx
  1337. on syscdrrecv_buf(cbkeyserverid, cbkeyid, cbkeypos, cbkeysequence);
  1338. revoke all on informix.syscdrrecv_buf from public as informix;
  1339. grant select on informix.syscdrrecv_buf to public as informix;
  1340. create table informix.syscdrrecv_stats { Internal Use Only }
  1341. (
  1342. source integer, { source server - cdrid }
  1343. txncnt integer, { number of txn from this source }
  1344. pending integer, { txn this source currently pending }
  1345. active integer, { txn this source currently active }
  1346. maxpending integer, { max txn pending this source }
  1347. maxactive integer, { max txn active form this source }
  1348. avg_pending float, { avg pending txn this source }
  1349. avg_active float, { avg active txn this source }
  1350. cmtrate float { avt commit rate from this source }
  1351. );
  1352. create unique index informix.syscdrrecv_sidx
  1353. on syscdrrecv_stats (source);
  1354. revoke all on informix.syscdrrecv_stats from public as informix;
  1355. grant select on informix.syscdrrecv_stats to public as informix;
  1356. create table informix.syscdrlatency { Internal Use Only }
  1357. (
  1358. source integer, { source of txn - cdrid }
  1359. replid integer, { replicate id }
  1360. txncnt integer, { num txn this source - repl }
  1361. inserts integer, { insert count }
  1362. deletes integer, { delete count }
  1363. updates integer, { update count }
  1364. last_tgt_apply integer, { last target apply - cdrtime }
  1365. last_src_apply integer { last source apply - cdrtime }
  1366. );
  1367. create unique index informix.syscdrlatency_idx
  1368. on syscdrlatency (source, replid);
  1369. revoke all on informix.syscdrlatency from public as informix;
  1370. grant select on informix.syscdrlatency to public as informix;
  1371. create table informix.syscdrtsapply { Internal Use Only }
  1372. (
  1373. source integer, { source of txn - cdrid }
  1374. replid integer, { replicate id }
  1375. txncnt integer, { num txn this source - repl }
  1376. tsinserts integer, { ts insert count }
  1377. tsdeletes integer, { ts delete count }
  1378. tscmd integer, { ts command count }
  1379. last_tgt_apply integer, { last target apply - cdrtime }
  1380. last_src_apply integer { last source apply - cdrtime }
  1381. );
  1382. create unique index informix.syscdrtsapply_idx
  1383. on syscdrtsapply (source, replid);
  1384. revoke all on informix.syscdrtsapply from public as informix;
  1385. grant select on informix.syscdrtsapply to public as informix;
  1386. create table informix.syscdr_rqm { Internal Use Only }
  1387. (
  1388. rqm_idx integer, { index number }
  1389. rqm_name char(128), { queue name }
  1390. rqm_flags integer, { flags }
  1391. rqm_txn integer, { transactions in queue }
  1392. rqm_event integer, { events in queue }
  1393. rqm_txn_in_memory integer, { transaction in memory }
  1394. rqm_txn_in_spool_only integer, { spool only txn }
  1395. rqm_txn_spooled integer, { spooled only txn }
  1396. rqm_unspooled_bytes int8, { unspooled bytes }
  1397. rqm_data_in_queue int8, { data in queue }
  1398. rqm_inuse_mem int8, { real memory in use }
  1399. rqm_pending_buffer integer, { pending buffers }
  1400. rqm_pending_data int8, { pending buffers }
  1401. rqm_maxmemdata int8, { max memory in use - data }
  1402. rqm_maxmemhdr int8, { max memory in use - headers }
  1403. rqm_totqueued int8, { total data queued }
  1404. rqm_tottxn integer, { total transactions queued }
  1405. rqm_totspooled integer, { total txn spooled }
  1406. rqm_totrestored integer, { total txn restored }
  1407. rqm_totrecovered integer, { total txn recovered }
  1408. rqm_totspoolread integer, { total rows read from spool }
  1409. rqm_totdeleted integer, { total txn deleted }
  1410. rqm_totduplicated integer, { total txn duplicate }
  1411. rqm_totlookup integer { total txn lookups }
  1412. );
  1413. create unique index informix.syscdr_rqmidx
  1414. on syscdr_rqm (rqm_idx);
  1415. revoke all on informix.syscdr_rqm from public as informix;
  1416. grant select on informix.syscdr_rqm to public as informix;
  1417. { CDR state }
  1418. create table informix.syscdr_state
  1419. (
  1420. er_state char(24), { State of ER }
  1421. er_capture_state char(24), { Current state of DDR (capture) }
  1422. er_network_state char(64), { Current state of Nif }
  1423. er_apply_state char(24) { Current state receive manager (apply)}
  1424. );
  1425. revoke all on informix.syscdr_state from public as informix;
  1426. grant select on informix.syscdr_state to public as informix;
  1427. create table informix.syscdr_ddr
  1428. (
  1429. ddr_state char(24), { Current stage of DDR (capture) }
  1430. ddr_snoopy_loguniq integer, { Current Snooped Unique Logid }
  1431. ddr_snoopy_logpos integer, { Current Snooped log pos }
  1432. ddr_replay_loguniq integer, { Current Replay Unique Logid }
  1433. ddr_replay_logpos integer, { Current Replay log pos }
  1434. ddr_curr_loguniq integer, { Current Unique Logid }
  1435. ddr_curr_logpos integer, { Current log pos }
  1436. ddr_logsnoop_cached integer, { Logs snooped from cache }
  1437. ddr_logsnoop_disk integer, { Logs snooped from disk }
  1438. ddr_logs_tossed integer, { Logs not cached due to full cache }
  1439. ddr_logs_ignored integer, { unknown log pages encountered }
  1440. ddr_dlog_requests integer, { Number of dynamic logs allocated }
  1441. ddr_total_logspace integer, { System log space in pages}
  1442. ddr_logpage2wrap integer, { Number of pages until log wrap }
  1443. ddr_logpage2block integer, { Number of log pages until log lag state }
  1444. ddr_logneeds integer, { DDR log needs }
  1445. ddr_logcatchup integer, { log pages needed to releas log lag state }
  1446. ddr_loglag_state char(10), { DDR Log Lag State: on/off }
  1447. ddr_cur_loglag_act char(24), { Current catchup phase action }
  1448. ddr_logstage_diskusage float, { log staging disk space usage in %}
  1449. ddr_logstage_hwm4disk integer,{ Maximum disk space allowed for log staging in KB}
  1450. ddr_logstage_maxused float,{ Maximum disk space ever used for log staging in KB}
  1451. ddr_logstage_lfile_cnt integer { Staged log file count }
  1452. );
  1453. revoke all on informix.syscdr_ddr from public as informix;
  1454. grant select on informix.syscdr_ddr to public as informix;
  1455. create table informix.syscdr_nif
  1456. (
  1457. nif_connid integer, { CDRID of connected node }
  1458. nif_connname char(24), { Name of connected node }
  1459. nif_state char(24), { State of NIF }
  1460. nif_connstate char(24), { State of this connection }
  1461. nif_version integer, { NIF protocol used this connection }
  1462. nif_msgsent integer, { Number of msg sent this connection }
  1463. nif_bytessent integer, { Bytes sent this connection }
  1464. nif_msgrcv integer, { Number of msg received this conn}
  1465. nif_bytesrcv integer, { Bytes received this connection }
  1466. nif_compress integer, { Compression level this connection }
  1467. nif_sentblockcnt integer, { Number of times that we sent flow block }
  1468. nif_rcvblockcnt integer, { Number of times we received flow block }
  1469. nif_trgsend_stamp bigint, { Stamp of last transaction msg sent }
  1470. nif_acksend_stamp bigint, { Stamp of last ACK msg sent }
  1471. nif_ctrlsend_stamp bigint, { Stamp of last control msg sent }
  1472. nif_syncsend_stamp bigint, { Stamp of last metadata sync msg sent }
  1473. nif_starttime datetime year to second,
  1474. nif_lastsend datetime year to second
  1475. );
  1476. revoke all on informix.syscdr_nif from public as informix;
  1477. grant select on informix.syscdr_nif to public as informix;
  1478. create table informix.syscdr_rcv
  1479. (
  1480. rm_state char(100), { Current state of RM }
  1481. rm_num_sleepers integer, { number of sleeping threads }
  1482. rm_num_dsthreads integer, { Number of DS threads }
  1483. rm_min_dsthreads integer, { Minimum number of DS threads }
  1484. rm_max_dsthreads integer, { Maximum number of DS threads }
  1485. rm_ds_block integer, { Is Datasync currently blocked }
  1486. rm_ds_parallel integer, { Current degree of parallelism }
  1487. rm_ds_failrate float, { Ratio of datasync failures }
  1488. rm_ds_numrun integer, { Number of transactions applied }
  1489. rm_ds_num_locktout integer, { Number of DS lock timeouts }
  1490. rm_ds_num_lockrb integer, { Number of forced RB due to locks }
  1491. rm_ds_num_deadlocks integer, { Number of deadly embraces }
  1492. rm_ds_num_pcommits integer, { Number of out-of-order commits }
  1493. rm_ack_waiting integer, { Number of ACK threads waiting }
  1494. rm_totsleep integer, { number of sleep requests }
  1495. rm_sleeptime integer, { time of sleeps }
  1496. rm_workload integer, { indicator of potential workload }
  1497. rm_optscale integer, { optscale value }
  1498. rm_min_fthreads integer, { min number of floating threads }
  1499. rm_max_fthreads integer, { max number of floating threads }
  1500. rm_ackthreads integer, { number of ack threads running }
  1501. rm_ackwaiters integer, { number of ack threads waiting }
  1502. rm_ack_start char(64), { time that ack threads started }
  1503. rm_ds_start char(64), { time that datasync started }
  1504. rm_pending_acks integer, { acks not yet processed }
  1505. rm_blob_error_bufs integer { blob error buff count }
  1506. );
  1507. revoke all on informix.syscdr_rcv from public as informix;
  1508. grant select on informix.syscdr_rcv to public as informix;
  1509. create table informix.syscdr_atsdir
  1510. (
  1511. atsd_rid integer, { identifier of this row }
  1512. atsd_file char(128), { ats file }
  1513. atsd_mode integer, { mode of this file }
  1514. atsd_size integer, { size of this file }
  1515. atsd_atime datetime year to second,
  1516. atsd_mtime datetime year to second,
  1517. atsd_ctime datetime year to second
  1518. );
  1519. revoke all on informix.syscdr_atsdir from public as informix;
  1520. grant select on informix.syscdr_atsdir to public as informix;
  1521. create table informix.syscdr_risdir
  1522. (
  1523. risd_rid integer, { identifier of this row }
  1524. risd_file char(128), { ats file }
  1525. risd_mode integer, { mode of this file }
  1526. risd_size integer, { size of this file }
  1527. risd_atime datetime year to second,
  1528. risd_mtime datetime year to second,
  1529. risd_ctime datetime year to second
  1530. );
  1531. revoke all on informix.syscdr_risdir from public as informix;
  1532. grant select on informix.syscdr_risdir to public as informix;
  1533. create table informix.syscdr_ats
  1534. (
  1535. ats_rid integer,
  1536. ats_file char(128),
  1537. ats_sourceid integer,
  1538. ats_source char(128),
  1539. ats_committime char(20),
  1540. ats_targetid integer,
  1541. ats_target char(128),
  1542. ats_receivetime char(20),
  1543. ats_risfile char(128),
  1544. ats_line1 char(200),
  1545. ats_line2 char(200),
  1546. ats_line3 char(200),
  1547. ats_line4 char(200),
  1548. ats_line5 char(200),
  1549. ats_line6 char(200),
  1550. ats_line7 char(200),
  1551. ats_line8 char(200),
  1552. ats_line9 char(200),
  1553. ats_line10 char(200)
  1554. );
  1555. revoke all on informix.syscdr_ats from public as informix;
  1556. grant select on informix.syscdr_ats to public as informix;
  1557. create table informix.syscdr_ris
  1558. (
  1559. ris_rid integer,
  1560. ris_file char(128),
  1561. ris_sourceid integer,
  1562. ris_source char(128),
  1563. ris_committime char(20),
  1564. ris_targetid integer,
  1565. ris_target char(128),
  1566. ris_receivetime char(20),
  1567. ris_atsfile char(128),
  1568. ris_line1 char(200),
  1569. ris_line2 char(200),
  1570. ris_line3 char(200),
  1571. ris_line4 char(200),
  1572. ris_line5 char(200),
  1573. ris_line6 char(200),
  1574. ris_line7 char(200),
  1575. ris_line8 char(200),
  1576. ris_line9 char(200),
  1577. ris_line10 char(200)
  1578. );
  1579. revoke all on informix.syscdr_ris from public as informix;
  1580. grant select on informix.syscdr_ris to public as informix;
  1581. create table informix.syscdr_rqmstamp
  1582. (
  1583. rqms_qidx integer,
  1584. rqms_stamp bigint,
  1585. rqms_cstamp bigint
  1586. );
  1587. revoke all on informix.syscdr_rqmstamp from public as informix;
  1588. grant select on informix.syscdr_rqmstamp to public as informix;
  1589. create table informix.syscdr_rqmhandle
  1590. (
  1591. rqmh_qidx integer,
  1592. rqmh_thread char(18),
  1593. rqmh_stamp bigint,
  1594. rqmh_servid integer,
  1595. rqmh_logid integer,
  1596. rqmh_logpos integer,
  1597. rqmh_seq integer
  1598. );
  1599. revoke all on informix.syscdr_rqmhandle from public as informix;
  1600. grant select on informix.syscdr_rqmhandle to public as informix;
  1601. { Compression Dictionaries }
  1602. create table informix.syscompdicts_full
  1603. (
  1604. dict_partnum integer,
  1605. { Partition number this dictionary applies to }
  1606. dict_code_version integer,
  1607. { Version of the code creating this dict (1 in 1st version) }
  1608. dict_dbsnum integer,
  1609. { Dbspace number this dictionary resides in }
  1610. dict_create_timestamp integer,
  1611. { Timestamp of dictionary creation }
  1612. dict_create_loguniqid integer,
  1613. { Logical log unique ID when dictionary was created }
  1614. dict_create_logpos integer,
  1615. { Position within that log when dictionary was created }
  1616. dict_drop_timestamp integer,
  1617. { Timestamp of dictionary drop }
  1618. dict_drop_loguniqid integer,
  1619. { Logical log unique ID when dictionary was "dropped" }
  1620. dict_drop_logpos integer,
  1621. { Position within that log when dictionary was "dropped" }
  1622. dict_dictionary byte
  1623. { Compression dictionary object binary }
  1624. );
  1625. create index informix.syscompdict_pnum on syscompdicts_full(dict_partnum);
  1626. revoke all on informix.syscompdicts_full from public as informix;
  1627. grant select on informix.syscompdicts_full to informix as informix;
  1628. { Physical Log }
  1629. create table informix.sysplog
  1630. (
  1631. pl_mutex int8, { physical log mutex }
  1632. pl_b1mutex int8, { buf1's mutex }
  1633. pl_b1condition int8, { buf1's condition for wait/signal }
  1634. pl_b1used smallint, { buf1's log buffer used }
  1635. pl_b1copied smallint, { buf1's log pages actually bcopied }
  1636. pl_b1buffer int8, { buf1's log buffer }
  1637. pl_b1wtlist int8, { buf1's waiting for used = copied }
  1638. pl_b2mutex int8, { buf2's mutex }
  1639. pl_b2condition int8, { buf2's condition for wait/signal }
  1640. pl_b2used smallint, { buf2's log buffer used }
  1641. pl_b2copied smallint, { buf2's log pages actually bcopied }
  1642. pl_b2buffer int8, { buf2's log buffer }
  1643. pl_b2wtlist int8, { buf2's waiting for used = copied }
  1644. pl_curbp int8, { current bp }
  1645. pl_otherbp int8, { other bp }
  1646. pl_bufsize smallint, { log buffer size in pages }
  1647. pl_stamp integer, { log flush timestamp }
  1648. pl_chunk integer, { log file disk address - chunk }
  1649. pl_offset integer, { log file disk address - offset}
  1650. pl_physize integer, { log file size in pages }
  1651. pl_phypos integer, { log file position in pages }
  1652. pl_phyused integer, { log file used in pages }
  1653. pl_phyarch integer { on-line archive position }
  1654. );
  1655. revoke all on informix.sysplog from public as informix;
  1656. grant select on informix.sysplog to public as informix;
  1657. { Thread Wait Stats }
  1658. create table informix.systwaits { Internal Use Only }
  1659. (
  1660. tid integer, { thread id of these stats }
  1661. starttime bigint, { start time of wait or run }
  1662. startrtime bigint, { start time of ready state }
  1663. reason integer, { reason for current wait }
  1664. wreason smallint, { reason for wstats }
  1665. wnum integer, { number of waits for wreason }
  1666. wcumtime float, { cumulative time for wreason }
  1667. wmaxtime integer { maximum time for wreason }
  1668. );
  1669. create unique index informix.systwaits_tid on systwaits(tid, wreason);
  1670. revoke all on informix.systwaits from public as informix;
  1671. grant select on informix.systwaits to public as informix;
  1672. { Mutexes }
  1673. create table informix.sysmtxlst { Internal Use Only }
  1674. (
  1675. mtx_id integer, { id of this mutex }
  1676. mtx_address int8, { address of this mutex }
  1677. mtx_next int8, { pointer to next mutex in list }
  1678. mtx_prev int8, { pointer to prev mutex in list }
  1679. mtx_lock integer, { mutex lock 0=avail, 1=held }
  1680. mtx_wtlock integer, { protects wait list }
  1681. mtx_holder int8, { thread holding lock }
  1682. mtx_wtlist int8, { address of first thread on list}
  1683. mtx_type smallint, { type of mutex }
  1684. mtx_flags smallint, { flags }
  1685. mtx_lkcnt smallint, { relock or share lock count }
  1686. mtx_name char(12), { name of mutex }
  1687. mtx_nwaits integer, { number of waits on this mutex }
  1688. mtx_nservs integer, { number of services }
  1689. mtx_curlen integer, { current length }
  1690. mtx_totlen integer, { total queue length }
  1691. mtx_maxlen integer, { maximum queue length }
  1692. mtx_waittime float, { cumulative wait time (usecs) }
  1693. mtx_servtime float, { cumulative service time (usecs)}
  1694. mtx_maxwait integer { maximum wait time (usecs) }
  1695. );
  1696. create unique index informix.sysmtxlstix1 on sysmtxlst(mtx_id);
  1697. create unique index informix.sysmtxlstix2 on sysmtxlst(mtx_address);
  1698. revoke all on informix.sysmtxlst from public as informix;
  1699. grant select on informix.sysmtxlst to public as informix;
  1700. { Conditions }
  1701. create table informix.sysconlst { Internal Use Only }
  1702. (
  1703. con_id integer, { id of this condition }
  1704. con_address int8, { address of this condition }
  1705. con_next int8, { pointer to next condition in list}
  1706. con_prev int8, { pointer to prev condition in list}
  1707. con_lock integer, { condition lock 0=avail, 1=held}
  1708. con_wtlist int8, { address of first thread on wait list}
  1709. con_type integer, { type of condition (const) }
  1710. con_name char(12), { name of condition }
  1711. con_nwaits integer, { number of waits on this mutex }
  1712. con_nservs integer, { number of services }
  1713. con_curlen integer, { current length }
  1714. con_totlen integer, { total queue length }
  1715. con_maxlen integer, { maximum queue length }
  1716. con_waittime float, { cumulative wait time (usecs) }
  1717. con_servtime float, { cumulative service time (usecs)}
  1718. con_maxwait integer { maximum wait time (usecs) }
  1719. );
  1720. create unique index informix.sysconlstix1 on sysconlst(con_id);
  1721. create unique index informix.sysconlstix2 on sysconlst(con_address);
  1722. revoke all on informix.sysconlst from public as informix;
  1723. grant select on informix.sysconlst to public as informix;
  1724. { Pools }
  1725. create table informix.syspoollst { Internal Use Only }
  1726. (
  1727. po_id integer, { id of this pool }
  1728. po_address int8, { address of this pool }
  1729. po_next int8, { pointer to next pool in list }
  1730. po_prev int8, { pointer to prev pool in list }
  1731. po_lock integer, { lock to synchronise }
  1732. po_name char(12), { name of pool }
  1733. po_class smallint, { pool class 1=resident, 2=virtual, 3=message}
  1734. po_flags smallint, { notify if forget to free }
  1735. po_freeamt int8, { total amount in free list }
  1736. po_usedamt int8, { total amount in used list }
  1737. po_freelist int8, { address of free block list }
  1738. po_list int8, { address of pools block list }
  1739. po_sid integer { sid of the owner of this pool }
  1740. );
  1741. revoke all on informix.syspoollst from public as informix;
  1742. grant select on informix.syspoollst to public as informix;
  1743. { Segments }
  1744. create table informix.sysseglst { Internal Use Only }
  1745. (
  1746. seg_address int8, { address of segment structure }
  1747. seg_next int8, { pointer to next segment }
  1748. seg_prev int8, { pointer to prev segment }
  1749. seg_class smallint, { segment class }
  1750. seg_size int8, { size of this segment }
  1751. seg_osshmid integer, { id of this OS segment in this seg}
  1752. seg_osmaxsize int8, { size of maximum OS segment in this seg}
  1753. seg_osshmkey integer, { shmkey for first OS segment }
  1754. seg_procid integer, { process id of creator }
  1755. seg_userid smallint, { usr id of creator }
  1756. seg_shmaddr int8, { address of segment }
  1757. seg_ovhd int8, { amount of overhead bytes }
  1758. seg_lock int8, { lock to synchronise bitmap access}
  1759. seg_nextid integer, { segment id of next seg }
  1760. seg_bmapsz int8, { size of block map }
  1761. seg_blkused int8, { no. of used blocks in segment }
  1762. seg_blkfree int8 { no. of free blocks in segment }
  1763. );
  1764. revoke all on informix.sysseglst from public as informix;
  1765. grant select on informix.sysseglst to public as informix;
  1766. { Dictionary Hash }
  1767. create table informix.sysdic { Internal Use Only }
  1768. (
  1769. dic_hashno smallint, { hash-value }
  1770. dic_chainno smallint, { position in hash chain }
  1771. dic_partnum integer, { partition number }
  1772. dic_fextsize integer, { first extent size }
  1773. dic_nextsize integer, { next extent size }
  1774. dic_locklevel smallint, { lock level }
  1775. dic_flags integer, { table flags }
  1776. dic_ps integer, { table permissions }
  1777. dic_heapptr int8, { struct heap *DD memory heap }
  1778. dic_altcount integer, { alt count }
  1779. dic_ncols smallint, { number of columns }
  1780. dic_rowsize smallint, { row size in bytes }
  1781. dic_nindexes smallint, { number of indexes }
  1782. dic_type char(1), { table type }
  1783. dic_nrows float, { number of rows }
  1784. dic_npused float, { # pages in table }
  1785. dic_tabid integer, { dictionary table id }
  1786. dic_majversion integer, { table major version number }
  1787. dic_minversion integer, { table minor version number }
  1788. dic_refcount integer, { # of references to this entry }
  1789. dic_servername char(128), { like ddt_servername }
  1790. dic_dbname char(128), { like ddt_dbname }
  1791. dic_ownername char(32), { like ddt_owner }
  1792. dic_tabname char(128) { like ddt_name }
  1793. );
  1794. create unique index informix.sysdicidx on sysdic(dic_hashno, dic_chainno);
  1795. revoke all on informix.sysdic from public as informix;
  1796. grant select on informix.sysdic to public as informix;
  1797. { Distribution Hash }
  1798. create table informix.sysdsc { Internal Use Only }
  1799. (
  1800. dis_hashno integer, { hash values of name }
  1801. dis_chainno smallint, { position in chain }
  1802. dis_id integer, { id - other than name }
  1803. dis_refcnt integer, { number of users using entry }
  1804. dis_delete integer, { marked for delete }
  1805. dis_heapptr int8, { heap for entry }
  1806. dis_heapsz integer, { soze of heap }
  1807. dis_servername char(128), { get ce_name.fn_servername }
  1808. dis_dbname char(128), { get ce_name.fn_dbname }
  1809. dis_ownername char(32), { get ce_name.fn_ownername }
  1810. dis_name char(257) { get ce_name.fn_name }
  1811. );
  1812. create unique index informix.sysdscidx on sysdsc(dis_hashno, dis_chainno);
  1813. revoke all on informix.sysdsc from public as informix;
  1814. grant select on informix.sysdsc to public as informix;
  1815. { Procedure Hash }
  1816. create table informix.sysprc { Internal Use Only }
  1817. (
  1818. prc_hashno integer, { hash values of name }
  1819. prc_chainno smallint, { position in chain }
  1820. prc_id integer, { id - other than name }
  1821. prc_refcnt integer, { number of users using entry }
  1822. prc_delete integer, { marked for delete }
  1823. prc_heapptr int8, { heap for entry }
  1824. prc_heapsz integer, { soze of heap }
  1825. prc_servername char(128), { get ce_name.fn_servername }
  1826. prc_dbname char(128), { get ce_name.fn_dbname }
  1827. prc_ownername char(32), { get ce_name.fn_ownername }
  1828. prc_name char(257) { get ce_name.fn_name }
  1829. );
  1830. create unique index informix.sysprcidx on sysprc(prc_hashno, prc_chainno);
  1831. revoke all on informix.sysprc from public as informix;
  1832. grant select on informix.sysprc to public as informix;
  1833. { Sqscb }
  1834. create table informix.syssqscb { Internal Use Only }
  1835. (
  1836. scb_sessionid integer, { session id }
  1837. scb_address int8, { self address }
  1838. scb_feversion char(4), { see sqscb.fevers }
  1839. scb_lockmode smallint, { -1: wait, 0: not wait, else: # sec }
  1840. { see sqscb.waitflag and sqscb.waitsec }
  1841. scb_sqerrno smallint, { see sqtcb.sqerrno }
  1842. scb_iserrno smallint { see sqtcb.sqiserrno }
  1843. );
  1844. create unique index informix.syssqscbidx on syssqscb ( scb_sessionid DESC );
  1845. revoke all on informix.syssqscb from public as informix;
  1846. grant select on informix.syssqscb to public as informix;
  1847. { Sdblock }
  1848. create table informix.syssdblock { Internal Use Only }
  1849. (
  1850. sdb_sessionid integer, { session id }
  1851. sdb_sdbno integer, { position in array }
  1852. sdb_iscurrent char(1), { current statement? }
  1853. sdb_name char(128), { front-end's name for statement }
  1854. sdb_id smallint, { back-end's id for statement }
  1855. sdb_flags integer, { defined below }
  1856. sdb_executions integer, { total # of executions }
  1857. sdb_cumtime float, { total cumulative execution time }
  1858. sdb_bufreads integer, { total # of buffers read }
  1859. sdb_pagereads integer, { total # of pages read from disk }
  1860. sdb_bufwrites integer, { total # of buffers written }
  1861. sdb_pagewrites integer, { total # of pages written }
  1862. sdb_totsorts integer, { total # of sorts performed }
  1863. sdb_dsksorts integer, { total # of sorts requiring disk io }
  1864. sdb_sortspmax integer, { max disk space required by a sort }
  1865. sdb_cb int8, { conblock for statement }
  1866. sdb_cblist int8, { list of all cb's in statement }
  1867. sdb_heap int8, { memory heap for this statement }
  1868. sdb_partnum integer, { part num for temp blob table }
  1869. sdb_isfd smallint, { file descriptor for the table }
  1870. sdb_recnum integer, { row for blob descriptors }
  1871. sdb_sqerrno smallint, { for fetching, if rows need to be }
  1872. sdb_sqiserrno smallint, { returned to the user first, but }
  1873. sdb_sqoffset integer, { need to set the error in the next }
  1874. sdb_errstr char(64), { fetch statement }
  1875. sdb_ntables integer, { number of table descriptors }
  1876. sdb_sqttab int8, { thread specific tab info }
  1877. sdb_asynch_sqerrno integer, { error reported by asynch thread }
  1878. sdb_asynch_sqiserr integer, { error reported by asynch thread }
  1879. sdb_pool int8, { statement memory pool }
  1880. sdb_mutex int8, { misc lock (to check sd_sqerrno) }
  1881. sdb_tgcblist int8, { list of cbs to be use to build }
  1882. sdb_pdq_prio_req smallint, { requested priority }
  1883. sdb_pdq_priority smallint, { currently allowed pdq_priority }
  1884. sdb_max_scans integer { currently allowd # scans }
  1885. );
  1886. create unique index informix.syssdblockidx on syssdblock (sdb_sessionid DESC, sdb_sdbno);
  1887. revoke all on informix.syssdblock from public as informix;
  1888. grant select on informix.syssdblock to public as informix;
  1889. { Conblock }
  1890. create table informix.sysconblock { Internal Use Only }
  1891. (
  1892. cbl_sessionid integer, { session id }
  1893. cbl_sdbno integer, { position in sdblock array }
  1894. cbl_conbno smallint, { position in conblock list }
  1895. cbl_ismainblock char(1), { main block for statement? }
  1896. cbl_selflag smallint, { see cb_selflag (SQ_*) }
  1897. cbl_estcost integer, { see cb_estcost }
  1898. cbl_estrows integer, { see cb_estsize }
  1899. cbl_flags integer, { see cb_flags }
  1900. cbl_flags2 integer, { see cb_flags2 }
  1901. cbl_seqscan smallint, { # of SEQUENTIAL SCANs }
  1902. cbl_srtscan smallint, { # of SORT SCANs }
  1903. cbl_autoindex smallint, { # of AUTOINDEX PATHs }
  1904. cbl_index smallint, { # of INDEX PATHs }
  1905. cbl_remsql smallint, { # of REMOTE PATHs }
  1906. cbl_mrgjoin smallint, { # of MERGE JOINs }
  1907. cbl_dynhashjoin smallint, { # of DYNAMIC HASH JOINs }
  1908. cbl_keyonly smallint, { # of (Key-Only)s }
  1909. cbl_tempfile smallint, { # of Temporary Files }
  1910. cbl_tempview smallint, { # of Temp Tables For View }
  1911. cbl_secthreads smallint, { # of Secondary Threads }
  1912. cbl_stmt char(32000) { current statement }
  1913. );
  1914. create unique index informix.sysconblockidx on sysconblock ( cbl_sessionid DESC, cbL_sdbno, cbl_conbno);
  1915. revoke all on informix.sysconblock from public as informix;
  1916. { Opendb }
  1917. create table informix.sysopendb { Internal Use Only }
  1918. (
  1919. odb_sessionid integer, { session id }
  1920. odb_odbno integer, { position in opendb array }
  1921. odb_dbname char(128), { database name }
  1922. odb_iscurrent char(1), { no==sdb_current ? 'Y' : 'N' }
  1923. odb_islog char(1), { !logflg ? 'Y' : 'N' }
  1924. odb_isansi char(1), { ansiflg ? 'Y' : 'N' }
  1925. odb_isolation smallint, { isolation level see xtype }
  1926. odb_usrtype char(1), { user type (DBA, CONNECT .. }
  1927. odb_prior smallint, { priority }
  1928. odb_tmstamp integer, { timestamp for last access }
  1929. odb_lc_collate char(36), { value for LC_COLLATE }
  1930. odb_dbflags smallint { 1 if DB_EXCLUSIVE }
  1931. );
  1932. create unique index informix.sysopendbidx on sysopendb (odb_sessionid DESC, odb_odbno);
  1933. revoke all on informix.sysopendb from public as informix;
  1934. grant select on informix.sysopendb to public as informix;
  1935. { SQL cache profile information }
  1936. create table informix.syssqlcacheprof { Internal Use Only }
  1937. (
  1938. id integer, { cache id }
  1939. name char(128), { Cache Name }
  1940. hits int8, { # of times item found in cache }
  1941. misses int8, { # of times retrieved from disk}
  1942. removed int8, { # of times an item is remove }
  1943. mem_used int, { Used memory by cache }
  1944. mem_free int, { Unused memory by cache }
  1945. total_entries int, { total # of entries in cache }
  1946. inuse_entries int { # of entries in use by cache }
  1947. );
  1948. create unique index informix.syssqlcacheprofidx on syssqlcacheprof (id);
  1949. revoke all on informix.syssqlcacheprof from public as informix;
  1950. grant select on informix.syssqlcacheprof to public as informix;
  1951. { SQL state and statement }
  1952. create table informix.syssqlstat { Internal Use Only }
  1953. (
  1954. sqs_sessionid integer, { session id }
  1955. sqs_dbname char(128), { database name }
  1956. sqs_iso smallint, { Isolation level }
  1957. sqs_lockmode smallint, { lock mode }
  1958. sqs_sqlerror smallint, { sql error of last SQL stmt }
  1959. sqs_isamerror smallint, { isam error of last SQL stmt }
  1960. sqs_feversion char(4), { FE Version }
  1961. sqs_statement char(200) { last SQL statement }
  1962. );
  1963. revoke all on informix.syssqlstat from public as informix;
  1964. { LRU buffers }
  1965. create table informix.syslrus
  1966. (
  1967. bpoolindx smallint, { Bufferpool index }
  1968. lru_num int, { Number of Lru Queue }
  1969. lru_nfree int, { Free Buffers in Lru Queue }
  1970. lru_nmod int { Modified Buffers in Lru Queue }
  1971. );
  1972. create unique index informix.syslrusix1 on syslrus(bpoolindx, lru_num);
  1973. revoke all on informix.syslrus from public as informix;
  1974. grant select on informix.syslrus to public as informix;
  1975. { Checkpoint history }
  1976. create table informix.syscheckpoint
  1977. (
  1978. intvl int, {checkpoint interval }
  1979. type char(12), {checkpoint type }
  1980. caller char(10), {caller }
  1981. clock_time int, {time of day of ckpt }
  1982. crit_time float, {time spent in wait4critex }
  1983. flush_time float, {time spent flushing pages to disk }
  1984. cp_time float, {time from cpkt_pending to done }
  1985. n_dirty_buffs int, {number of dirty buffers }
  1986. plogs_per_sec int, {avg # pages plogged }
  1987. llogs_per_sec int, {avg # pages logged }
  1988. dskflush_per_sec int, {avg # pages dskflushed }
  1989. ckpt_logid int, {LSN of ckpt }
  1990. ckpt_logpos int, {LSN of ckpt }
  1991. physused int, {total pages plogged in ckpt }
  1992. logused int, {total pages llogged in ckpt }
  1993. n_crit_waits int, { # of crit section waiters }
  1994. tot_crit_wait float, {total time spent waiting for crit }
  1995. longest_crit_wait float, {longest crit wait }
  1996. block_time float {blocked time }
  1997. );
  1998. revoke all on informix.syscheckpoint from public as informix;
  1999. grant select on informix.syscheckpoint to public as informix;
  2000. { network IO Information }
  2001. create table informix.sysnetworkio
  2002. (
  2003. net_id int, { Net ID }
  2004. sid int, { session id }
  2005. net_netscb int8, { address of netscb }
  2006. net_client_type int, { client type }
  2007. net_client_name char(12), { client protocal name }
  2008. net_read_cnt int8, { number of read operations }
  2009. net_read_bytes int8, { # of bytes txfr to server }
  2010. net_write_cnt int8, { number of write operations }
  2011. net_write_bytes int8, { # of bytes txfr to client }
  2012. net_open_time int, { time connection was made }
  2013. net_last_read int, { time of last network read }
  2014. net_last_write int, { time of last network write }
  2015. net_state int, { state of network connection }
  2016. net_options int, { sqlhost options }
  2017. net_prot_id int, { id for protocal name }
  2018. net_protocol char(10), { prtocal name }
  2019. net_server_fd int, { poll server fd }
  2020. net_poll_thread int { poll thread id }
  2021. );
  2022. create unique index informix.sysnetworkio1 on sysnetworkio(net_id);
  2023. revoke all on informix.sysnetworkio from public as informix;
  2024. grant select on informix.sysnetworkio to public as informix;
  2025. create table informix.sysnetglobal { Internal Use Only }
  2026. (
  2027. ng_reads int8, { Number of network reads }
  2028. ng_writes int8, { Number of network writes }
  2029. ng_his_read_count int8, { Network reads by discon users }
  2030. ng_his_write_count int8, { Network writes by discon users }
  2031. ng_his_reads_bytes int8, { Amount of data txfr by discon users }
  2032. ng_his_writes_bytes int8, { Amount of data txfr by discon users }
  2033. ng_connects int8, { Number of connections }
  2034. ng_num_netscbs int, { Number of netscbs }
  2035. ng_max_netscbs int, { Max number of netscbs }
  2036. ng_free_thres int, { Free threshold }
  2037. ng_free_cnt int, { Free count }
  2038. ng_wait_thres int, { Wait threshold }
  2039. ng_wait_cnt int, { Wait count }
  2040. ng_pvt_thres int, { }
  2041. ng_netbuf_size int, { Network buffer size }
  2042. ng_buf_alloc int, { }
  2043. ng_buf_alloc_max int, { }
  2044. ng_netscb_id int { Next netscb id }
  2045. );
  2046. revoke all on informix.sysnetglobal from public as informix;
  2047. grant select on informix.sysnetglobal to public as informix;
  2048. create table informix.sysnetclienttype { Internal Use Only }
  2049. (
  2050. nc_cons_allowed int, { Are connections allowed }
  2051. nc_accepted int, { Number of connections }
  2052. nc_rejected int, { Number of cons rejected }
  2053. nc_reads int8, { Number of network reads }
  2054. nc_writes int8, { Number of network writes }
  2055. nc_name char(18) { Name }
  2056. );
  2057. revoke all on informix.sysnetclienttype from public as informix;
  2058. grant select on informix.sysnetclienttype to public as informix;
  2059. { system environment variable }
  2060. create table informix.sysenv
  2061. (
  2062. env_id integer, { unique numeric identifier }
  2063. env_name char(128), { env. variable name }
  2064. env_value char(512) { env. variable value }
  2065. );
  2066. create unique index informix.sysenvix1 on sysenv(env_id);
  2067. revoke all on informix.sysenv from public as informix;
  2068. grant select on informix.sysenv to public as informix;
  2069. { session environment variable }
  2070. create table informix.sysenvses
  2071. (
  2072. envses_sid integer, { session id }
  2073. envses_id integer, { env. variable identifier }
  2074. envses_name char(128), { env. variable name }
  2075. envses_value char(512) { env. variable value }
  2076. );
  2077. create unique index informix.sysenvsesix1 on sysenvses(envses_sid, envses_id);
  2078. revoke all on informix.sysenvses from public as informix;
  2079. grant select on informix.sysenvses to public as informix;
  2080. { online log }
  2081. create table informix.sysonlinelog
  2082. (
  2083. offset int8, { file offset }
  2084. next_offset int8, { file offset to next msg }
  2085. line char(4096) { message file line }
  2086. );
  2087. create unique index informix.sysonlinelogix1 on sysonlinelog(offset);
  2088. revoke all on informix.sysonlinelog from public as informix;
  2089. grant select on informix.sysonlinelog to public as informix;
  2090. { bar act log }
  2091. create table informix.sysbaract_log
  2092. (
  2093. offset int8, { file offset }
  2094. next_offset int8, { file offset to next msg }
  2095. line char(4096) { message file line }
  2096. );
  2097. create unique index informix.sysbaract_logix1 on sysbaract_log(offset);
  2098. revoke all on informix.sysbaract_log from public as informix;
  2099. grant select on informix.sysbaract_log to public as informix;
  2100. { Index page logging status at source server}
  2101. create table informix.sysipl
  2102. (
  2103. ipl_status integer,{ Index page logging status }
  2104. ipl_time integer {time at which index page logging was enabled}
  2105. );
  2106. revoke all on informix.sysipl from public as informix;
  2107. grant select on informix.sysipl to public as informix;
  2108. { SMX connection information}
  2109. create table informix.syssmx
  2110. (
  2111. address int8,{ SMX pipe address }
  2112. name char(128), {Target server name}
  2113. encryption_status char(20), {Enabled/Disabled}
  2114. buffers_sent integer,{ Number of buffers sent }
  2115. buffers_recv integer,{ Number of buffers received }
  2116. bytes_sent int8,{ Number of bytes sent }
  2117. bytes_recv int8,{ Number of bytes received }
  2118. reads integer,{ Number of read calls}
  2119. writes integer,{ Number of write calls}
  2120. retries integer{ Number of write call retries }
  2121. );
  2122. revoke all on informix.syssmx from public as informix;
  2123. grant select on informix.syssmx to public as informix;
  2124. { SMX session information}
  2125. create table informix.syssmxses
  2126. (
  2127. name char(128), {Target server name}
  2128. address int8,{ SMX session address }
  2129. client_type char(20),{ SMX client type }
  2130. reads integer,{ Number of read calls }
  2131. writes integer{ Number of write calls }
  2132. );
  2133. revoke all on informix.syssmxses from public as informix;
  2134. grant select on informix.syssmxses to public as informix;
  2135. {RSS Server related statistics at RSS primary server}
  2136. create table informix.syssrcrss
  2137. (
  2138. address int8,{ RSS control block address }
  2139. server_name char(128), {Database server name}
  2140. server_status char(20), {Quiescent/Active/Inactive}
  2141. connection_status char(20), {Connected/Disconnected}
  2142. log_transmission_status char(20), {Active/Blocked}
  2143. next_page_tosend_log_uniq integer,{log unique id of next page to send }
  2144. next_page_tosend_log_page integer,{page number of next page to send}
  2145. seq_tosend integer, {Sequence id of last buffer sent}
  2146. last_seq_acked integer {Sequence id of last buffer acked}
  2147. );
  2148. revoke all on informix.syssrcrss from public as informix;
  2149. grant select on informix.syssrcrss to public as informix;
  2150. {RSS Server related statistics at RSS server}
  2151. create table informix.systrgrss
  2152. (
  2153. address int8, { RSS control block address }
  2154. source_server char(128), {Source server serving the RSS server}
  2155. connection_status char(20), {Connected/Disconnected}
  2156. last_received_log_uniq integer, {log unique id of last log page received}
  2157. last_received_log_page integer, {page number of last log page received}
  2158. last_seq_received integer, {Sequence id of last buffer received}
  2159. last_seq_acked integer {Sequence id of last buffer acked}
  2160. );
  2161. revoke all on informix.systrgrss from public as informix;
  2162. grant select on informix.systrgrss to public as informix;
  2163. {Log capture information for RSS server at RSS primary server}
  2164. create table informix.sysrsslog
  2165. (
  2166. server_name char(128), { Server name }
  2167. from_cache integer,{Total pages read from cache}
  2168. from_disk integer,{Total pages read from disk}
  2169. logpages_tossed integer {Total number of log pages not written to log buffer cache}
  2170. );
  2171. revoke all on informix.sysrsslog from public as informix;
  2172. grant select on informix.sysrsslog to public as informix;
  2173. {SDS related statistics at source server}
  2174. create table informix.syssrcsds
  2175. (
  2176. address int8,{ SDS server control block address }
  2177. server_name char(128), {Database server name}
  2178. server_status char(20), {Quiescent/Active/Inactive}
  2179. connection_status char(20), {Connected/Disconnected}
  2180. last_sent_log_uniq integer,{log unique id of last page to sent }
  2181. last_sent_logpage integer,{page number of last page to sent}
  2182. last_flushed_log_uniq integer,{log unique id of last page flushed }
  2183. last_flushed_logpage integer,{page number of last page flushed}
  2184. last_acked_lsn_uniq integer,{log unique id of last LSN acked}
  2185. last_acked_lsn_pos integer,{log position of last LSN acked}
  2186. seq_tosend integer, {Sequence id of next buffer to send}
  2187. last_seq_acked integer, {Sequence id of last buffer acked}
  2188. timeof_lastack integer, {time of last LSN acked}
  2189. totallsn_posted integer, {total LSNs posted}
  2190. totallsn_sent integer, {total LSNs sent}
  2191. totalpageflush_posted integer, {total page flush buffers posted}
  2192. totalpageflush_sent integer {total page flush buffers sent}
  2193. );
  2194. revoke all on informix.syssrcsds from public as informix;
  2195. grant select on informix.syssrcsds to public as informix;
  2196. {SDS related statistics at SDS server}
  2197. create table informix.systrgsds
  2198. (
  2199. address int8, { SDS server control block address }
  2200. source_server char(128), {Source server serving the SDS server}
  2201. connection_status char(20), {Connected/Disconnected}
  2202. last_received_log_uniq integer, {log unique id of last log page received
  2203. }
  2204. last_received_log_page integer, {page number of last log page received}
  2205. next_lpgtoread_log_uniq integer, {log unique id of next log page to read}
  2206. next_lpgtoread_log_page integer, {page number of next log page to read}
  2207. last_acked_lsn_uniq integer,{log unique id of last LSN acked}
  2208. last_acked_lsn_pos integer,{log position of last LSN acked}
  2209. last_seq_received integer, {Sequence id of last buffer received}
  2210. last_seq_acked integer, {Sequence id of last buffer acked}
  2211. cur_pagingfile char(640), {current paging file name}
  2212. cur_pagingfile_size int8, {current paging file size}
  2213. old_pagingfile char(640), {old paging file name}
  2214. old_pagingfile_size int8 {old paging file size}
  2215. );
  2216. revoke all on informix.systrgsds from public as informix;
  2217. grant select on informix.systrgsds to public as informix;
  2218. {Cluster related statistics}
  2219. create table informix.syscluster
  2220. (
  2221. name char(128), { node name }
  2222. role char(1), { primary/secondary role }
  2223. syncmode char(8), { sync/async }
  2224. nodetype char(8), { HDR/RSS/SDS ? }
  2225. supports_updates char(1), { updatable }
  2226. server_status char(32), { current status of node }
  2227. connection_status char(32), { current connection status }
  2228. delayed_apply integer, { time delay of apply }
  2229. stop_apply char(24), { stop apply value }
  2230. logid_sent integer, { unique log id of last log page sent}
  2231. logpage_sent integer, { page number of last log page sent }
  2232. logid_acked integer, { unique log id of last ACK }
  2233. logpage_acked integer, { page number of last ACK }
  2234. ack_time datetime year to second, { time of last ACK }
  2235. sdscycle integer, { sds cycle number }
  2236. sdscycle_acked integer
  2237. );
  2238. revoke all on informix.syscluster from public as informix;
  2239. grant select on informix.syscluster to public as informix;
  2240. {stream of replication statistics}
  2241. create table informix.sysrepstats(
  2242. repstats_type integer, { Event class id }
  2243. repstats_subtype integer, { Sub event id}
  2244. repstats_time integer, { Time at which event was fired}
  2245. repstats_ver integer, { Version number for event data}
  2246. repstats_desc lvarchar { Event data }
  2247. );
  2248. revoke all on informix.sysrepstats from public as informix;
  2249. grant select on informix.sysrepstats to public as informix;
  2250. grant insert on informix.sysrepstats to public as informix;
  2251. {register for replication event stream }
  2252. create table informix.sysrepevtreg(
  2253. evt_bitmap integer, {Event class id bitmap }
  2254. evt_timeout integer, {Maximum time that client can wait for event data}
  2255. evt_hwm integer, {Pending event list high water mark }
  2256. evt_info char(256) {Event information. Not yet implemented}
  2257. );
  2258. revoke all on informix.sysrepevtreg from public as informix;
  2259. grant insert on informix.sysrepevtreg to public as informix;
  2260. { HA server type }
  2261. create table informix.sysha_type
  2262. (
  2263. ha_type int,
  2264. ha_primary char(128 ),
  2265. ha_secondary char(128 )
  2266. );
  2267. revoke all on informix.sysha_type from public as informix;
  2268. grant select on informix.sysha_type to public as informix;
  2269. { HA server latency information }
  2270. create table informix.sysha_lagtime
  2271. (
  2272. lt_secondary char (128),
  2273. lt_time_last_update int,
  2274. lt_lagtime_1 float,
  2275. lt_lagtime_2 float,
  2276. lt_lagtime_3 float,
  2277. lt_lagtime_4 float,
  2278. lt_lagtime_5 float,
  2279. lt_lagtime_6 float,
  2280. lt_lagtime_7 float,
  2281. lt_lagtime_8 float,
  2282. lt_lagtime_9 float,
  2283. lt_lagtime_10 float,
  2284. lt_lagtime_11 float,
  2285. lt_lagtime_12 float,
  2286. lt_lagtime_13 float,
  2287. lt_lagtime_14 float,
  2288. lt_lagtime_15 float,
  2289. lt_lagtime_16 float,
  2290. lt_lagtime_17 float,
  2291. lt_lagtime_18 float,
  2292. lt_lagtime_19 float,
  2293. lt_lagtime_20 float
  2294. );
  2295. revoke all on informix.sysha_lagtime from public as informix;
  2296. grant select on informix.sysha_lagtime to public as informix;
  2297. { HA server workload information }
  2298. create table informix.sysha_workload
  2299. (
  2300. wl_secondary char (128),
  2301. wl_time_last_update int,
  2302. wl_ttype char(12),
  2303. wl_workload_1 float,
  2304. wl_workload_2 float,
  2305. wl_workload_3 float,
  2306. wl_workload_4 float,
  2307. wl_workload_5 float,
  2308. wl_workload_6 float,
  2309. wl_workload_7 float,
  2310. wl_workload_8 float,
  2311. wl_workload_9 float,
  2312. wl_workload_10 float,
  2313. wl_workload_11 float,
  2314. wl_workload_12 float,
  2315. wl_workload_13 float,
  2316. wl_workload_14 float,
  2317. wl_workload_15 float,
  2318. wl_workload_16 float,
  2319. wl_workload_17 float,
  2320. wl_workload_18 float,
  2321. wl_workload_19 float,
  2322. wl_workload_20 float
  2323. );
  2324. revoke all on informix.sysha_workload from public as informix;
  2325. grant select on informix.sysha_workload to public as informix;
  2326. { Connection Manager }
  2327. create table informix.syscmsmtab
  2328. (
  2329. address int8, { CM address }
  2330. sid integer, { CM session id }
  2331. name char(128), { CM name }
  2332. host char(256), { host name }
  2333. flag integer { Arbitrator flag }
  2334. );
  2335. revoke all on informix.syscmsmtab from public as informix;
  2336. grant select on informix.syscmsmtab to public as informix;
  2337. create table informix.syscmsmunit
  2338. (
  2339. address int8, { CM cluster address }
  2340. sid integer, { CM session id }
  2341. unit char(128), { unit name }
  2342. type char(128), { unit type }
  2343. servers char(1024), { unit servers }
  2344. foc char(1024), { FOC define }
  2345. flag integer { Arbitrator flag }
  2346. );
  2347. revoke all on informix.syscmsmunit from public as informix;
  2348. grant select on informix.syscmsmunit to public as informix;
  2349. create table informix.syscmsmsla
  2350. (
  2351. address int8, { CMSLA address }
  2352. sid integer, { CM session id }
  2353. unit char(128), { cluster name }
  2354. sla_name char(128), { SLA name }
  2355. sla_define char(1024), { SLA define }
  2356. connections integer { redirected connections}
  2357. );
  2358. revoke all on informix.syscmsmsla from public as informix;
  2359. grant select on informix.syscmsmsla to public as informix;
  2360. { dual table }
  2361. create table informix.sysdual
  2362. (
  2363. dummy char(1)
  2364. );
  2365. revoke all on informix.sysdual from public as informix;
  2366. grant select on informix.sysdual to public as informix;
  2367. { sqlhosts }
  2368. create table informix.syssqlhosts
  2369. (
  2370. dbsvrnm char(129),
  2371. nettype char(17),
  2372. svrtype char(9),
  2373. netprot char(9),
  2374. hostname char(257),
  2375. svcname char(129),
  2376. options char(257),
  2377. svrsecurity smallint,
  2378. clntsecurity smallint,
  2379. netoptions smallint,
  2380. netbuf_size integer,
  2381. connmux_option smallint,
  2382. svrgroup char(129),
  2383. endofgroup char(129),
  2384. redirector smallint,
  2385. svrid integer,
  2386. pamauth integer,
  2387. authtoken char(256)
  2388. );
  2389. revoke all on informix.syssqlhosts from public as informix;
  2390. grant select on informix.syssqlhosts to public as informix;
  2391. create table informix.syslicenseinfo { Internal Use Only }
  2392. (
  2393. version char(12), { IDS version }
  2394. week smallint, { Week of the information }
  2395. year smallint, { Year of the information }
  2396. max_cpu_vps smallint, { Max number of cpu vps }
  2397. max_vps smallint, { Max number of vps }
  2398. max_conns integer, { Max # of user connected }
  2399. max_sec_conns integer, { Max # of secondary user }
  2400. max_sds_conns integer, { Max # of sds users }
  2401. max_sds_clones smallint, { Max # of sds clones }
  2402. max_rss_clones smallint, { Max # of rss clones }
  2403. total_size integer, { max disk space (MB) }
  2404. total_size_used integer, { max disk space used (MB) }
  2405. max_memory integer, { Max memory allocated (MB) }
  2406. max_memory_used integer, { Max memory used (MB) }
  2407. feature_flags integer, { Feature Flags }
  2408. feature_flags2 integer { Feature Flags2 }
  2409. );
  2410. revoke all on informix.syslicenseinfo from public as informix;
  2411. grant select on informix.syslicenseinfo to public as informix;
  2412. { machine and operating information }
  2413. create table informix.sysmachineinfo
  2414. (
  2415. os_name char(128),
  2416. os_release char(128),
  2417. os_nodename char(128),
  2418. os_version char(128),
  2419. os_machine char(128),
  2420. os_num_procs smallint,
  2421. os_num_olprocs smallint,
  2422. os_pagesize int8,
  2423. os_mem_total int8,
  2424. os_mem_free int8,
  2425. os_open_file_lim int8,
  2426. os_shmmax int8,
  2427. os_shmmin int8,
  2428. os_shmids int8,
  2429. os_shmnumsegs int8,
  2430. os_semmap int8,
  2431. os_semids int8,
  2432. os_semnum int8,
  2433. os_semundo int8,
  2434. os_semnumperid int8,
  2435. os_semops int8,
  2436. os_semundoperproc int8,
  2437. os_semundosize int8,
  2438. os_semmaxvalue int8
  2439. );
  2440. revoke all on informix.sysmachineinfo from public as informix;
  2441. grant select on informix.sysmachineinfo to public as informix;
  2442. { I/O historical information }
  2443. create table informix.sysiohistory
  2444. (
  2445. address bigint,
  2446. gfd int,
  2447. iskaio int,
  2448. open_mode int,
  2449. open_time bigint,
  2450. path char(256),
  2451. minute int,
  2452. time bigint,
  2453. total_read_ops bigint,
  2454. total_read_time float,
  2455. read_ops_minute bigint,
  2456. read_time_minute float,
  2457. avg_read_time_minute float,
  2458. total_write_ops bigint,
  2459. total_write_time float,
  2460. write_ops_minute bigint,
  2461. write_time_minute float,
  2462. avg_write_time_minute float,
  2463. total_lseek_time float,
  2464. lseek_time_minute float
  2465. );
  2466. revoke all on informix.sysiohistory from public as informix;
  2467. grant select on informix.sysiohistory to public as informix;
  2468. { low memory manger information }
  2469. create table syslowmemorymgr
  2470. (
  2471. lmm_memory_limit int8,
  2472. lmm_memory_used int8,
  2473. lmm_start_threshold int8,
  2474. lmm_stop_threshold int8,
  2475. lmm_idle_time int8,
  2476. lmm_thread_id int8,
  2477. lmm_total_killed int8,
  2478. lmm_segments_over int8,
  2479. lmm_kill_active int8,
  2480. lmm_kill_count int8,
  2481. lmm_kill_last_time int8,
  2482. lmm_killall_active int8,
  2483. lmm_killall_count int8,
  2484. lmm_killall_last_time int8,
  2485. lmm_reduce_active int8,
  2486. lmm_reduce_count int8,
  2487. lmm_reduce_last_time int8,
  2488. lmm_restore_active int8,
  2489. lmm_restore_count int8,
  2490. lmm_restore_last_time int8
  2491. );
  2492. revoke all on syslowmemorymgr from public;
  2493. grant select on syslowmemorymgr to public;
  2494. { storage manager operations }
  2495. create table informix.sysstoragemgr
  2496. (
  2497. smgr_id int8, { StorageMGR op id }
  2498. smgr_dbname char(128), { Database name }
  2499. smgr_owner char(32), { Owner name }
  2500. smgr_tabname char(128), { Table name }
  2501. smgr_dblocale char(32), { Database locale }
  2502. smgr_optype int8, { StorageMGR op type }
  2503. smgr_opdesc char(128), { StorageMGR op desc }
  2504. smgr_numrows int8, { # Rows at start of this cmd }
  2505. smgr_numpages int8, { # Pages at start of this cmd }
  2506. smgr_rowsprocessed int8, { # Rows processed }
  2507. smgr_numfrags int8, { # Fragments }
  2508. smgr_fraglist char(1024), { List of fragments }
  2509. smgr_curpartnum int8, { Current partnum }
  2510. smgr_curpage int8, { Current page }
  2511. smgr_currowid int8, { Current rowid }
  2512. smgr_starttime int8, { Start time }
  2513. smgr_elapsedtime int8, { Elapsed time }
  2514. smgr_remainingtime int8, { Estimated time remaining }
  2515. smgr_rowspersec float { # Rows processed per sec }
  2516. );
  2517. revoke all on informix.sysstoragemgr from public as informix;
  2518. grant select on informix.sysstoragemgr to public as informix;
  2519. { SQL History Trace Summary Info }
  2520. create table informix.syssqltrace_info { Internal Use Only }
  2521. (
  2522. flags integer, { sql trace flags }
  2523. ntraces integer, { Number of trace items }
  2524. tracesize integer, { Size of each trace item }
  2525. duration integer, { Trace buffer duration in Sec }
  2526. sqlseen int8, { sql process by trace buffer }
  2527. starttime integer, { start time of the trace buffer }
  2528. memoryused int8 { Memory used by SQL tracing }
  2529. );
  2530. revoke all on informix.syssqltrace_info from public as informix;
  2531. { SQL History Trace }
  2532. create table informix.syssqltrace
  2533. (
  2534. sql_id int8,
  2535. sql_address int8,
  2536. sql_sid int,
  2537. sql_uid int,
  2538. sql_stmttype int,
  2539. sql_stmtname char(40),
  2540. sql_finishtime int,
  2541. sql_begintxtime int,
  2542. sql_runtime float,
  2543. sql_pgreads int,
  2544. sql_bfreads int,
  2545. sql_rdcache float,
  2546. sql_bfidxreads int,
  2547. sql_pgwrites int,
  2548. sql_bfwrites int,
  2549. sql_wrcache float,
  2550. sql_lockreq int,
  2551. sql_lockwaits int,
  2552. sql_lockwttime float,
  2553. sql_logspace int,
  2554. sql_sorttotal int,
  2555. sql_sortdisk int,
  2556. sql_sortmem int,
  2557. sql_executions int,
  2558. sql_totaltime float,
  2559. sql_avgtime float,
  2560. sql_maxtime float,
  2561. sql_numiowaits int,
  2562. sql_avgiowaits float,
  2563. sql_totaliowaits float,
  2564. sql_rowspersec float,
  2565. sql_estcost int,
  2566. sql_estrows int,
  2567. sql_actualrows int,
  2568. sql_sqlerror int,
  2569. sql_isamerror int,
  2570. sql_isollevel int,
  2571. sql_sqlmemory int,
  2572. sql_numiterators int,
  2573. sql_database char(128),
  2574. sql_numtables int,
  2575. sql_tablelist char(4096),
  2576. sql_statement char(16000),
  2577. sql_stmtlen int,
  2578. sql_stmthash int8,
  2579. sql_pdq smallint,
  2580. sql_num_hvars smallint,
  2581. sql_dbspartnum int,
  2582. sql_aqt char(40), { AQT name if matching succeeded }
  2583. sql_aqtinfo int { > 0 : AQT matching / offloading time
  2584. < 0 : matching / offloading error code
  2585. = 0 : no matching }
  2586. );
  2587. revoke all on informix.syssqltrace from public as informix;
  2588. create unique index informix.syssqltrace_idx1 on syssqltrace(sql_id DESC);
  2589. create unique index informix.syssqltrace_idx2 on syssqltrace(sql_address DESC);
  2590. { SQL History Trace iterator list}
  2591. create table informix.syssqltrace_iter
  2592. (
  2593. sql_id int8,
  2594. sql_address int8,
  2595. sql_itr_address int8,
  2596. sql_itr_id int,
  2597. sql_itr_left int,
  2598. sql_itr_right int,
  2599. sql_itr_cost int,
  2600. sql_itr_estrows int,
  2601. sql_itr_numrows int,
  2602. sql_itr_type int,
  2603. sql_itr_misc int,
  2604. sql_itr_info char(256),
  2605. sql_itr_time float,
  2606. sql_itr_partnum int,
  2607. sql_itr_sender int,
  2608. sql_itr_nxtsender int
  2609. );
  2610. revoke all on informix.syssqltrace_iter from public as informix;
  2611. create index informix.syssqltrace_iter_idx1 on
  2612. syssqltrace_iter(sql_id DESC);
  2613. create index informix.syssqltrace_iter_idx2 on
  2614. syssqltrace_iter(sql_address DESC);
  2615. { SQL History Trace Host Variables list}
  2616. create table informix.syssqltrace_hvar
  2617. (
  2618. sql_id int8,
  2619. sql_address int8,
  2620. sql_hvar_id int,
  2621. sql_hvar_flags int,
  2622. sql_hvar_typeid int,
  2623. sql_hvar_xtypeid int,
  2624. sql_hvar_ind int,
  2625. sql_hvar_type char(128),
  2626. sql_hvar_data char(8192)
  2627. );
  2628. revoke all on informix.syssqltrace_hvar from public as informix;
  2629. create index informix.syssqltrace_hvar_idx1 on
  2630. syssqltrace_hvar(sql_id DESC);
  2631. create index informix.syssqltrace_hvar_idx2 on
  2632. syssqltrace_hvar(sql_address DESC);
  2633. { session applicaiton variables }
  2634. create table informix.syssesappinfo
  2635. (
  2636. sesapp_sid integer, { session id }
  2637. sesapp_name char(128), { appl variable name }
  2638. sesapp_value char(512) { appl variable value }
  2639. );
  2640. create index informix.sysesesapp_idx1 on syssesappinfo(sesapp_sid DESC);
  2641. revoke all on informix.syssesappinfo from public as informix;
  2642. grant select on informix.syssesappinfo to public as informix;
  2643. { Shared memory values }
  2644. create table informix.sysshmvals
  2645. (
  2646. sh_mode int, { turbo mode number }
  2647. sh_boottime int, { boot time of day }
  2648. sh_pfclrtime int, { time profilers were last clr }
  2649. sh_curtime int, { current mt_time }
  2650. sh_bootstamp int, { boot time stamp }
  2651. sh_stamp int, { current time stamp }
  2652. sh_mainlooptcb int8, { address of main daemon thread }
  2653. sh_sysflags int, { system operating flags }
  2654. sh_maxchunks int, { size of chunk table }
  2655. sh_maxdbspaces int, { size of dbspace table }
  2656. sh_maxuserthreads int, { max # of user structures }
  2657. sh_maxtrans int, { max # of trans structures }
  2658. sh_maxlocks int, { # of locks total }
  2659. sh_maxlogs int, { size of log table }
  2660. sh_nbuffs int, { # of buffers total }
  2661. sh_pagesize int, { buffer size in bytes }
  2662. sh_nlrus int, { # of lru queues }
  2663. sh_maxdirty float, { LRU can have this % dirty pages }
  2664. sh_mindirty float, { LRU has % dirty pages after clean }
  2665. sh_ncleaners int, { # of cleaning/flushing procs }
  2666. sh_longtx int, { the long transaction flag }
  2667. sh_optstgbsnum int, { Subsystem Staging Blobspace }
  2668. sh_cpflag int, { TRUE => doing checkpoint }
  2669. sh_rapages int, { Number of pages to read ahead }
  2670. sh_rathreshold int, { When to start next read ahead }
  2671. sh_lastlogfreed int, { last log (id) written to tape }
  2672. sh_rmdlktout int, { max timeout when distributed }
  2673. sh_narchivers int, { number of active archives }
  2674. sh_maxpdqpriority int, { max pdqpriority }
  2675. sh_curmaxcons int, { max #connections in this run }
  2676. sh_ovlmaxcons int { max #connections since server init }
  2677. );
  2678. revoke all on informix.sysshmvals from public as informix;
  2679. grant select on informix.sysshmvals to public as informix;
  2680. { MGM Info }
  2681. create table informix.sysmgminfo { Internal Use Only }
  2682. (
  2683. max_priority integer, { max pdqpriority allowed }
  2684. max_query integer, { max # of active queries allowed }
  2685. active integer, { # of active mgm queries }
  2686. ready integer, { # of ready mgm queries }
  2687. early_act_cnt integer, { # of queries activate early }
  2688. total_mem integer, { Total mgm memory }
  2689. avail_mem integer, { Free mgm memory }
  2690. quantum_mem integer, { mgm memory quantum }
  2691. ds_query_mem integer, { non-pdq query memory }
  2692. total_seq integer, { Total number of sequential scans }
  2693. avail_seq integer, { Unused sequential scans }
  2694. quantum_seq integer, { sequential scans quantum }
  2695. min_free_mem integer, { min free mgm memory }
  2696. avg_free_mem float, { avg free mgm memory }
  2697. std_free_mem float, { std free mgm memory }
  2698. min_free_seq integer, { min free mgm sequential scans }
  2699. avg_free_seq float, { avg free mgm sequential scans }
  2700. std_free_seq float, { std free mgm sequential scans }
  2701. max_active integer, { max active mgm sql operations }
  2702. cnt_active integer, { number of active mgm sql operations }
  2703. avg_active float, { max active mgm sql operations }
  2704. std_active float, { std active mgm sql operations }
  2705. max_ready integer, { max ready mgm sql operations }
  2706. cnt_ready integer, { number of ready mgm sql operations }
  2707. avg_ready float, { avg ready mgm sql operations }
  2708. std_ready float { std ready mgm sql operations }
  2709. );
  2710. revoke all on informix.sysmgminfo from public as informix;
  2711. { MGM Gates }
  2712. create table informix.sysmgmgates { Internal Use Only }
  2713. (
  2714. gate_no integer, { gate number }
  2715. gate_name char(12), { gate name }
  2716. gate_wait_cnt integer { number of queries waiting at gate }
  2717. );
  2718. revoke all on informix.sysmgmgates from public as informix;
  2719. create unique index informix.sysmgmgatesidx on sysmgmgates(gate_no);
  2720. { MGM Queries }
  2721. create table informix.sysmgmquery { Internal Use Only }
  2722. (
  2723. address int8, { address of query }
  2724. sid integer, { session id }
  2725. tid integer, { thread id }
  2726. gate integer, { Gate # at which query is waiting }
  2727. priority integer, { priority of query }
  2728. granted_mem integer, { memory currently granted }
  2729. reserved_mem integer, { memory reserved }
  2730. granted_seq integer, { # of scan threads currently used }
  2731. reserved_seq integer { # of scan threads allocated }
  2732. );
  2733. revoke all on informix.sysmgmquery from public as informix;
  2734. { C2 Audit info }
  2735. create table informix.sysadtinfo { Internal Use Only }
  2736. (
  2737. adtmode integer, { Current audit level }
  2738. adterr integer, { Action on errors }
  2739. adtsize integer, { Max size of audit trail }
  2740. adtpath char(256), { Dir to send audit records to }
  2741. adtfile integer, { File within dir to write to }
  2742. adtrows integer { granularity to audit - regular}
  2743. { or FGA }
  2744. );
  2745. revoke all on informix.sysadtinfo from public as informix;
  2746. grant select(adtrows) on informix.sysadtinfo to public as informix;
  2747. { C2 Audit call }
  2748. create table informix.syscrtadt { Internal Use Only }
  2749. (
  2750. event integer, { Event to audit }
  2751. result integer, { Success or Failure }
  2752. data char(256) { Additional data to audit }
  2753. );
  2754. revoke all on informix.syscrtadt from public as informix;
  2755. {Proxy Distributor information}
  2756. create table informix.sysproxydistributors
  2757. (
  2758. node_name char(128), {Name of connected node}
  2759. proxy_id integer, {Proxy distributor ID}
  2760. transaction_count integer, {Number of transactions currently being processed}
  2761. hot_row_total integer {Total number of hot rows ever handled by the distributor}
  2762. );
  2763. revoke all on informix.sysproxydistributors from public as informix;
  2764. grant select on informix.sysproxydistributors to public as informix;
  2765. {Proxy Agent information}
  2766. create table informix.sysproxyagents
  2767. (
  2768. tid integer, {ID of the proxy agent thread}
  2769. flags integer, {flags of thread}
  2770. proxy_id integer, {Proxy distributor ID}
  2771. source_session_id integer, {ID of session on source node}
  2772. proxy_txn_id integer, {Number of current transaction}
  2773. current_seq integer, {Sequence number of current operation}
  2774. sqlerrno smallint, {SQL error number}
  2775. iserrno smallint {ISAM/RSAM error number}
  2776. );
  2777. revoke all on informix.sysproxyagents from public as informix;
  2778. grant select on informix.sysproxyagents to public as informix;
  2779. {Proxy Session Information}
  2780. create table informix.sysproxysessions
  2781. (
  2782. session_id integer, {Proxy session ID}
  2783. proxy_id integer, {Proxy distributor ID}
  2784. proxy_tid integer, {ID of the proxy agent thread}
  2785. proxy_txn_id integer, {Number of current transaction}
  2786. current_seq integer, {Sequence number of current operation}
  2787. pending_ops integer, {Number of pending operations}
  2788. reference_count integer {Reference count}
  2789. );
  2790. revoke all on informix.sysproxysessions from public as informix;
  2791. grant select on informix.sysproxysessions to public as informix;
  2792. {Proxy transactions information}
  2793. create table informix.sysproxytxns
  2794. (
  2795. proxy_id integer, {Proxy distributor ID}
  2796. proxy_txn_id integer, {Number of current transaction}
  2797. reference_count integer, {Reference count}
  2798. pending_ops integer, {Number of pending operations}
  2799. proxy_sid integer {}
  2800. );
  2801. revoke all on informix.sysproxytxns from public as informix;
  2802. grant select on informix.sysproxytxns to public as informix;
  2803. {Proxy transaction operations information}
  2804. create table informix.sysproxytxnops
  2805. (
  2806. proxy_id integer, {Proxy distributor ID}
  2807. proxy_txn_id integer, {Number of current transaction}
  2808. sequence_number integer, {Sequence number of current operation}
  2809. operation_type CHAR(10), {Type of operation}
  2810. rowidn integer, {Row ID}
  2811. table CHAR(128), {Table name}
  2812. sqlerrno smallint {SQL error number}
  2813. );
  2814. revoke all on informix.sysproxytxnops from public as informix;
  2815. grant select on informix.sysproxytxnops to public as informix;
  2816. { file information }
  2817. create table informix.sysfileinfo
  2818. (
  2819. fileid integer,
  2820. directory char(256),
  2821. filename char(256),
  2822. version char(256),
  2823. fullname char(512)
  2824. );
  2825. create index informix.sysfileinfo_idx1 on sysfileinfo (fileid);
  2826. revoke all on informix.sysfileinfo from public as informix;
  2827. grant select on informix.sysfileinfo to public as informix;
  2828. { AQTs }
  2829. create table informix.sysaqt
  2830. (
  2831. aqt char(40), { AQT name }
  2832. aqttabid integer, { AQT tabid }
  2833. dbname char(128), { database name }
  2834. dwa char(128), { DWA instance name }
  2835. factid integer, { tabid of fact table }
  2836. ntab integer, { number of tables in AQT }
  2837. matched integer, { number of times AQT has been matched }
  2838. enabled char(1), { AQT is enabled (1) or disabled (0) }
  2839. virtual char(1) { AQT is virtual (1) or not (0) }
  2840. );
  2841. revoke all on informix.sysaqt from public as informix;
  2842. grant select on informix.sysaqt to public as informix;
  2843. { AQT join predicates }
  2844. create table informix.sysaqtjp
  2845. (
  2846. aqt char(40), { AQT name }
  2847. dbname char(128), { database name }
  2848. jd integer, { join descriptor sequence number }
  2849. jp integer, { join predicate sequence number }
  2850. side char(1), { side: left (L) or right (R) }
  2851. tabid integer, { tabid of table }
  2852. colno integer, { column number of column }
  2853. alias char(128) { table alias in AQT definition }
  2854. );
  2855. revoke all on informix.sysaqtjp from public as informix;
  2856. grant select on informix.sysaqtjp to public as informix;
  2857. { DWA probe tables }
  2858. create table informix.sysprobetables
  2859. (
  2860. dbname char(128), { database name }
  2861. sql_id int8, { statement id in syssqltrace }
  2862. tabid integer, { table id }
  2863. fact char(1) { table is fact table (y/n) }
  2864. );
  2865. revoke all on informix.sysprobetables from public as informix;
  2866. grant select on informix.sysprobetables to public as informix;
  2867. { DWA probe columns }
  2868. create table informix.sysprobecolumns
  2869. (
  2870. dbname char(128), { database name }
  2871. sql_id int8, { statement id in syssqltrace }
  2872. tabid integer, { table id }
  2873. colno smallint { column number }
  2874. );
  2875. revoke all on informix.sysprobecolumns from public as informix;
  2876. grant select on informix.sysprobecolumns to public as informix;
  2877. { DWA probe join descriptors }
  2878. create table informix.sysprobejds
  2879. (
  2880. dbname char(128), { database name }
  2881. sql_id int8, { statement id in syssqltrace }
  2882. jd integer, { join descriptor sequence number }
  2883. ctabid integer, { child table id }
  2884. ptabid integer, { parent table id }
  2885. type char(1), { join type: inner (i), left outer (l) }
  2886. uniq char(1) { parent table has unique index (y/n) }
  2887. );
  2888. revoke all on informix.sysprobejds from public as informix;
  2889. grant select on informix.sysprobejds to public as informix;
  2890. { DWA probe join predicates }
  2891. create table informix.sysprobejps
  2892. (
  2893. dbname char(128), { database name }
  2894. sql_id int8, { statement id in syssqltrace }
  2895. jd integer, { join descriptor sequence number }
  2896. jp integer, { join predicate sequence number }
  2897. ccolno smallint, { child table column number }
  2898. pcolno smallint { parent table column number }
  2899. );
  2900. revoke all on informix.sysprobejps from public as informix;
  2901. grant select on informix.sysprobejps to public as informix;
  2902. { get info out of catalogs and save it }
  2903. select tabid from systables
  2904. where tabname in (
  2905. 'sysdbspartn', 'systabnames', 'sysrawdsk', 'syspaghdr',
  2906. 'sysslttab', 'syssltdat', 'syschfree', 'sysptnhdr',
  2907. 'sysptnkey', 'sysptnext', 'sysptncol', 'sysptnbit',
  2908. 'sysactptnhdr',
  2909. 'sysrstcb', 'systxptab', 'syslcktab', 'sysbufhdr',
  2910. 'sysdbstab', 'syschktab', 'sysmchktab', 'syschktab_fast',
  2911. 'sysmchktab_fast', 'syslogfil',
  2912. 'sysbtcreq', 'systraces', 'sysptntab', 'sysshmem',
  2913. 'sysshmhdr', 'sysscblst', 'systcblst', 'sysvplst',
  2914. 'systwaits', 'sysdrcb', 'sysadtinfo', 'syscrtadt',
  2915. 'sysmtxlst', 'sysconlst', 'syspoollst', 'sysseglst',
  2916. 'sysdic', 'sysprc', 'sysdsc', 'syssqscb',
  2917. 'syssdblock', 'sysconblock', 'sysopendb', 'syssqlstat',
  2918. 'syslrus', 'sysshmvals', 'sysplog', 'syscompdicts_full', 'syscfgtab',
  2919. 'syscdrs', 'syscdrq', 'syscdrtx', 'syscdrprog',
  2920. 'syscdrsend_txn', 'syscdrack_txn','syscdrctrl_txn', 'syscdrsync_txn',
  2921. 'syscdrrecv_txn', 'syscdrsend_buf','syscdrack_buf', 'syscdrctrl_buf',
  2922. 'syscdrsync_buf', 'syscdrrecv_buf', 'syscdrrecv_stats', 'syscdrlatency', 'syscdrtsapply',
  2923. 'syscdr_rqm', 'sysbufpool', 'syssymtab', 'sysproftab',
  2924. 'syscheckpoint','sysnetworkio', 'sysenv', 'sysenvses', 'sysonlinelog',
  2925. 'sysdual', 'sysmgminfo', 'syssqlcacheprof', 'syssqltrace',
  2926. 'syssqltrace_iter', 'syssqltrace_info', 'sysnetglobal', 'sysnetclienttype',
  2927. 'sysbaract_log', 'sysipl', 'syssmx', 'syssmxses',
  2928. 'syssrcrss', 'systrgrss', 'sysrsslog', 'syssrcsds',
  2929. 'systrgsds', 'sysrepstats', 'syssqlhosts', 'sysha_type',
  2930. 'sysha_lagtime', 'sysha_workload', 'sysxatab', 'sysrepevtreg',
  2931. 'syscmsmtab', 'syscmsmsla', 'syssqltrace_hvar', 'sysmachineinfo',
  2932. 'syslicenseinfo', 'syssesappinfo', 'sysmgmgates', 'sysmgmquery',
  2933. 'sysproxydistributors', 'sysproxyagents', 'sysproxysessions',
  2934. 'sysproxytxns', 'sysproxytxnops', 'syscdr_state', 'syscdr_ddr',
  2935. 'syscdr_nif', 'syscdr_rcv', 'syscdr_atsdir', 'syscdr_risdir',
  2936. 'syscdr_ats', 'syscdr_ris', 'syscdr_rqmstamp', 'syscdr_rqmhandle',
  2937. 'sysstoragemgr', 'sysreorgops', 'sysfileinfo', 'syscdrcntrlqprog',
  2938. 'syscluster', 'syscdrrecvqprog', 'sysaqt', 'sysaqtjp' ,
  2939. 'sysstoragemgr','syslowmemorymgr', 'syscmsmunit',
  2940. 'sysprobetables', 'sysprobecolumns', 'sysprobejds', 'sysprobejps',
  2941. 'sysiohistory' )
  2942. into temp temptabid with no log;
  2943. select * from systables where tabid in (select tabid from temptabid)
  2944. into temp tempsystab with no log;
  2945. select * from syscolumns where tabid in (select tabid from temptabid)
  2946. into temp tempsyscol with no log;
  2947. select * from sysindices where tabid in (select tabid from temptabid)
  2948. into temp tempsysidx with no log;
  2949. select * from systabauth where tabid in (select tabid from temptabid)
  2950. into temp tempsysauth with no log;
  2951. select * from sysobjstate where tabid in (select tabid from temptabid)
  2952. into temp tempsysobj with no log;
  2953. select * from sysblobs where tabid in (select tabid from temptabid)
  2954. into temp tempsysblobs with no log;
  2955. { reset partnums so internally we recognize these as pseudo tables, also
  2956. update nrows to clue in the optimizer }
  2957. update tempsystab set (partnum,nrows) = (257,10) where tabname = 'sysdbspartn';
  2958. update tempsystab set (partnum,nrows) = (1,100000) where tabname = 'sysrawdsk';
  2959. update tempsystab set (partnum,nrows) = (2,100000) where tabname = 'syspaghdr';
  2960. update tempsystab set (partnum,nrows) = (3,1000000) where tabname = 'sysslttab';
  2961. update tempsystab set (partnum,nrows) = (4,1000000) where tabname = 'syssltdat';
  2962. update tempsystab set (partnum,nrows) = (5,100) where tabname = 'syschfree';
  2963. update tempsystab set (partnum,nrows) = (6,100) where tabname = 'syscfgtab';
  2964. update tempsystab set (partnum,nrows) = (7,100000) where tabname = 'syssymtab';
  2965. update tempsystab set (partnum,nrows) = (8,1000000) where tabname = 'sysproftab';
  2966. update tempsystab set (partnum,nrows) = (10,1000) where tabname = 'sysptnhdr';
  2967. update tempsystab set (partnum,nrows) = (11,1000) where tabname = 'sysptnkey';
  2968. update tempsystab set (partnum,nrows) = (12,1000) where tabname = 'sysptnext';
  2969. update tempsystab set (partnum,nrows) = (13,1000) where tabname = 'sysptncol';
  2970. update tempsystab set (partnum,nrows) = (14,10000) where tabname = 'sysptnbit';
  2971. update tempsystab set (partnum,nrows) = (15,1000) where tabname = 'systabnames';
  2972. update tempsystab set (partnum,nrows) = (16,10000) where tabname = 'sysactptnhdr';
  2973. update tempsystab set (partnum,nrows) = (20,100) where tabname = 'sysptntab';
  2974. update tempsystab set (partnum,nrows) = (21,10000) where tabname = 'syslcktab';
  2975. update tempsystab set (partnum,nrows) = (22,1000) where tabname = 'sysbufhdr';
  2976. update tempsystab set (partnum,nrows) = (23,10) where tabname = 'sysdbstab';
  2977. update tempsystab set (partnum,nrows) = (24,10) where tabname = 'syschktab';
  2978. update tempsystab set (partnum,nrows) = (25,10) where tabname = 'sysmchktab';
  2979. update tempsystab set (partnum,nrows) = (26,100) where tabname = 'sysrstcb';
  2980. update tempsystab set (partnum,nrows) = (27,100) where tabname = 'systxptab';
  2981. update tempsystab set (partnum,nrows) = (28,10) where tabname = 'syslogfil';
  2982. update tempsystab set (partnum,nrows) = (29,100) where tabname = 'sysbtcreq';
  2983. update tempsystab set (partnum,nrows) = (30,100) where tabname = 'sysshmem';
  2984. update tempsystab set (partnum,nrows) = (31,100) where tabname = 'sysshmhdr';
  2985. update tempsystab set (partnum,nrows) = (32,1000) where tabname = 'systraces';
  2986. update tempsystab set (partnum,nrows) = (33,1) where tabname = 'sysdrcb';
  2987. update tempsystab set (partnum,nrows) = (34,100) where tabname = 'syslrus';
  2988. update tempsystab set (partnum,nrows) = (35,1) where tabname = 'sysplog';
  2989. update tempsystab set (partnum,nrows) = (36,16) where tabname = 'sysbufpool';
  2990. update tempsystab set (partnum,nrows) = (38,1) where tabname = 'sysshmvals';
  2991. update tempsystab set (partnum,nrows) = (39,10) where tabname = 'syschktab_fast';
  2992. update tempsystab set (partnum,nrows) = (40,100) where tabname = 'sysscblst';
  2993. update tempsystab set (partnum,nrows) = (41,100) where tabname = 'systcblst';
  2994. update tempsystab set (partnum,nrows) = (42,100) where tabname = 'sysvplst';
  2995. update tempsystab set (partnum,nrows) = (43,100) where tabname = 'systwaits';
  2996. update tempsystab set (partnum,nrows) = (44,100000) where tabname = 'sysmtxlst';
  2997. update tempsystab set (partnum,nrows) = (45,1000) where tabname = 'sysconlst';
  2998. update tempsystab set (partnum,nrows) = (46,10000) where tabname = 'syspoollst';
  2999. update tempsystab set (partnum,nrows) = (47,10) where tabname = 'sysseglst';
  3000. update tempsystab set (partnum,nrows) = (48,10) where tabname = 'sysmchktab_fast';
  3001. update tempsystab set (partnum,nrows) = (50,1) where tabname = 'sysmgminfo';
  3002. update tempsystab set (partnum,nrows) = (51,5) where tabname = 'sysmgmgates';
  3003. update tempsystab set (partnum,nrows) = (52,100) where tabname = 'sysmgmquery';
  3004. update tempsystab set (partnum,nrows) = (60,100) where tabname = 'sysdic';
  3005. update tempsystab set (partnum,nrows) = (61,10) where tabname = 'sysprc';
  3006. update tempsystab set (partnum,nrows) = (62,10) where tabname = 'sysdsc';
  3007. update tempsystab set (partnum,nrows) = (63,100) where tabname = 'syssqscb';
  3008. update tempsystab set (partnum,nrows) = (64,1000) where tabname = 'syssdblock';
  3009. update tempsystab set (partnum,nrows) = (65,1000) where tabname = 'sysconblock';
  3010. update tempsystab set (partnum,nrows) = (66,100) where tabname = 'sysopendb';
  3011. update tempsystab set (partnum,nrows) = (68,10) where tabname = 'syssqlcacheprof';
  3012. update tempsystab set (partnum,nrows) = (69,100) where tabname = 'syssqlstat';
  3013. update tempsystab set (partnum,nrows) = (70,100) where tabname = 'syscdrs';
  3014. update tempsystab set (partnum,nrows) = (71,100) where tabname = 'syscdrq';
  3015. update tempsystab set (partnum,nrows) = (72,100) where tabname = 'syscdrtx';
  3016. update tempsystab set (partnum,nrows) = (73,100) where tabname = 'syscdrprog';
  3017. update tempsystab set (partnum,nrows) = (74,100) where tabname = 'syscdrsend_txn';
  3018. update tempsystab set (partnum,nrows) = (75,100) where tabname = 'syscdrack_txn';
  3019. update tempsystab set (partnum,nrows) = (76,100) where tabname = 'syscdrctrl_txn';
  3020. update tempsystab set (partnum,nrows) = (77,100) where tabname = 'syscdrsync_txn';
  3021. update tempsystab set (partnum,nrows) = (78,100) where tabname = 'syscdrrecv_txn';
  3022. update tempsystab set (partnum,nrows) = (79,100) where tabname = 'syscdrsend_buf';
  3023. update tempsystab set (partnum,nrows) = (80,100) where tabname = 'syscdrack_buf';
  3024. update tempsystab set (partnum,nrows) = (81,100) where tabname = 'syscdrctrl_buf';
  3025. update tempsystab set (partnum,nrows) = (82,100) where tabname = 'syscdrsync_buf';
  3026. update tempsystab set (partnum,nrows) = (83,100) where tabname = 'syscdrrecv_buf';
  3027. update tempsystab set (partnum,nrows) = (84, 100) where tabname = 'syscdrrecv_stats';
  3028. update tempsystab set (partnum,nrows) = (85,100) where tabname = 'syscdrlatency';
  3029. update tempsystab set (partnum, nrows) = (86,100) where tabname = 'syscdr_rqm';
  3030. update tempsystab set (partnum, nrows) = (87,12) where tabname = 'syscheckpoint';
  3031. update tempsystab set (partnum, nrows) = (88,100) where tabname = 'sysnetworkio';
  3032. update tempsystab set (partnum, nrows) = (89,100) where tabname = 'sysenv';
  3033. update tempsystab set (partnum, nrows) = (90,100) where tabname = 'sysenvses';
  3034. update tempsystab set (partnum, nrows) = (91,100000) where tabname = 'sysonlinelog';
  3035. update tempsystab set (partnum, nrows) = (92,1) where tabname = 'sysdual';
  3036. update tempsystab set (partnum, nrows) = (93,10000)
  3037. where tabname = 'syssqltrace';
  3038. update tempsystab set (partnum, nrows) = (94,10000)
  3039. where tabname = 'syssqltrace_iter';
  3040. update tempsystab set (partnum, nrows) = (95,50)
  3041. where tabname = 'syssqltrace_info';
  3042. update tempsystab set (partnum, nrows) = (96,1)
  3043. where tabname = 'sysnetglobal';
  3044. update tempsystab set (partnum, nrows) = (97,20)
  3045. where tabname = 'sysnetclienttype';
  3046. update tempsystab set (partnum, nrows) = (98,1000)
  3047. where tabname = 'sysbaract_log';
  3048. update tempsystab set (partnum, nrows) = (99,1000)
  3049. where tabname = 'sysipl';
  3050. update tempsystab set (partnum, nrows) = (100,1000)
  3051. where tabname = 'syssmx';
  3052. update tempsystab set (partnum, nrows) = (101,1000)
  3053. where tabname = 'syssmxses';
  3054. update tempsystab set (partnum, nrows) = (102,1000)
  3055. where tabname = 'syssrcrss';
  3056. update tempsystab set (partnum, nrows) = (103,1000)
  3057. where tabname = 'systrgrss';
  3058. update tempsystab set (partnum, nrows) = (104,1000)
  3059. where tabname = 'sysrsslog';
  3060. update tempsystab set (partnum, nrows) = (105,1000)
  3061. where tabname = 'syssrcsds';
  3062. update tempsystab set (partnum, nrows) = (106,1000)
  3063. where tabname = 'systrgsds';
  3064. update tempsystab set (partnum, nrows) = (108,1000)
  3065. where tabname = 'syssqlhosts';
  3066. update tempsystab set (partnum, nrows) = (109,1000)
  3067. where tabname = 'sysha_type';
  3068. update tempsystab set (partnum, nrows) = (110,1000)
  3069. where tabname = 'sysha_lagtime';
  3070. update tempsystab set (partnum, nrows) = (111,1000)
  3071. where tabname = 'sysha_workload';
  3072. update tempsystab set (partnum, nrows) = (112,100) where tabname = 'sysxatab';
  3073. update tempsystab set (partnum, nrows) = (113,100) where tabname = 'syscmsmtab';
  3074. update tempsystab set (partnum, nrows) = (114,100) where tabname = 'syscmsmsla';
  3075. update tempsystab set (partnum, nrows) = (115,100)
  3076. where tabname = 'syssqltrace_hvar';
  3077. update tempsystab set (partnum, nrows) = (116,1)
  3078. where tabname = 'sysmachineinfo';
  3079. update tempsystab set (partnum, nrows) = (117,1000)
  3080. where tabname = 'syslicenseinfo';
  3081. update tempsystab set (partnum, nrows) = (118,100)
  3082. where tabname = 'syssesappinfo';
  3083. update tempsystab set (partnum,nrows) = (119,1000) where tabname = 'sysproxydistributors';
  3084. update tempsystab set (partnum,nrows) = (120,100) where tabname = 'sysproxyagents';
  3085. update tempsystab set (partnum,nrows) = (121,1000) where tabname = 'sysproxysessions';
  3086. update tempsystab set (partnum,nrows) = (122,1000) where tabname = 'sysproxytxns';
  3087. update tempsystab set (partnum,nrows) = (123,1000) where tabname = 'sysproxytxnops';
  3088. update tempsystab set (partnum,nrows) = (124,1000) where tabname = 'sysfileinfo';
  3089. update tempsystab set (partnum, nrows) = (125,100) where tabname = 'syscmsmunit';
  3090. update tempsystab set (partnum, nrows) = (130, 1) where tabname = 'syscdr_state';
  3091. update tempsystab set (partnum, nrows) = (131, 1) where tabname = 'syscdr_ddr';
  3092. update tempsystab set (partnum, nrows) = (132, 50) where tabname = 'syscdr_nif';
  3093. update tempsystab set (partnum, nrows) = (133, 1) where tabname = 'syscdr_rcv';
  3094. update tempsystab set (partnum, nrows) = (134, 5000)
  3095. where tabname = 'syscdr_atsdir';
  3096. update tempsystab set (partnum, nrows) = (135, 5000)
  3097. where tabname = 'syscdr_risdir';
  3098. update tempsystab set (partnum, nrows) = (136, 5000)
  3099. where tabname = 'syscdr_ats';
  3100. update tempsystab set (partnum, nrows) = (137, 5000)
  3101. where tabname = 'syscdr_ris';
  3102. update tempsystab set (partnum, nrows) = (138, 5)
  3103. where tabname = 'syscdr_rqmstamp';
  3104. update tempsystab set (partnum, nrows) = (139, 30)
  3105. where tabname = 'syscdr_rqmhandle';
  3106. update tempsystab set (partnum, nrows) = (140, 10)
  3107. where tabname = 'sysstoragemgr';
  3108. update tempsystab set (partnum, nrows) = (141, 1)
  3109. where tabname = 'syslowmemorymgr';
  3110. update tempsystab set (partnum, nrows) = (142, 1000)
  3111. where tabname = 'sysreorgops';
  3112. update tempsystab set (partnum,nrows) = (143,100)
  3113. where tabname = 'syscdrcntrlqprog';
  3114. update tempsystab set (partnum,nrows) = (144,1)
  3115. where tabname = 'syscluster';
  3116. update tempsystab set (partnum,nrows) = (145,1000) where tabname = 'sysaqt';
  3117. update tempsystab set (partnum,nrows) = (146,10000) where tabname = 'sysaqtjp';
  3118. update tempsystab set (partnum,nrows) = (147,100)
  3119. where tabname = 'syscdrrecvqprog';
  3120. update tempsystab set (partnum,nrows) = (148,100)
  3121. where tabname = 'sysprobetables';
  3122. update tempsystab set (partnum,nrows) = (149,1000)
  3123. where tabname = 'sysprobecolumns';
  3124. update tempsystab set (partnum,nrows) = (150,100)
  3125. where tabname = 'sysprobejds';
  3126. update tempsystab set (partnum,nrows) = (151,1000)
  3127. where tabname = 'sysprobejps';
  3128. update tempsystab set (partnum,nrows) = (152,100)
  3129. where tabname = 'syscdrtsapply';
  3130. update tempsystab set (partnum, nrows) = (153,300)
  3131. where tabname = 'sysiohistory';
  3132. update tempsystab set (partnum,nrows) = (1025, 1) where tabname = 'sysadtinfo';
  3133. update tempsystab set (partnum,nrows) = (1026, 1) where tabname = 'syscrtadt';
  3134. update tempsystab set (partnum,nrows) = (1027,1000)
  3135. where tabname = 'sysrepstats';
  3136. update tempsystab set (partnum,nrows) = (1028,1000)
  3137. where tabname = 'sysrepevtreg';
  3138. update tempsystab set (partnum,nrows) = (37,100000)
  3139. where tabname = 'syscompdicts_full';
  3140. drop table sysdbspartn;
  3141. drop table sysrawdsk;
  3142. drop table syspaghdr;
  3143. drop table sysslttab;
  3144. drop table syssltdat;
  3145. drop table syschfree;
  3146. drop table syssymtab;
  3147. drop table sysproftab;
  3148. drop table sysptnhdr;
  3149. drop table sysptnkey;
  3150. drop table sysptnext;
  3151. drop table sysptncol;
  3152. drop table sysptnbit;
  3153. drop table sysactptnhdr;
  3154. drop table systabnames;
  3155. drop table sysptntab;
  3156. drop table syslcktab;
  3157. drop table sysbufhdr;
  3158. drop table sysbufpool;
  3159. drop table sysdbstab;
  3160. drop table syschktab;
  3161. drop table sysmchktab;
  3162. drop table syschktab_fast;
  3163. drop table sysmchktab_fast;
  3164. drop table sysrstcb;
  3165. drop table systxptab;
  3166. drop table sysxatab;
  3167. drop table syslogfil;
  3168. drop table sysbtcreq;
  3169. drop table sysshmem;
  3170. drop table sysshmhdr;
  3171. drop table syscfgtab;
  3172. drop table systraces;
  3173. drop table sysscblst;
  3174. drop table systcblst;
  3175. drop table sysvplst;
  3176. drop table sysreorgops;
  3177. drop table systwaits;
  3178. drop table sysdrcb;
  3179. drop table sysplog;
  3180. drop table syscompdicts_full;
  3181. drop table sysadtinfo;
  3182. drop table syscrtadt;
  3183. drop table sysmtxlst;
  3184. drop table sysconlst;
  3185. drop table syspoollst;
  3186. drop table sysseglst;
  3187. drop table sysmgminfo;
  3188. drop table sysmgmgates;
  3189. drop table sysmgmquery;
  3190. drop table sysdic;
  3191. drop table sysprc;
  3192. drop table sysdsc;
  3193. drop table syssqscb;
  3194. drop table syssdblock;
  3195. drop table sysconblock;
  3196. drop table sysopendb;
  3197. drop table syssqlcacheprof;
  3198. drop table syssqlstat;
  3199. drop table syslrus;
  3200. drop table sysshmvals;
  3201. drop table syscdrs;
  3202. drop table syscdrq;
  3203. drop table syscdrtx;
  3204. drop table syscdrprog;
  3205. drop table syscdrsend_txn;
  3206. drop table syscdrack_txn;
  3207. drop table syscdrctrl_txn;
  3208. drop table syscdrsync_txn;
  3209. drop table syscdrrecv_txn;
  3210. drop table syscdrsend_buf;
  3211. drop table syscdrack_buf;
  3212. drop table syscdrctrl_buf;
  3213. drop table syscdrsync_buf;
  3214. drop table syscdrrecv_buf;
  3215. drop table syscdrrecv_stats;
  3216. drop table syscdrlatency;
  3217. drop table syscdrtsapply;
  3218. drop table syscdr_rqm;
  3219. drop table syscheckpoint;
  3220. drop table sysnetworkio;
  3221. drop table sysenv;
  3222. drop table sysenvses;
  3223. drop table sysonlinelog;
  3224. drop table sysdual;
  3225. drop table syssqltrace;
  3226. drop table syssqltrace_iter;
  3227. drop table syssqltrace_info;
  3228. drop table sysnetglobal;
  3229. drop table sysnetclienttype;
  3230. drop table sysbaract_log;
  3231. drop table sysipl;
  3232. drop table syssmx;
  3233. drop table syssmxses;
  3234. drop table syssrcrss;
  3235. drop table systrgrss;
  3236. drop table sysrsslog;
  3237. drop table syssrcsds;
  3238. drop table systrgsds;
  3239. drop table sysrepstats;
  3240. drop table sysrepevtreg;
  3241. drop table syssqlhosts;
  3242. drop table sysha_type;
  3243. drop table sysha_lagtime;
  3244. drop table sysha_workload;
  3245. drop table syscmsmtab;
  3246. drop table syscmsmunit;
  3247. drop table syscmsmsla;
  3248. drop table syssqltrace_hvar;
  3249. drop table sysmachineinfo;
  3250. drop table sysstoragemgr;
  3251. drop table syslowmemorymgr;
  3252. drop table syslicenseinfo;
  3253. drop table syssesappinfo;
  3254. drop table sysproxydistributors;
  3255. drop table sysproxyagents;
  3256. drop table sysproxysessions;
  3257. drop table sysproxytxns;
  3258. drop table sysproxytxnops;
  3259. drop table syscdr_state;
  3260. drop table syscdr_ddr;
  3261. drop table syscdr_nif;
  3262. drop table syscdr_rcv;
  3263. drop table syscdr_atsdir;
  3264. drop table syscdr_risdir;
  3265. drop table syscdr_ats;
  3266. drop table syscdr_ris;
  3267. drop table syscdr_rqmstamp;
  3268. drop table syscdr_rqmhandle;
  3269. drop table sysfileinfo;
  3270. drop table syscdrcntrlqprog;
  3271. drop table syscluster;
  3272. drop table syscdrrecvqprog;
  3273. drop table sysaqt;
  3274. drop table sysaqtjp;
  3275. drop table sysprobetables;
  3276. drop table sysprobecolumns;
  3277. drop table sysprobejds;
  3278. drop table sysprobejps;
  3279. drop table sysiohistory;
  3280. { reinsert modified catalog info into catalogs }
  3281. insert into systables select * from tempsystab;
  3282. insert into syscolumns select * from tempsyscol;
  3283. insert into sysindices select * from tempsysidx;
  3284. insert into systabauth select * from tempsysauth;
  3285. insert into sysobjstate select * from tempsysobj;
  3286. insert into sysblobs select * from tempsysblobs;
  3287. drop table tempsystab;
  3288. drop table tempsyscol;
  3289. drop table tempsysidx;
  3290. drop table tempsysauth;
  3291. drop table tempsysobj;
  3292. drop table tempsysblobs;
  3293. { create a table to associate strings wither various tables' flags/types
  3294. columns }
  3295. create table informix.flags_text (tabname char(128), flags int, txt varchar(200));
  3296. create unique index informix.flags_text_ix1 on flags_text(tabname, flags);
  3297. revoke all on informix.flags_text from public as informix;
  3298. grant select on informix.flags_text to public as informix;
  3299. { Session waits reasons }
  3300. insert into flags_text values ('systwaits', 0, 'unspecified');
  3301. insert into flags_text values ('systwaits', 1, 'buffer');
  3302. insert into flags_text values ('systwaits', 2, 'lock');
  3303. insert into flags_text values ('systwaits', 3, 'aio');
  3304. insert into flags_text values ('systwaits', 4, 'mt yield 0');
  3305. insert into flags_text values ('systwaits', 5, 'mt yield n');
  3306. insert into flags_text values ('systwaits', 6, 'mt yield');
  3307. insert into flags_text values ('systwaits', 7, 'checkpoint');
  3308. insert into flags_text values ('systwaits', 8, 'log i/o');
  3309. insert into flags_text values ('systwaits', 9, 'log block');
  3310. insert into flags_text values ('systwaits', 10, 'condition');
  3311. insert into flags_text values ('systwaits', 11, 'lock mutex');
  3312. insert into flags_text values ('systwaits', 12, 'lockfree mutex');
  3313. insert into flags_text values ('systwaits', 13, 'deadlock mutex');
  3314. insert into flags_text values ('systwaits', 14, 'lrus mutex');
  3315. insert into flags_text values ('systwaits', 15, 'tblsp mutex');
  3316. insert into flags_text values ('systwaits', 16, 'not used');
  3317. insert into flags_text values ('systwaits', 17, 'ckpt mutex');
  3318. insert into flags_text values ('systwaits', 18, 'mutex');
  3319. insert into flags_text values ('systwaits', 19, 'mt ready');
  3320. insert into flags_text values ('systwaits', 20, 'mt yield x');
  3321. insert into flags_text values ('systwaits', 21, 'running');
  3322. insert into flags_text values ('systwaits', 22, 'msg ready');
  3323. insert into flags_text values ('systwaits', 23, 'buf ready');
  3324. insert into flags_text values ('systwaits', 24, 'empty Q');
  3325. insert into flags_text values ('systwaits', 25, 'full Q');
  3326. insert into flags_text values ('systwaits', 26, 'OS read');
  3327. insert into flags_text values ('systwaits', 27, 'OS write');
  3328. insert into flags_text values ('systwaits', 28, 'IO idle');
  3329. insert into flags_text values ('systwaits', 29, 'Fork');
  3330. insert into flags_text values ('systwaits', 30, 'log buffer');
  3331. insert into flags_text values ('systwaits', 31, 'not used');
  3332. insert into flags_text values ('systwaits', 32, 'sort io');
  3333. insert into flags_text values ('systwaits', 33, 'misc');
  3334. insert into flags_text values ('systwaits', 34, 'join thread');
  3335. insert into flags_text values ('systwaits', 35, 'vp mem sync');
  3336. { VP Classes }
  3337. insert into flags_text values ('sysvplst', 0, 'cpu');
  3338. insert into flags_text values ('sysvplst', 1, 'aio');
  3339. insert into flags_text values ('sysvplst', 2, 'tli');
  3340. insert into flags_text values ('sysvplst', 3, 'shm');
  3341. insert into flags_text values ('sysvplst', 4, 'lio');
  3342. insert into flags_text values ('sysvplst', 5, 'pio');
  3343. insert into flags_text values ('sysvplst', 6, 'adm');
  3344. insert into flags_text values ('sysvplst', 7, 'opt');
  3345. insert into flags_text values ('sysvplst', 8, 'soc');
  3346. insert into flags_text values ('sysvplst', 9, 'msc');
  3347. insert into flags_text values ('sysvplst', 10, 'adt');
  3348. insert into flags_text values ('sysvplst', 11, 'kio');
  3349. insert into flags_text values ('sysvplst', 12, 'str');
  3350. insert into flags_text values ('sysvplst', 13, 'csm');
  3351. insert into flags_text values ('sysvplst', 14, 'jvp');
  3352. insert into flags_text values ('sysvplst', 15, 'cdr');
  3353. insert into flags_text values ('sysvplst', 16, 'crypto');
  3354. insert into flags_text values ('sysvplst', 17, 'sqli_dbg');
  3355. insert into flags_text values ('sysvplst', 18, 'encrypt');
  3356. insert into flags_text values ('sysvplst', 19, 'drda_dbg');
  3357. insert into flags_text values ('sysvplst', 20, 'ntk');
  3358. insert into flags_text values ('sysvplst', 21, 'ssl');
  3359. insert into flags_text values ('sysvplst', 22, 'cdrsmi');
  3360. { Lock types }
  3361. insert into flags_text values ('syslcktab', 0, 'NONE');
  3362. insert into flags_text values ('syslcktab', 1, 'BYTE');
  3363. insert into flags_text values ('syslcktab', 2, 'IS');
  3364. insert into flags_text values ('syslcktab', 3, 'S');
  3365. insert into flags_text values ('syslcktab', 4, 'SR');
  3366. insert into flags_text values ('syslcktab', 5, 'U');
  3367. insert into flags_text values ('syslcktab', 6, 'UR');
  3368. insert into flags_text values ('syslcktab', 7, 'IX');
  3369. insert into flags_text values ('syslcktab', 8, 'SIX');
  3370. insert into flags_text values ('syslcktab', 9, 'X');
  3371. insert into flags_text values ('syslcktab', 10,'XR');
  3372. { Data Replication }
  3373. insert into flags_text values ('sysdrcb', 0, 'Not Initialized');
  3374. insert into flags_text values ('sysdrcb', 1, 'Standard');
  3375. insert into flags_text values ('sysdrcb', 2, 'Primary');
  3376. insert into flags_text values ('sysdrcb', 3, 'Secondary');
  3377. insert into flags_text values ('sysdrcb', 16, 'Off');
  3378. insert into flags_text values ('sysdrcb', 32, 'On');
  3379. insert into flags_text values ('sysdrcb', 64, 'Connecting');
  3380. insert into flags_text values ('sysdrcb', 128, 'Failed');
  3381. insert into flags_text values ('sysdrcb', 256, 'Failed Recovery');
  3382. insert into flags_text values ('sysdrcb', 288, 'On');
  3383. insert into flags_text values ('sysdrcb', 544, 'Draining');
  3384. { Index Page Logging status }
  3385. insert into flags_text values ('sysipl', 0, 'Inactive');
  3386. insert into flags_text values ('sysipl', 1, 'Active');
  3387. { Isolation Level }
  3388. insert into flags_text values ('sysopendb', 0, 'NOTRANS');
  3389. insert into flags_text values ('sysopendb', 1, 'DIRTY READ');
  3390. insert into flags_text values ('sysopendb', 2, 'COMMITTED READ');
  3391. insert into flags_text values ('sysopendb', 3, 'CURSOR STABILITY');
  3392. insert into flags_text values ('sysopendb', 5, 'REPEATABLE READ');
  3393. insert into flags_text values ('sysopendb', 7, 'DIRTY READ RETAIN UPDATE LOCKS');
  3394. insert into flags_text values ('sysopendb', 8, 'COMMITTED READ RETAIN UPDATE LOCKS');
  3395. insert into flags_text values ('sysopendb', 9, 'CURSOR STABILITY RETAIN UPDATE LOCKS');
  3396. insert into flags_text values ('sysopendb', 11, 'COMMITTED READ LAST COMMITTED');
  3397. { SQL statement types: see incl/sqlstype }
  3398. insert into flags_text values ('sqltype', 1, 'SQ_DATABASE');
  3399. insert into flags_text values ('sqltype', 2, 'SQ_SELECT');
  3400. insert into flags_text values ('sqltype', 3, 'SQ_SELINTO');
  3401. insert into flags_text values ('sqltype', 4, 'SQ_UPDATE');
  3402. insert into flags_text values ('sqltype', 5, 'SQ_DELETE');
  3403. insert into flags_text values ('sqltype', 6, 'SQ_INSERT');
  3404. insert into flags_text values ('sqltype', 7, 'SQ_UPDCURR');
  3405. insert into flags_text values ('sqltype', 8, 'SQ_DELCURR');
  3406. insert into flags_text values ('sqltype', 9, 'SQ_LDINSERT');
  3407. insert into flags_text values ('sqltype', 10, 'SQ_LOCK');
  3408. insert into flags_text values ('sqltype', 11, 'SQ_UNLOCK');
  3409. insert into flags_text values ('sqltype', 12, 'SQ_CREADB');
  3410. insert into flags_text values ('sqltype', 13, 'SQ_DROPDB');
  3411. insert into flags_text values ('sqltype', 14, 'SQ_CRETAB');
  3412. insert into flags_text values ('sqltype', 15, 'SQ_DRPTAB');
  3413. insert into flags_text values ('sqltype', 16, 'SQ_CREIDX');
  3414. insert into flags_text values ('sqltype', 17, 'SQ_DRPIDX');
  3415. insert into flags_text values ('sqltype', 18, 'SQ_GRANT');
  3416. insert into flags_text values ('sqltype', 19, 'SQ_REVOKE');
  3417. insert into flags_text values ('sqltype', 20, 'SQ_RENTAB');
  3418. insert into flags_text values ('sqltype', 21, 'SQ_RENCOL');
  3419. insert into flags_text values ('sqltype', 22, 'SQ_CREAUD');
  3420. insert into flags_text values ('sqltype', 23, 'SQ_STRAUD');
  3421. insert into flags_text values ('sqltype', 24, 'SQ_STPAUD');
  3422. insert into flags_text values ('sqltype', 25, 'SQ_DRPAUD');
  3423. insert into flags_text values ('sqltype', 26, 'SQ_RECTAB');
  3424. insert into flags_text values ('sqltype', 27, 'SQ_CHKTAB');
  3425. insert into flags_text values ('sqltype', 28, 'SQ_REPTAB');
  3426. insert into flags_text values ('sqltype', 29, 'SQ_ALTER');
  3427. insert into flags_text values ('sqltype', 30, 'SQ_STATS');
  3428. insert into flags_text values ('sqltype', 31, 'SQ_CLSDB');
  3429. insert into flags_text values ('sqltype', 32, 'SQ_DELALL');
  3430. insert into flags_text values ('sqltype', 33, 'SQ_UPDALL');
  3431. insert into flags_text values ('sqltype', 34, 'SQ_BEGWORK');
  3432. insert into flags_text values ('sqltype', 35, 'SQ_COMMIT');
  3433. insert into flags_text values ('sqltype', 36, 'SQ_ROLLBACK');
  3434. insert into flags_text values ('sqltype', 37, 'SQ_SAVEPOINT');
  3435. insert into flags_text values ('sqltype', 38, 'SQ_STARTDB');
  3436. insert into flags_text values ('sqltype', 39, 'SQ_RFORWARD');
  3437. insert into flags_text values ('sqltype', 40, 'SQ_CREVIEW');
  3438. insert into flags_text values ('sqltype', 41, 'SQ_DROPVIEW');
  3439. insert into flags_text values ('sqltype', 42, 'SQ_DEBUG');
  3440. insert into flags_text values ('sqltype', 43, 'SQ_CREASYN');
  3441. insert into flags_text values ('sqltype', 44, 'SQ_DROPSYN');
  3442. insert into flags_text values ('sqltype', 45, 'SQ_CTEMP');
  3443. insert into flags_text values ('sqltype', 46, 'SQ_WAITFOR');
  3444. insert into flags_text values ('sqltype', 47, 'SQ_ALTIDX');
  3445. insert into flags_text values ('sqltype', 48, 'SQ_ISOLATE');
  3446. insert into flags_text values ('sqltype', 49, 'SQ_SETLOG');
  3447. insert into flags_text values ('sqltype', 50, 'SQ_EXPLAIN');
  3448. insert into flags_text values ('sqltype', 51, 'SQ_SCHEMA');
  3449. insert into flags_text values ('sqltype', 52, 'SQ_OPTIM');
  3450. insert into flags_text values ('sqltype', 53, 'SQ_CREPROC');
  3451. insert into flags_text values ('sqltype', 54, 'SQ_DRPPROC');
  3452. insert into flags_text values ('sqltype', 55, 'SQ_CONSTRMODE');
  3453. insert into flags_text values ('sqltype', 56, 'SQ_EXECPROC');
  3454. insert into flags_text values ('sqltype', 57, 'SQ_DBGFILE');
  3455. insert into flags_text values ('sqltype', 58, 'SQ_CREOPCL');
  3456. insert into flags_text values ('sqltype', 59, 'SQ_ALTOPCL');
  3457. insert into flags_text values ('sqltype', 60, 'SQ_DRPOPCL');
  3458. insert into flags_text values ('sqltype', 61, 'SQ_OPRESERVE');
  3459. insert into flags_text values ('sqltype', 62, 'SQ_OPRELEASE');
  3460. insert into flags_text values ('sqltype', 63, 'SQ_OPTIMEOUT');
  3461. insert into flags_text values ('sqltype', 64, 'SQ_PROCSTATS');
  3462. insert into flags_text values ('sqltype', 65, 'SQ_GRANTGRP');
  3463. insert into flags_text values ('sqltype', 66, 'SQ_REVOKGRP');
  3464. insert into flags_text values ('sqltype', 67, 'SQ_SKINHIBIT');
  3465. insert into flags_text values ('sqltype', 68, 'SQ_SKSHOW');
  3466. insert into flags_text values ('sqltype', 69, 'SQ_SKSMALL');
  3467. insert into flags_text values ('sqltype', 70, 'SQ_CRETRIG');
  3468. insert into flags_text values ('sqltype', 71, 'SQ_DRPTRIG');
  3469. insert into flags_text values ('sqltype', 72, 'SQ_UNKNOWN');
  3470. insert into flags_text values ('sqltype', 73, 'SQ_SETDATASKIP');
  3471. insert into flags_text values ('sqltype', 74, 'SQ_PDQPRIORITY');
  3472. insert into flags_text values ('sqltype', 75, 'SQ_ALTFRAG');
  3473. insert into flags_text values ('sqltype', 76, 'SQ_SETOBJMODE');
  3474. insert into flags_text values ('sqltype', 77, 'SQ_START');
  3475. insert into flags_text values ('sqltype', 78, 'SQ_STOP');
  3476. insert into flags_text values ('sqltype', 79, 'SQ_SETMAC');
  3477. insert into flags_text values ('sqltype', 80, 'SQ_SETDAC');
  3478. insert into flags_text values ('sqltype', 81, 'SQ_SETTBLHI');
  3479. insert into flags_text values ('sqltype', 82, 'SQ_SETLVEXT');
  3480. insert into flags_text values ('sqltype', 83, 'SQ_CREATEROLE');
  3481. insert into flags_text values ('sqltype', 84, 'SQ_DROPROLE');
  3482. insert into flags_text values ('sqltype', 85, 'SQ_SETROLE');
  3483. insert into flags_text values ('sqltype', 86, 'SQ_PASSWD');
  3484. insert into flags_text values ('sqltype', 87, 'SQ_RENDB');
  3485. insert into flags_text values ('sqltype', 88, 'SQ_CREADOM');
  3486. insert into flags_text values ('sqltype', 89, 'SQ_DROPDOM');
  3487. insert into flags_text values ('sqltype', 90, 'SQ_CREANRT');
  3488. insert into flags_text values ('sqltype', 91, 'SQ_DROPNRT');
  3489. insert into flags_text values ('sqltype', 92, 'SQ_CREADT');
  3490. insert into flags_text values ('sqltype', 93, 'SQ_CREACT');
  3491. insert into flags_text values ('sqltype', 94, 'SQ_DROPCT');
  3492. insert into flags_text values ('sqltype', 95, 'SQ_CREABT');
  3493. insert into flags_text values ('sqltype', 96, 'SQ_DROPTYPE');
  3494. insert into flags_text values ('sqltype', 97, 'SQ_ALTERROUTINE');
  3495. insert into flags_text values ('sqltype', 98, 'SQ_CREATEAM');
  3496. insert into flags_text values ('sqltype', 99, 'SQ_DROPAM');
  3497. insert into flags_text values ('sqltype', 100, 'SQ_ALTERAM');
  3498. insert into flags_text values ('sqltype', 101, 'SQ_CREATEOPC');
  3499. insert into flags_text values ('sqltype', 102, 'SQ_DROPOPC');
  3500. insert into flags_text values ('sqltype', 103, 'SQ_CREACST');
  3501. insert into flags_text values ('sqltype', 104, 'SQ_SETRES');
  3502. insert into flags_text values ('sqltype', 105, 'SQ_CREAGG');
  3503. insert into flags_text values ('sqltype', 106, 'SQ_DRPAGG');
  3504. insert into flags_text values ('sqltype', 107, 'SQ_PLOADFILE');
  3505. insert into flags_text values ('sqltype', 108, 'SQ_CHKIDX');
  3506. insert into flags_text values ('sqltype', 109, 'SQ_SCHEDULE');
  3507. insert into flags_text values ('sqltype', 110, 'SQ_SETENV');
  3508. insert into flags_text values ('sqltype', 111, 'SQ_XPS_RES2');
  3509. insert into flags_text values ('sqltype', 112, 'SQ_XPS_RES3');
  3510. insert into flags_text values ('sqltype', 113, 'SQ_XPS_RES4');
  3511. insert into flags_text values ('sqltype', 114, 'SQ_XPS_RES5');
  3512. insert into flags_text values ('sqltype', 116, 'SQ_RENIDX');
  3513. insert into flags_text values ('sqltype', 124, 'SQ_CRESEQ');
  3514. insert into flags_text values ('sqltype', 125, 'SQ_DRPSEQ');
  3515. insert into flags_text values ('sqltype', 126, 'SQ_ALTERSEQ');
  3516. insert into flags_text values ('sqltype', 127, 'SQ_RENSEQ');
  3517. insert into flags_text values ('sqltype', 129, 'SQ_COLLATION');
  3518. insert into flags_text values ('sqltype', 130, 'SQ_NOCOLLATION');
  3519. insert into flags_text values ('sqltype', 131, 'SQ_SETDEFROLE');
  3520. insert into flags_text values ('sqltype', 132, 'SQ_ENCRYPTION');
  3521. insert into flags_text values ('sqltype', 134, 'SQ_CRXASRCTYPE');
  3522. insert into flags_text values ('sqltype', 135, 'SQ_CRXADTSRC');
  3523. insert into flags_text values ('sqltype', 136, 'SQ_DROPXATYPE');
  3524. insert into flags_text values ('sqltype', 137, 'SQ_DROPXADTSRC');
  3525. insert into flags_text values ('sqltype', 138, 'SQ_TRUNCATE');
  3526. insert into flags_text values ('sqltype', 139, 'SQ_CRESECCMP');
  3527. insert into flags_text values ('sqltype', 140, 'SQ_ALTSECCMP');
  3528. insert into flags_text values ('sqltype', 141, 'SQ_DRPSECCMP');
  3529. insert into flags_text values ('sqltype', 142, 'SQ_RENSECCMP');
  3530. insert into flags_text values ('sqltype', 143, 'SQ_CRESECPOL');
  3531. insert into flags_text values ('sqltype', 144, 'SQ_DRPSECPOL');
  3532. insert into flags_text values ('sqltype', 145, 'SQ_RENSECPOL');
  3533. insert into flags_text values ('sqltype', 146, 'SQ_CRESECLAB');
  3534. insert into flags_text values ('sqltype', 147, 'SQ_DRPSECLAB');
  3535. insert into flags_text values ('sqltype', 148, 'SQ_RENSECLAB');
  3536. insert into flags_text values ('sqltype', 149, 'SQ_GRTSECADM');
  3537. insert into flags_text values ('sqltype', 150, 'SQ_RVKSECADM');
  3538. insert into flags_text values ('sqltype', 151, 'SQ_GRTSECEXMP');
  3539. insert into flags_text values ('sqltype', 152, 'SQ_RVKSECEXMP');
  3540. insert into flags_text values ('sqltype', 153, 'SQ_GRTSECLAB');
  3541. insert into flags_text values ('sqltype', 154, 'SQ_RVKSECLAB');
  3542. insert into flags_text values ('sqltype', 155, 'SQ_GRTSESAUTH');
  3543. insert into flags_text values ('sqltype', 156, 'SQ_RVKSESAUTH');
  3544. insert into flags_text values ('sqltype', 157, 'SQ_SETSESIMP');
  3545. insert into flags_text values ('sqltype', 158, 'SQ_FREELOC');
  3546. insert into flags_text values ('sqltype', 159, 'SQ_SETSVPT');
  3547. insert into flags_text values ('sqltype', 160, 'SQ_RELSVPT');
  3548. insert into flags_text values ('sqltype', 161, 'SQ_RBACKSVPT');
  3549. insert into flags_text values ('sqltype', 162, 'SQ_MERGE');
  3550. insert into flags_text values ('sqltype', 163, 'SQ_OPTSTORAGE');
  3551. insert into flags_text values ('sqltype', 164, 'SQ_GRTACCESS');
  3552. insert into flags_text values ('sqltype', 165, 'SQ_RVKACCESS');
  3553. insert into flags_text values ('sqltype', 166, 'SQ_SELINTOEXT');
  3554. insert into flags_text values ('sqltype', 167, 'SQ_CRETCONTEXT');
  3555. insert into flags_text values ('sqltype', 168, 'SQ_ALTTCONTEXT');
  3556. insert into flags_text values ('sqltype', 169, 'SQ_DRPTCONTEXT');
  3557. insert into flags_text values ('sqltype', 170, 'SQ_RENTCONTEXT');
  3558. insert into flags_text values ('sqltype', 171, 'SQ_CRTUSER');
  3559. insert into flags_text values ('sqltype', 172, 'SQ_ALTUSER');
  3560. insert into flags_text values ('sqltype', 173, 'SQ_DRPUSER');
  3561. insert into flags_text values ('sqltype', 174, 'SQ_RNMUSER');
  3562. insert into flags_text values ('sqltype', 175, 'SQ_USRPW');
  3563. { SQL trace info: see sql/sqcache.h }
  3564. insert into flags_text values ('syssqltrace_info', '0x0001', 'Tracing On');
  3565. insert into flags_text values ('syssqltrace_info', '0x0002', 'Tracing Off');
  3566. insert into flags_text values ('syssqltrace_info',
  3567. '0x0010', 'Global Tracing');
  3568. insert into flags_text values ('syssqltrace_info',
  3569. '0x0020', 'User Tracing');
  3570. insert into flags_text values ('syssqltrace_info',
  3571. '0x0100', 'Trace Database Name');
  3572. insert into flags_text values ('syssqltrace_info',
  3573. '0x0200', 'Trace Statement Text');
  3574. insert into flags_text values ('syssqltrace_info',
  3575. '0x0400', 'Trace Statistics');
  3576. insert into flags_text values ('syssqltrace_info',
  3577. '0x0800', 'Trace Procedures');
  3578. insert into flags_text values ('syssqltrace_info',
  3579. '0x1000', 'Trace Iterators');
  3580. insert into flags_text values ('syssqltrace_info',
  3581. '0x2000', 'Trace Host Variables');
  3582. insert into flags_text values ('syssqltrace_info',
  3583. '0x4000', 'Trace Table Name');
  3584. { Page Header }
  3585. insert into flags_text values ('syspaghdr',
  3586. 1,'Data Page');
  3587. insert into flags_text values ('syspaghdr',
  3588. 2,'Partition Descriptor Page');
  3589. insert into flags_text values ('syspaghdr',
  3590. 4,'Partition Free List Page');
  3591. insert into flags_text values ('syspaghdr',
  3592. 8,'Chunk Free List Page');
  3593. insert into flags_text values ('syspaghdr',
  3594. 9,'Remainder Data Page');
  3595. insert into flags_text values ('syspaghdr',
  3596. 11,'Partition Resident BLOB Page');
  3597. insert into flags_text values ('syspaghdr',
  3598. 12,'Blobspace Resident BLOB Page');
  3599. insert into flags_text values ('syspaghdr',
  3600. 13,'BLOB Chunk Free List Bit Page');
  3601. insert into flags_text values ('syspaghdr',
  3602. 14,'BLOB Chunk BLOB Map Page');
  3603. insert into flags_text values ('syspaghdr',
  3604. 16,'B-Tree Node Page');
  3605. insert into flags_text values ('syspaghdr',
  3606. 32,'B-Tree Root Node');
  3607. insert into flags_text values ('syspaghdr',
  3608. 64,'B-Tree Twig Node');
  3609. insert into flags_text values ('syspaghdr',
  3610. 128,'B-Tree Leaf Node');
  3611. insert into flags_text values ('syspaghdr',
  3612. 256,'Logical Log Page');
  3613. insert into flags_text values ('syspaghdr',
  3614. 512,'Last Page of Log Log');
  3615. insert into flags_text values ('syspaghdr',
  3616. 1024,'Sync Page of Log Log');
  3617. insert into flags_text values ('syspaghdr',
  3618. 2048,'Physical Log Page');
  3619. insert into flags_text values ('syspaghdr',
  3620. 4096,'Reserved Page');
  3621. insert into flags_text values ('syspaghdr',
  3622. 8192,'Temporarily no physical logging required');
  3623. insert into flags_text values ('syspaghdr',
  3624. 16384,'Temporarily no physical logging required');
  3625. insert into flags_text values ('syspaghdr',
  3626. 32768,'B-Tree Leaf Page containing deleted Items');
  3627. { SQLHosts Network Options }
  3628. insert into flags_text values ('syssqlhosts_netoptions', 0, 'None');
  3629. insert into flags_text values ('syssqlhosts_netoptions', 1, 'Keep Alive');
  3630. { SQLHosts Server Security Options}
  3631. insert into flags_text values ('syssqlhosts_svrsecurity', 0, 'None');
  3632. insert into flags_text values ('syssqlhosts_svrsecurity', 1, 'Enable host.equiv');
  3633. insert into flags_text values ('syssqlhosts_svrsecurity', 2, 'Enable rhosts');
  3634. insert into flags_text values ('syssqlhosts_svrsecurity', 4, 'AIX authentication');
  3635. insert into flags_text values ('syssqlhosts_svrsecurity', 8, 'Enable Informix host.equiv');
  3636. { SQLHosts Client Security Options}
  3637. insert into flags_text values ('syssqlhosts_clntsecurity', 0, 'None');
  3638. insert into flags_text values ('syssqlhosts_clntsecurity', 1, 'Enable netrc lookup');
  3639. { SQLHosts Redirector Options}
  3640. insert into flags_text values ('syssqlhosts_redirector', 0, 'Off');
  3641. insert into flags_text values ('syssqlhosts_redirector', 1, 'On');
  3642. { Partition Header }
  3643. insert into flags_text values ('sysptnhdr', 1, 'Page Level Locking');
  3644. insert into flags_text values ('sysptnhdr', 2, 'Row Level Locking');
  3645. insert into flags_text values ('sysptnhdr', 4, 'System Catalog Table');
  3646. insert into flags_text values ('sysptnhdr', 8, 'Replicated Table');
  3647. insert into flags_text values ('sysptnhdr', 32,'System created Temp Table');
  3648. insert into flags_text values ('sysptnhdr', 64,'User created Temp Table');
  3649. insert into flags_text values ('sysptnhdr', 128,'Sort File');
  3650. insert into flags_text values ('sysptnhdr', 256,'Contains Varchar Data Type');
  3651. insert into flags_text values ('sysptnhdr', 512,'Contains BLOBSpace BLOBS');
  3652. insert into flags_text values ('sysptnhdr', 1024,'Contains TBLSpace BLOBS');
  3653. insert into flags_text values ('sysptnhdr', 2048,'Contains either Varchars,BLOBS or Rows > PAGESIZE-32');
  3654. insert into flags_text values ('sysptnhdr', 4096,'Contains optical Sub-System BLOBS');
  3655. insert into flags_text values ('sysptnhdr', 8192,'Permanent System created Table ( undroppable )');
  3656. insert into flags_text values ('sysptnhdr', 16384,'Special Function Temp Tables, no Bitmap Maintenance');
  3657. insert into flags_text values ('sysptnhdr', 32768,'Light Append Partition');
  3658. insert into flags_text values ('sysptnhdr', 131072,'Hash Table');
  3659. insert into flags_text values ('sysptnhdr', 262144,'Index Partition');
  3660. insert into flags_text values ('sysptnhdr', 524288,'Sequence Object');
  3661. insert into flags_text values ('sysptnhdr', 1048576,'Page free space cache disabled');
  3662. insert into flags_text values ('sysptnhdr_flags2', 1,'Automatic Compression');
  3663. { Bitmap }
  3664. insert into flags_text values ('sysptnbit',0,'Free Page');
  3665. insert into flags_text values ('sysptnbit',1,'Remainder Page - free Space = Pagesize');
  3666. insert into flags_text values ('sysptnbit',2,'PBLOB Page - free Space = Pagesize');
  3667. insert into flags_text values ('sysptnbit',4,'Data Page with Room for another Row');
  3668. insert into flags_text values ('sysptnbit',5,'Remainder Page - free Space between Pagesize and 2/3*Pagesize');
  3669. insert into flags_text values ('sysptnbit',6,'PBLOB Page - free Space between Pagesize and 2/3*Pagesize');
  3670. insert into flags_text values ('sysptnbit',8,'Index Page or Bitmap Page');
  3671. insert into flags_text values ('sysptnbit',9,'Remainder Page - free Space between 2/3*Pagesize and 1/10*Pagesize');
  3672. insert into flags_text values ('sysptnbit',10,'PBLOB Page - free Space between 2/3*Pagesize and 1/10*Pagesize');
  3673. insert into flags_text values ('sysptnbit',12,'Data Page without Room for another Row');
  3674. insert into flags_text values ('sysptnbit',13,'Remainder Page full - free Space < 1/10*Pagesize');
  3675. insert into flags_text values ('sysptnbit',14,'PBLOB Page full - free Space < 1/10*Pagesize');
  3676. { License Info }
  3677. insert into flags_text values ('syslicenseinfo',1,
  3678. 'HDR Primary');
  3679. insert into flags_text values ('syslicenseinfo',2,
  3680. 'HDR Secondary');
  3681. insert into flags_text values ('syslicenseinfo',4,
  3682. 'HDR RSS');
  3683. insert into flags_text values ('syslicenseinfo',8,
  3684. 'HDR SDS');
  3685. insert into flags_text values ('syslicenseinfo',16,
  3686. 'Enterprise Replication');
  3687. insert into flags_text values ('syslicenseinfo',512,
  3688. 'Parallel Data Query');
  3689. insert into flags_text values ('syslicenseinfo',1024,
  3690. 'Database Mirroring');
  3691. insert into flags_text values ('syslicenseinfo',8192,
  3692. 'Database Compression');
  3693. insert into flags_text values ('syslicenseinfo',16384,
  3694. 'Database Defragmentation');
  3695. insert into flags_text values ('syslicenseinfo',32768,
  3696. 'Enhanced de-duplication');
  3697. { Create a table where the build status for 'sysutils' and any other system
  3698. activity associated with building 'sysmaster' can be recorded }
  3699. create table informix.smi_build_status (message_num integer);
  3700. { Create a table where conversion messages can be entered by front end
  3701. shell scripts for displaying into the logmessage file }
  3702. create table informix.logmessage (message_num integer);
  3703. { Stored procedure for setting boolean 'columns' in views for flags values }
  3704. create procedure informix.bitval ( bitset int, bitmask int) returning int;
  3705. if (bitset < 0) then
  3706. if (bitmask < 0) then
  3707. return 1;
  3708. end if;
  3709. let bitset = bitset + 2147483648;
  3710. end if;
  3711. if (bitset > 1073741824) then
  3712. if (bitmask = 1073741824) then
  3713. return 1;
  3714. end if;
  3715. end if
  3716. if (mod(bitset,2*bitmask) >= bitmask) then
  3717. return 1;
  3718. end if
  3719. return 0;
  3720. end procedure;
  3721. grant execute on informix.bitval to public as informix;
  3722. { Stored procedure for converting unix time() long to date }
  3723. create procedure informix.l2date ( l int ) returning date;
  3724. return trunc((l/86400) + 25568 );
  3725. end procedure;
  3726. grant execute on informix.l2date to public as informix;
  3727. create procedure informix.physchunk( physaddr int ) returning int;
  3728. return trunc(physaddr/1048576);
  3729. end procedure;
  3730. grant execute on informix.physchunk to public as informix;
  3731. create procedure informix.physpage( physaddr int ) returning int;
  3732. return(mod(physaddr,1048576));
  3733. end procedure;
  3734. grant execute on informix.physpage to public as informix;
  3735. create procedure informix.physaddr(chunknum int, pagenum int) returning int;
  3736. return((chunknum*1048576)+pagenum);
  3737. end procedure;
  3738. grant execute on informix.physaddr to public as informix;
  3739. create procedure informix.partdbsnum (partnum int ) returning int;
  3740. return trunc(partnum/1048576);
  3741. end procedure;
  3742. grant execute on informix.partdbsnum to public as informix;
  3743. create procedure informix.partpagenum(partnum int) returning int;
  3744. return(mod(partnum,1048576));
  3745. end procedure;
  3746. grant execute on informix.partpagenum to public as informix;
  3747. create procedure informix.partaddr(dbspnum int, pagenum int) returning int;
  3748. return((dbspnum*1048576)+pagenum);
  3749. end procedure;
  3750. grant execute on informix.partaddr to public as informix;
  3751. { Session Waits profile }
  3752. create view informix.sysseswts (sid, reason, numwaits, cumtime, maxtime)
  3753. as
  3754. select a.sid, c.txt, b.wnum, b.wcumtime, b.wmaxtime
  3755. from sysrstcb a, systwaits b, flags_text c
  3756. where a.tid = b.tid
  3757. and b.wreason = c.flags
  3758. and c.tabname = 'systwaits';
  3759. grant select on informix.sysseswts to public as informix;
  3760. { Chunk Free List }
  3761. create view informix.syschkextents ( ce_chknum, ce_extnum, ce_physaddr, ce_size )
  3762. as select chknum, extnum, start, leng from syschfree;
  3763. grant select on informix.syschkextents to public as informix;
  3764. { Partition Bit Maps }
  3765. create view informix.systabpagtypes ( tp_partnum, tp_pagenum, tp_type )
  3766. as select pb_partnum, pb_pagenum, pb_bitmap from sysptnbit;
  3767. grant select on informix.systabpagtypes to public as informix;
  3768. { Logical Logs }
  3769. create view informix.syslogs (number, uniqid, size, used,
  3770. is_used, is_current, is_backed_up,
  3771. is_new, is_archived, is_temp, is_pre_dropped, flags)
  3772. as
  3773. select number, uniqid, size, used,
  3774. bitval(flags, '0x1'), bitval(flags, '0x2'), bitval(flags, '0x4'),
  3775. bitval(flags, '0x8'), bitval(flags, '0x10'),
  3776. bitval(flags, '0x20'), bitval(flags, '0x40'), flags
  3777. from syslogfil
  3778. where number > 0;
  3779. grant select on informix.syslogs to public as informix;
  3780. { Chunks }
  3781. create view informix.syschunks(chknum, dbsnum, nxchknum, pagesize, chksize, offset,
  3782. nfree, mdsize, udsize, udfree,
  3783. is_offline, is_recovering, is_blobchunk, is_sbchunk,
  3784. is_inconsistent, is_extendable, flags, fname,
  3785. mfname, moffset, mis_offline, mis_recovering, mflags)
  3786. as
  3787. select a.chknum, a.dbsnum, a.nxchunk, a.pagesize, a.chksize, a.offset,
  3788. a.nfree, a.mdsize, a.udsize, a.udfree,
  3789. bitval(a.flags, '0x20'), bitval(a.flags, '0x80'),
  3790. bitval(a.flags, '0x200'), bitval(a.flags, '0x4000'),
  3791. bitval(a.flags, '0x1000'), bitval(a.flags, '0x2000'),
  3792. a.flags, a.fname, b.fname, b.offset,
  3793. bitval(b.flags, '0x20'), bitval(b.flags, '0x80'),
  3794. b.flags
  3795. from syschktab a, outer sysmchktab b
  3796. where a.chknum = b.chknum
  3797. and a.chknum > 0;
  3798. grant select on informix.syschunks to public as informix;
  3799. { Chunks (fast view) }
  3800. create view informix.syschunks_fast(chknum, dbsnum, nxchknum, pagesize, chksize, offset,
  3801. nfree, mdsize, udsize, udfree,
  3802. is_offline, is_recovering, is_blobchunk, is_sbchunk,
  3803. is_inconsistent, is_extendable, flags, fname,
  3804. mfname, moffset, mis_offline, mis_recovering, mflags)
  3805. as
  3806. select a.chknum, a.dbsnum, a.nxchunk, a.pagesize, a.chksize, a.offset,
  3807. a.nfree, a.mdsize, a.udsize, a.udfree,
  3808. bitval(a.flags, '0x20'), bitval(a.flags, '0x80'),
  3809. bitval(a.flags, '0x200'), bitval(a.flags, '0x4000'),
  3810. bitval(a.flags, '0x1000'), bitval(a.flags, '0x2000'),
  3811. a.flags, a.fname, b.fname, b.offset,
  3812. bitval(b.flags, '0x20'), bitval(b.flags, '0x80'),
  3813. b.flags
  3814. from syschktab_fast a, outer sysmchktab_fast b
  3815. where a.chknum = b.chknum
  3816. and a.chknum > 0;
  3817. grant select on informix.syschunks_fast to public as informix;
  3818. { Dbspaces }
  3819. create view informix.sysdbspaces(dbsnum, name, owner, pagesize, fchunk, nchunks,
  3820. create_size, extend_size, max_size, is_mirrored, is_blobspace,
  3821. is_sbspace, is_temp, is_encrypted, flags)
  3822. as
  3823. select dbsnum, name, owner, pagesize, fchunk, nchunks, create_size,
  3824. extend_size, max_size, bitval(flags, '0x2'), bitval(flags, '0x10'),
  3825. bitval(flags, '0x8000'), bitval(flags, '0x2000'),
  3826. bitval(flags, '0x10000000'), flags
  3827. from sysdbstab
  3828. where dbsnum > 0;
  3829. grant select on informix.sysdbspaces to public as informix;
  3830. { Locks (keep for 6.0 compatibility) }
  3831. create view informix.syslocks (dbsname, tabname, rowidlk, keynum, type,
  3832. owner, waiter)
  3833. as
  3834. select dbsname, b.tabname, rowidr, keynum, e.txt[1,4], d.sid, f.sid
  3835. from syslcktab a, systabnames b, systxptab c, sysrstcb d,
  3836. flags_text e, outer sysrstcb f
  3837. where a.partnum = b.partnum
  3838. and a.owner = c.address
  3839. and c.owner = d.address
  3840. and a.wtlist = f.address
  3841. and e.tabname = 'syslcktab'
  3842. and e.flags = a.type;
  3843. grant select on informix.syslocks to public as informix;
  3844. { Locks }
  3845. create view informix.syslocktab ( lk_id, lk_addr, lk_same, lk_wtlist, lk_owner,
  3846. lk_list, lk_type, lk_flags, lk_bsize, lk_keynum,
  3847. lk_rowid, lk_partnum, lk_kvobj, lk_dipnum,
  3848. lk_grtime )
  3849. as select indx, address, same, wtlist, owner, list, type, flags, bsize,
  3850. keynum, rowidr, partnum, rowidn, dipnum, grtime from syslcktab;
  3851. grant select on informix.syslocktab to public as informix;
  3852. { Active sessions }
  3853. create view informix.syssessions ( sid, username, uid, pid,
  3854. hostname, tty, connected, feprogram,
  3855. pooladdr,
  3856. is_wlatch, is_wlock, is_wbuff, is_wckpt,
  3857. is_wlogbuf, is_wtrans, is_monitor, is_incrit,
  3858. state
  3859. )
  3860. as
  3861. select a.sid, a.username, a.uid, a.pid,
  3862. a.hostname, a.ttyerr, a.connected, a.progname, a.poolp,
  3863. bitval(b.flags, '0x2'), bitval(b.flags, '0x4'),
  3864. bitval(b.flags, '0x8'), bitval(b.flags, '0x10'),
  3865. bitval(b.flags, '0x1000'), bitval(b.flags, '0x40000'),
  3866. bitval(b.flags, '0x80'), bitval(b.flags, '0x100'), b.flags
  3867. from sysscblst a, sysrstcb b
  3868. where a.address = b.scb
  3869. and bitval(b.flags, '0x80000') = 1; { primary thread }
  3870. grant select on informix.syssessions to public as informix;
  3871. { Session activity profile }
  3872. create view informix.syssesprof(sid, lockreqs, locksheld, lockwts,
  3873. deadlks, lktouts, logrecs, isreads,
  3874. iswrites, isrewrites, isdeletes, iscommits,
  3875. isrollbacks, longtxs, bufreads, bufwrites,
  3876. seqscans, pagreads, pagwrites, total_sorts,
  3877. dsksorts, max_sortdiskspace, logspused, maxlogsp )
  3878. as
  3879. select sid,sum( upf_rqlock),sum(nlocks),sum(upf_wtlock),sum(upf_deadlk),
  3880. sum(upf_lktouts),sum(upf_lgrecs),sum(upf_isread),
  3881. sum(upf_iswrite),sum(upf_isrwrite),sum(upf_isdelete),
  3882. sum(upf_iscommit),sum(upf_isrollback),sum(upf_longtxs),
  3883. sum(upf_bufreads),sum(upf_bufwrites),sum(upf_seqscans),
  3884. sum(nreads), sum(nwrites), sum(upf_totsorts),
  3885. sum(upf_dsksorts),sum(upf_srtspmax),sum(upf_logspuse),
  3886. sum(upf_logspmax)
  3887. from sysrstcb
  3888. where sid > 0
  3889. group by sid;
  3890. grant select on informix.syssesprof to public as informix;
  3891. { system profil() data }
  3892. -- Functions with most time:
  3893. create view informix.sysprof_func (vpid, start_address, name, total_count) as
  3894. select vpid, s.address, s.name, sum(p.count) total_count
  3895. from syssymtab s, sysproftab p
  3896. where p.address between s.address and s.last_address
  3897. group by vpid, s.address, name;
  3898. grant select on informix.sysprof_func to public as informix;
  3899. -- Addresses with the most time:
  3900. create view informix.sysprof_address (vpid, start_address, name, address, count) as
  3901. select vpid, s.address start_address, s.name, p.address, p.count
  3902. from syssymtab s, sysproftab p
  3903. where p.address between s.address and s.last_address;
  3904. grant select on informix.sysprof_address to public as informix;
  3905. -- Addresses with the most time as percentage:
  3906. create view informix.sysprof_percentage(vpid, start_address, name, address, percentage) as
  3907. select vpid,
  3908. s.address start_address, s.name, p.address,
  3909. p.count / (select sum(p.count) from sysproftab p) percentage
  3910. from syssymtab s, sysproftab p
  3911. where p.address between s.address and s.last_address;
  3912. grant select on informix.sysprof_percentage to public as informix;
  3913. { User and system time by VP }
  3914. create view informix.sysvpprof (vpid, class, usercpu, syscpu)
  3915. as
  3916. select a.vpid, a.classname, a.usecs_user, a.usecs_sys
  3917. from sysvplst a
  3918. where a.flags != 6;
  3919. grant select on informix.sysvpprof to public as informix;
  3920. { Partition profile }
  3921. create view informix.sysptprof (dbsname, tabname, partnum,
  3922. lockreqs, lockwts, deadlks, lktouts,
  3923. isreads, iswrites, isrewrites, isdeletes,
  3924. bufreads, bufwrites, seqscans, pagreads,
  3925. pagwrites )
  3926. as
  3927. select a.dbsname, a.tabname, b.partnum,
  3928. b.pf_rqlock, b.pf_wtlock, b.pf_deadlk, b.pf_lktouts,
  3929. b.pf_isread, b.pf_iswrite, b.pf_isrwrite, b.pf_isdelete,
  3930. b.pf_bfcread, b.pf_bfcwrite, b.pf_seqscans, b.pf_dskreads,
  3931. b.pf_dskwrites
  3932. from systabnames a, sysptntab b
  3933. where a.partnum = b.partnum;
  3934. grant select on informix.sysptprof to public as informix;
  3935. { Profile listing }
  3936. create view informix.sysprofile ( name, value )
  3937. as
  3938. select name[4,16], value
  3939. from sysshmhdr
  3940. where name matches 'pf_*';
  3941. grant select on informix.sysprofile to public as informix;
  3942. { Buffer Profile listing. }
  3943. create view informix.sysbufprofile ( name, value )
  3944. as
  3945. select name[1,16], value
  3946. from sysshmhdr
  3947. where name matches '*_*K';
  3948. grant select on informix.sysbufprofile to public as informix;
  3949. { Auto checkpoint control block }
  3950. create view informix.sysckptinfo (name, value)
  3951. as
  3952. select name[5,16], value
  3953. from sysshmhdr
  3954. where name matches 'acp_*';
  3955. grant select on informix.sysckptinfo to public as informix;
  3956. { Listing of supported configuration parameters }
  3957. create view informix.sysconfig ( cf_id, cf_name, cf_flags, cf_original, cf_effective, cf_default )
  3958. as
  3959. select cf_id, cf_name, cf_flags, cf_original, cf_effective, cf_default
  3960. from syscfgtab
  3961. where bitval(cf_flags, '0x1') = 0;
  3962. grant select on informix.sysconfig to public as informix;
  3963. { Extent listings (keep for 6.0 compatibility) }
  3964. create view informix.sysextents ( dbsname, tabname, chunk, offset, size)
  3965. as
  3966. select dbsname, tabname, pe_chunk, pe_offset, pe_size
  3967. from systabnames a, sysptnext b
  3968. where a.partnum = b.pe_partnum;
  3969. grant select on informix.sysextents to public as informix;
  3970. { Extent listings }
  3971. create view informix.systabextents ( te_partnum, te_extnum, te_chunk, te_offset,
  3972. te_size, te_pagenum )
  3973. as select pe_partnum, pe_extnum, pe_chunk, pe_offset, pe_size, pe_log
  3974. from sysptnext;
  3975. grant select on informix.systabextents to public as informix;
  3976. { Data Replication info }
  3977. create view informix.sysdri (type, state, name, intvl, timeout, lostfound, drauto,
  3978. dridxauto)
  3979. as select b.txt, c.txt, a.name, a.intvl, a.timeout, a.lostfound,
  3980. a.drauto, a.dridxauto
  3981. from sysdrcb a, flags_text b, flags_text c
  3982. where a.type = b.flags
  3983. and b.tabname = 'sysdrcb'
  3984. and a.state = c.flags
  3985. and c.tabname = 'sysdrcb';
  3986. grant select on informix.sysdri to public as informix;
  3987. create view informix.sysha_nodes (server, type, status)
  3988. as
  3989. select ha_primary, 'Primary', 'Active' from sysha_type
  3990. union
  3991. select server_name, 'SDS', server_status from syssrcsds
  3992. union
  3993. select name, 'HDR', state from sysdri
  3994. where name != ''
  3995. and 1 in (select ha_type from sysha_type)
  3996. union
  3997. select server_name, 'RSS', server_status type from syssrcrss
  3998. union
  3999. select sysha_type.ha_secondary, 'SDS', systrgsds.connection_status
  4000. from systrgsds, sysha_type
  4001. where sysha_type.ha_secondary != ''
  4002. and 3 in (select ha_type from sysha_type)
  4003. union
  4004. select sysha_type.ha_secondary, 'HDR', sysdri.state from
  4005. sysdri, sysha_type
  4006. where sysha_type.ha_secondary != ''
  4007. and 2 in (select ha_type from sysha_type)
  4008. union
  4009. select sysha_type.ha_secondary, 'RSS', systrgrss.connection_status
  4010. from systrgrss, sysha_type
  4011. where sysha_type.ha_secondary != ''
  4012. and 4 in (select ha_type from sysha_type);
  4013. grant select on informix.sysha_nodes to public as informix;
  4014. { Databases }
  4015. create view informix.sysdatabases (name, partnum, owner, created,
  4016. is_logging, is_buff_log, is_ansi,
  4017. is_nls, is_case_insens, flags)
  4018. as
  4019. select name, partnum, owner, date(dbinfo('UTC_TO_DATETIME', created)),
  4020. bitval(flags, 1), bitval(flags, 2), bitval(flags, 4),
  4021. bitval(flags, 16), bitval(flags, 128), flags
  4022. from sysdbspartn;
  4023. grant select on informix.sysdatabases to public as informix;
  4024. { Threads view }
  4025. create view informix.systhreads (th_id, th_addr, th_joinlist, th_joinnext,
  4026. th_joinee, th_name, th_state, th_priority, th_class, th_vpid,
  4027. th_mtxwait, th_conwait, th_waketime, th_startwait,
  4028. th_startrun )
  4029. as
  4030. select tid, address, joinlist, joinnext, joinee, name, state,
  4031. priority, class, vpid, wtmutexp, wtcondp, sleep_time,
  4032. start_wait, last_run_time
  4033. from systcblst;
  4034. grant select on informix.systhreads to public as informix;
  4035. { Mutexes view }
  4036. create view informix.sysmutexes (mtx_id, mtx_address, mtx_lock, mtx_holder,
  4037. mtx_wtlist, mtx_name )
  4038. as
  4039. select mtx_id, mtx_address, mtx_lock, mtx_holder, mtx_wtlist,
  4040. mtx_name
  4041. from sysmtxlst;
  4042. grant select on informix.sysmutexes to public as informix;
  4043. { Conditions view }
  4044. create view informix.sysconditions (con_id, con_address, con_lock,
  4045. con_wtlist, con_name )
  4046. as
  4047. select con_id, con_address, con_lock, con_wtlist, con_name
  4048. from sysconlst;
  4049. grant select on informix.sysconditions to public as informix;
  4050. { Pools view }
  4051. create view informix.syspools (po_id, po_address, po_name, po_class,
  4052. po_freeamt, po_usedamt )
  4053. as
  4054. select po_id, po_address, po_name, po_class, po_freeamt, po_usedamt
  4055. from syspoollst;
  4056. grant select on informix.syspools to public as informix;
  4057. { Segments view }
  4058. create view informix.syssegments (seg_address, seg_class, seg_size, seg_osshmid,
  4059. seg_osshmkey, seg_shmaddr, seg_ovhd,
  4060. seg_blkused, seg_blkfree)
  4061. as
  4062. select seg_address, seg_class, seg_size, seg_osshmid,seg_osshmkey,
  4063. seg_shmaddr, seg_ovhd, seg_blkused, seg_blkfree
  4064. from sysseglst;
  4065. grant select on informix.syssegments to public as informix;
  4066. { Threads Wait Stats view }
  4067. create view informix.systhreadwaits (tw_tid, tw_reason, tw_num, tw_cumtime,
  4068. tw_maxtime)
  4069. as
  4070. select tid, wreason, wnum, wcumtime, wmaxtime
  4071. from systwaits;
  4072. grant select on informix.systhreadwaits to public as informix;
  4073. { Mutex queue view }
  4074. create view informix.sysmutq (mq_mtxid, mq_nwaits, mq_nservs, mq_curlen, mq_totlen,
  4075. mq_maxlen, mq_waittime, mq_servtime, mq_maxwait)
  4076. as
  4077. select mtx_id, mtx_nwaits, mtx_nservs, mtx_curlen, mtx_totlen,
  4078. mtx_maxlen, mtx_waittime, mtx_servtime, mtx_maxwait
  4079. from sysmtxlst;
  4080. grant select on informix.sysmutq to public as informix;
  4081. { Condition queue view }
  4082. create view informix.sysconq (cq_conid, cq_nwaits, cq_nservs, cq_curlen, cq_totlen,
  4083. cq_maxlen, cq_waittime, cq_servtime, cq_maxwait)
  4084. as
  4085. select con_id, con_nwaits, con_nservs, con_curlen, con_totlen,
  4086. con_maxlen, con_waittime, con_servtime, con_maxwait
  4087. from sysconlst;
  4088. grant select on informix.sysconq to public as informix;
  4089. { Userthreads }
  4090. create view informix.sysuserthreads (
  4091. us_indx, us_address, us_txp, us_txwait, us_txlist, us_iserrno,
  4092. us_isrecnum, us_isfragnum, us_uid, us_name, us_sid,
  4093. us_scb, us_tid, us_mttcb, us_nxtthread, us_flags,
  4094. us_nlocks, us_lastlktype, us_lktout, us_lkwait, us_lklist,
  4095. us_lkwttype, us_lkthreadlist, us_lktolist, us_bfwait, us_bflist,
  4096. us_bfwtflag, us_bfheldcnt, us_lbufwake, us_lgbuffered, us_rqlock,
  4097. us_wtlock, us_deadlk, us_lktouts, us_lgrecs, us_isread, us_iswrite,
  4098. us_isrwrite, us_isdelete, us_iscommit, us_isrollback, us_longtxs,
  4099. us_bufreads, us_bufwrites, us_pagreads, us_pagwrites, us_seqscans,
  4100. us_totsorts, us_dsksorts, us_srtspmax, us_logspuse, us_logspmax
  4101. ) as select
  4102. indx, address, txp, txwait, txlist, iserrno, isrecnum, isfragnum,
  4103. uid, username, sid, scb, tid, mttcb, nxtthread, flags, nlocks,
  4104. lastlock, lktout, lkwait, wtlist, lkwttype, lkthreadlist, tolist,
  4105. bfwait, bflist, bfwtflag, bfheld_count, lbufwake, bufferlogging,
  4106. upf_rqlock, upf_wtlock, upf_deadlk, upf_lktouts, upf_lgrecs,
  4107. upf_isread, upf_iswrite, upf_isrwrite, upf_isdelete, upf_iscommit,
  4108. upf_isrollback, upf_longtxs, upf_bufreads, upf_bufwrites, nreads,
  4109. nwrites, upf_seqscans, upf_totsorts, upf_dsksorts, upf_srtspmax,
  4110. upf_logspuse, upf_logspmax from sysrstcb;
  4111. grant select on informix.sysuserthreads to public as informix;
  4112. { systrans }
  4113. create view informix.systrans (
  4114. tx_id, tx_addr, tx_flags, tx_mutex, tx_logbeg, tx_loguniq, tx_logpos,
  4115. tx_lklist, tx_lkmutex, tx_owner, tx_wtlist, tx_ptlist, tx_nlocks,
  4116. tx_lktout, tx_isolevel, tx_longtx, tx_coordinator, tx_nremotes )
  4117. as select
  4118. indx, address, flags, latchp, logbeg, loguniq, logpos, lklist,
  4119. lklatchp, owner, wtlist, ptlist, nlocks, lkwait, isolevel, longtx,
  4120. istar_coord, nremotes
  4121. from systxptab;
  4122. grant select on informix.systrans to public as informix;
  4123. { Partition Headers }
  4124. create view informix.systabinfo
  4125. (
  4126. ti_partnum, ti_flags, ti_rowsize, ti_ncols, ti_nkeys, ti_nextns,
  4127. ti_pagesize, ti_created, ti_serialv, ti_fextsiz, ti_nextsiz, ti_nptotal,
  4128. ti_npused, ti_npdata, ti_octptnm, ti_nrows
  4129. )
  4130. as select
  4131. partnum, flags, rowsize, ncols, nkeys, nextns, pagesize, created, serialv,
  4132. fextsiz, nextsiz, nptotal, npused, npdata, octptnm, nrows
  4133. from sysptnhdr;
  4134. grant select on informix.systabinfo to public as informix;
  4135. { Page Headers
  4136. create view informix.systabpaghdrs
  4137. ( pg_partnum, pg_pagenum, pg_chunk, pg_offset, pg_stamp, pg_chksum,
  4138. pg_pagesize, pg_nslots, pg_flags, pg_frptr, pg_frcnt, pg_next, pg_prev )
  4139. as select pg_partnum, pg_pagenum, pg_chunk, pg_offset, pg_stamp,
  4140. pg_chksum, pg_pagesize, pg_nslots, pg_flags, pg_frptr,
  4141. pg_frcnt, pg_next from syspaghdr where
  4142. pg_partnum > 1048576;
  4143. grant select on informix.systabpaghdrs to public as informix;
  4144. }
  4145. { Page Headers }
  4146. create view informix.sysphyspaghdrs
  4147. ( pg_pagenum, pg_chunk, pg_offset, pg_stamp, pg_chksum,
  4148. pg_pagesize, pg_nslots, pg_flags, pg_frptr, pg_frcnt, pg_next, pg_prev )
  4149. as select
  4150. pg_pagenum, pg_chunk, pg_offset, pg_stamp, pg_chksum,
  4151. pg_pagesize, pg_nslots, pg_flags, pg_frptr, pg_frcnt, pg_next, pg_prev
  4152. from syspaghdr where
  4153. pg_partnum = 0;
  4154. grant select on informix.sysphyspaghdrs to public as informix;
  4155. { C2 Audit mask table }
  4156. create table informix.sysaudit
  4157. (
  4158. username char(32), { user name }
  4159. succ1 integer, { success bitmask 1 }
  4160. succ2 integer, { success bitmask 2 }
  4161. succ3 integer, { success bitmask 3 }
  4162. succ4 integer, { success bitmask 4 }
  4163. succ5 integer, { success bitmask 5 }
  4164. succ6 integer, { success bitmask 6 }
  4165. succ7 integer, { success bitmask 7 }
  4166. succ8 integer, { success bitmask 8 }
  4167. fail1 integer, { failure bitmask 1 }
  4168. fail2 integer, { failure bitmask 2 }
  4169. fail3 integer, { failure bitmask 3 }
  4170. fail4 integer, { failure bitmask 4 }
  4171. fail5 integer, { failure bitmask 5 }
  4172. fail6 integer, { failure bitmask 6 }
  4173. fail7 integer, { failure bitmask 7 }
  4174. fail8 integer { failure bitmask 8 }
  4175. ) lock mode row;
  4176. create unique index informix.sysaudit_ix1 on sysaudit(username) in table;
  4177. revoke all on informix.sysaudit from public as informix;
  4178. { Chunk io stats }
  4179. create view informix.syschkio (chunknum,
  4180. reads, pagesread,
  4181. writes, pageswritten,
  4182. mreads, mpagesread,
  4183. mwrites, mpageswritten)
  4184. as
  4185. select a.chknum,
  4186. a.reads, a.pagesread,
  4187. a.writes, a.pageswritten,
  4188. b.reads, b.pagesread,
  4189. b.writes, b.pageswritten
  4190. from syschktab_fast a, outer sysmchktab_fast b
  4191. where a.chknum > 0
  4192. and a.chknum = b.chknum;
  4193. grant select on informix.syschkio to public as informix;
  4194. { Locale in which the database was created in }
  4195. create view informix.sysdbslocale (dbs_dbsname, dbs_collate)
  4196. as
  4197. select b.name, a.collate
  4198. from systabnames a, sysdbspartn b
  4199. where a.partnum = b.partnum;
  4200. grant select on informix.sysdbslocale to public as informix;
  4201. { SQL Dictionary cache }
  4202. create view informix.sysdiccache (dic_hashno, dic_chainno,
  4203. dic_refcount, dic_dirtyflag, dic_heapptr,
  4204. dic_dbname, dic_servername, dic_ownername, dic_tabname)
  4205. as
  4206. select dic_hashno, dic_chainno,
  4207. dic_refcount, bitval(dic_flags, '0x00800000'), hex(dic_heapptr),
  4208. dic_dbname, dic_servername, dic_ownername, dic_tabname
  4209. from sysdic;
  4210. grant select on informix.sysdiccache to public as informix;
  4211. { SQL Distribution cache }
  4212. create view informix.sysdistcache (dis_hashno, dis_chainno,
  4213. dis_id, dis_refcount, dis_dropped, dis_heapptr,
  4214. dis_dbname, dis_servername, dis_ownername, dis_distname)
  4215. as
  4216. select dis_hashno, dis_chainno,
  4217. dis_id, dis_refcnt, dis_delete, hex(dis_heapptr),
  4218. dis_dbname, dis_servername, dis_ownername, dis_name
  4219. from sysdsc;
  4220. grant select on informix.sysdistcache to public as informix;
  4221. { SQL Procedure cache }
  4222. create view informix.sysproccache (prc_hashno, prc_chainno,
  4223. prc_id, prc_refcount, prc_dropped, prc_heapptr,
  4224. prc_dbname, prc_servername, prc_ownername, prc_procname)
  4225. as
  4226. select prc_hashno, prc_chainno,
  4227. prc_id, prc_refcnt, prc_delete, hex(prc_heapptr),
  4228. prc_dbname, prc_servername, prc_ownername, prc_name
  4229. from sysprc;
  4230. grant select on informix.sysproccache to public as informix;
  4231. { SQL Statements }
  4232. create view informix.syssqlcurall (
  4233. sqc_sessionid, sqc_currdb, sqc_isolationlevel, sqc_lockmode, sqc_sqerrno,
  4234. sqc_isamerr, sqc_fevers)
  4235. as
  4236. select scb_sessionid, odb_dbname, ft.txt, scb_lockmode,
  4237. scb_sqerrno, scb_iserrno, scb_feversion
  4238. from syssqscb, outer ( sysopendb, flags_text ft )
  4239. where scb_sessionid == odb_sessionid
  4240. and odb_iscurrent == 'Y'
  4241. and ft.tabname == 'sysopendb'
  4242. and ft.flags == odb_isolation
  4243. and scb_feversion > '0.00';
  4244. { SQL Current session }
  4245. create view informix.syssqlcurses (
  4246. scs_sessionid, scs_currdb, scs_isolationlevel, scs_lockmode,
  4247. scs_executions, scs_cumtime, scs_bufreads, scs_pagereads,
  4248. scs_bufwrites, scs_pagewrites, scs_totsorts, scs_dsksorts,
  4249. scs_sortspmax, scs_sqerrno, scs_isamerr, scs_fevers,
  4250. scs_sqlstatement)
  4251. as
  4252. select scb_sessionid, odb_dbname, ft.txt, scb_lockmode, sdb_executions,
  4253. sdb_cumtime, sdb_bufreads, sdb_pagereads, sdb_bufwrites,
  4254. sdb_pagewrites, sdb_totsorts, sdb_dsksorts, sdb_sortspmax,
  4255. scb_sqerrno, scb_iserrno, scb_feversion, cbl_stmt
  4256. from syssqscb, syssdblock, outer sysconblock,
  4257. outer ( sysopendb, flags_text ft )
  4258. where scb_sessionid == odb_sessionid
  4259. and scb_sessionid == sdb_sessionid
  4260. and scb_sessionid == cbl_sessionid
  4261. and scb_feversion > '0.00'
  4262. and sdb_sdbno == cbl_sdbno
  4263. and sdb_iscurrent == 'Y'
  4264. and odb_iscurrent == 'Y'
  4265. and cbl_ismainblock == 'Y'
  4266. and ft.tabname == 'sysopendb'
  4267. and ft.flags == odb_isolation
  4268. ;
  4269. { Show feature information }
  4270. create view sysfeatures ( { Internal Use Only }
  4271. week, year, version, max_cpu_vps, max_vps,
  4272. max_conns, max_sec_conns, max_sds_clones, max_rss_clones,
  4273. total_size, total_size_used,
  4274. max_memory, max_memory_used, is_primary, is_secondary,
  4275. is_sds, is_rss, is_er, is_pdq )
  4276. AS
  4277. select week, year, version, max_cpu_vps, max_vps,
  4278. max_conns, max_sec_conns, max_sds_clones, max_rss_clones,
  4279. format_units(total_size,'M'),
  4280. format_units(total_size_used,'M'),
  4281. format_units(max_memory,'M'),
  4282. format_units(max_memory_used,'M'),
  4283. decode(bitand(feature_flags, 1),0,0,1),
  4284. decode(bitand(feature_flags, 2),0,0,1),
  4285. decode(bitand(feature_flags, 8),0,0,1),
  4286. decode(bitand(feature_flags, 4),0,0,1),
  4287. decode(bitand(feature_flags, 16),0,0,1),
  4288. decode(bitand(feature_flags, 512),0,0,1)
  4289. from syslicenseinfo
  4290. ;
  4291. { Show sqexplain information }
  4292. create view informix.syssqexplain ( { Internal Use Only }
  4293. sqx_sessionid, sqx_sdbno, sqx_iscurrent, sqx_executions,
  4294. sqx_cumtime, sqx_bufreads, sqx_pagereads, sqx_bufwrites,
  4295. sqx_pagewrites, sqx_totsorts, sqx_dsksorts, sqx_sortspmax,
  4296. sqx_conbno, sqx_ismain, sqx_selflag, sqx_estcost, sqx_estrows,
  4297. sqx_seqscan, sqx_srtscan, sqx_autoindex, sqx_index, sqx_remsql,
  4298. sqx_mrgjoin, sqx_dynhashjoin, sqx_keyonly, sqx_tempfile,
  4299. sqx_tempview, sqx_secthreads, sqx_sqlstatement)
  4300. as
  4301. select sdb_sessionid, sdb_sdbno, sdb_iscurrent, sdb_executions,
  4302. sdb_cumtime, sdb_bufreads, sdb_pagereads, sdb_bufwrites,
  4303. sdb_pagewrites, sdb_totsorts, sdb_dsksorts, sdb_sortspmax,
  4304. cbl_conbno, cbl_ismainblock, ft.txt, cbl_estcost, cbl_estrows,
  4305. cbl_seqscan, cbl_srtscan, cbl_autoindex, cbl_index, cbl_remsql,
  4306. cbl_mrgjoin, cbl_dynhashjoin, cbl_keyonly, cbl_tempfile,
  4307. cbl_tempview, cbl_secthreads, cbl_stmt
  4308. from syssdblock, outer ( sysconblock, flags_text ft )
  4309. where sdb_sessionid == cbl_sessionid
  4310. and sdb_sdbno == cbl_sdbno
  4311. and ft.tabname == 'sqltype'
  4312. and ft.flags == cbl_selflag
  4313. ;
  4314. { Connection Manager }
  4315. create view informix.syscmsm ( sid, name, host,
  4316. unit, type, servers, foc, flag,
  4317. sla_name, sla_define, connections)
  4318. as select syscmsmtab.sid, syscmsmtab.name, syscmsmtab.host,
  4319. syscmsmunit.unit, syscmsmunit.type, syscmsmunit.servers,
  4320. syscmsmunit.foc, syscmsmunit.flag,
  4321. sla_name, sla_define, connections
  4322. from syscmsmtab, syscmsmunit, syscmsmsla
  4323. where syscmsmtab.sid = syscmsmsla.sid
  4324. and syscmsmtab.sid = syscmsmunit.sid
  4325. and syscmsmunit.unit = syscmsmsla.unit;
  4326. grant select on informix.syscmsm to public as informix;
  4327. { Compression Dictionaries }
  4328. create view informix.syscompdicts (dict_partnum, dict_code_version, dict_dbsnum,
  4329. dict_create_timestamp, dict_create_loguniqid,
  4330. dict_create_logpos, dict_drop_timestamp,
  4331. dict_drop_loguniqid, dict_drop_logpos)
  4332. as
  4333. select dict_partnum, dict_code_version, dict_dbsnum,
  4334. dict_create_timestamp, dict_create_loguniqid,
  4335. dict_create_logpos, dict_drop_timestamp,
  4336. dict_drop_loguniqid, dict_drop_logpos
  4337. from syscompdicts_full;
  4338. grant select on informix.syscompdicts to public as informix;
  4339. { AQT tables }
  4340. create view informix.sysaqttab (aqt,dbname,tabid,fact) as
  4341. select distinct a.aqt, a.dbname, tabid,
  4342. case when factid = tabid then 1 else 0 end
  4343. from sysaqt a, sysaqtjp j
  4344. where a.aqt = j.aqt;
  4345. grant select on informix.sysaqttab to public as informix;
  4346. { DWA coordinators }
  4347. create view informix.sysdwacoord (dwa, coord, ip, port) as
  4348. select trim(i.dbsvrnm),trim(c.dbsvrnm),trim(c.hostname),trim(c.svcname)
  4349. from syssqlhosts i,syssqlhosts c
  4350. where i.nettype = 'group'
  4351. and i.dbsvrnm = c.svrgroup
  4352. and c.svrtype = 'dw';
  4353. grant select on informix.sysdwacoord to public as informix;
  4354. { Grid ID }
  4355. create view informix.sysgrid(gridid, gridname) as
  4356. select ifx_node_id(), ifx_node_name()
  4357. from systables where tabid = 1;
  4358. revoke all on informix.sysgrid from public as informix;
  4359. grant select on informix.sysgrid to public as informix;
  4360. { Extspaces Table }
  4361. create table informix.sysextspaces { Internal Use Only }
  4362. (
  4363. id integer, { external space id }
  4364. name char(128), { extspace name }
  4365. owner char(32), { extspace owner }
  4366. flags integer, { extspace flags }
  4367. refcnt integer, { extspace reference count }
  4368. locsize integer, { size of location }
  4369. locatio char(256) { external space location }
  4370. );
  4371. create unique index informix.sysextspace_ix1 on sysextspaces(name) in table;
  4372. revoke all on informix.sysextspaces from public as informix;
  4373. grant select on informix.sysextspaces to public as informix;
  4374. { Create stored procedure start_onpload }
  4375. create procedure informix.start_onpload(args char(200)) returning int;
  4376. define command char(255); -- build command string here
  4377. define rtnsql int; -- place holder for exception sqlcode setting
  4378. define rtnisam int; -- isam error code. Should be onpload exit status
  4379. define osname char(128); -- Operating System name.
  4380. {If $INFORMIXDIR/bin/onpload not found try /usr/informix/bin/onpload}
  4381. on exception in (-668) set rtnsql, rtnisam
  4382. if (osname != 'Windows') then
  4383. if rtnisam = -1 then
  4384. let command = '/usr/informix/bin/onpload ' || args;
  4385. system (command);
  4386. return 0;
  4387. end if
  4388. end if
  4389. return rtnisam;
  4390. end exception
  4391. if (args matches '*[;$%]*') then
  4392. return -1;
  4393. end if;
  4394. SELECT os_name into osname from sysmachineinfo;
  4395. if (osname = 'Windows') then
  4396. let command = 'cmd /c %INFORMIXDIR%\bin\onpload ' || args;
  4397. else
  4398. let command = '$INFORMIXDIR/bin/onpload ' || args;
  4399. end if
  4400. system (command);
  4401. return 0;
  4402. end procedure;
  4403. grant execute on informix.start_onpload to public as informix;
  4404. { Create UDR functions for memory resident tables }
  4405. create DBA function informix.ifx_make_res(integer)
  4406. returning integer
  4407. external name '(ifx_res_pnum)'
  4408. language c;
  4409. create DBA function informix.ifx_make_unres(integer)
  4410. returning integer
  4411. external name '(ifx_unres_pnum)'
  4412. language c;
  4413. create DBA function informix.ifx_make_res(char(256))
  4414. returning integer
  4415. external name '(ifx_res_name)'
  4416. language c;
  4417. create DBA function informix.ifx_make_unres(char(256))
  4418. returning integer
  4419. external name '(ifx_unres_name)'
  4420. language c;
  4421. create function string_to_utf8(string lvarchar(4096), source_locale lvarchar)
  4422. returns lvarchar
  4423. external name '(string_to_utf8)'
  4424. language C;
  4425. create function informix.yieldn()
  4426. returns informix.integer
  4427. external name '(admin_yield)'
  4428. language C;
  4429. create function informix.yieldn(informix.integer)
  4430. returns informix.integer
  4431. external name '(admin_yieldn)'
  4432. language C;
  4433. create function informix.getcurtime()
  4434. returns informix.integer
  4435. external name '(admin_current_time)'
  4436. language C;
  4437. create DBA function informix.ifx_get_service(lvarchar)
  4438. returning integer
  4439. external name '(ifxGetService)'
  4440. language c;
  4441. grant execute on informix.ifx_get_service to public as informix;
  4442. create DBA function informix.ifx_get_hostaddr(lvarchar)
  4443. returning lvarchar
  4444. external name '(ifxGetHostAddr)'
  4445. language c;
  4446. grant execute on informix.ifx_get_hostaddr to public as informix;
  4447. create DBA function informix.vpclass_to_classid(lvarchar)
  4448. returns integer
  4449. external name '(vpclass_to_classid)'
  4450. language c;
  4451. grant execute on informix.vpclass_to_classid to public as informix;
  4452. update sysprocedures set mode = 'o' where procname = 'bitval';
  4453. update sysprocedures set mode = 'o' where procname = 'l2date';
  4454. update sysprocedures set mode = 'o' where procname = 'physchunk';
  4455. update sysprocedures set mode = 'o' where procname = 'physpage';
  4456. update sysprocedures set mode = 'o' where procname = 'physaddr';
  4457. update sysprocedures set mode = 'o' where procname = 'partdbsnum';
  4458. update sysprocedures set mode = 'o' where procname = 'partpagenum';
  4459. update sysprocedures set mode = 'o' where procname = 'partaddr';
  4460. update sysprocedures set mode = 'o' where procname = 'start_onpload';
  4461. update sysprocedures set mode = 'd' where procname = 'ifx_make_res';
  4462. update sysprocedures set mode = 'd' where procname = 'ifx_make_unres';
  4463. grant connect to public;
  4464. update statistics;
  4465. close database;
  4466. {*******************************************************************}
  4467. { See if we need to add the cdr views as part of the (re)build of }
  4468. { sysmaster database. }
  4469. {*******************************************************************}
  4470. database sysmaster;
  4471. create procedure syscheckcdr()
  4472. define rslt integer;
  4473. define cmd char(1000);
  4474. define osname char(128);
  4475. define version decimal;
  4476. select count(*) into rslt from sysmaster:sysdatabases
  4477. where name = 'syscdr';
  4478. if (rslt == 1) then
  4479. select os_name into osname from sysmachineinfo;
  4480. select verstamp into version from syscdr:'informix'.gcversion;
  4481. { Note: Keep this in sync with syscdr.sql }
  4482. if (version == 9) then
  4483. if (osname = 'Windows') then
  4484. let cmd = 'cmd /c dbaccess sysmaster %INFORMIXDIR%\etc\syscdrview.sql';
  4485. else
  4486. let cmd = 'dbaccess sysmaster $INFORMIXDIR/etc/syscdrview.sql';
  4487. end if;
  4488. system(cmd);
  4489. end if;
  4490. end if;
  4491. end procedure;
  4492. execute procedure syscheckcdr();
  4493. drop procedure syscheckcdr;
  4494. close database;