1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530
| #!/bin/bash
echo "" echo "Begin to collect data for GBASEDBTSERVER:"${GBASEDBTSERVER} echo "" mytime=`date '+%Y%m%d%H%M%S'` outpath="GBase8schk_${GBASEDBTSERVER}_${mytime}" if [ ! -d ${outpath} ]; then mkdir ${outpath} fi
echo "collect machine info using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/machine.unl delimiter '|' select os_name,os_release,os_nodename,os_version,os_machine,os_num_procs,os_num_olprocs, os_pagesize,os_mem_total,os_mem_free,os_open_file_lim,os_shmmax from sysmachineinfo; EOF
echo "collect instance info using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/instance.unl delimiter '|' select dbinfo('UTC_TO_DATETIME',sh_boottime)||' T' start_time, (current year to second - dbinfo('UTC_TO_DATETIME',sh_boottime))||' T' run_time, sh_maxchunks as maxchunks, sh_maxdbspaces maxdbspaces, sh_maxuserthreads maxuserthreads, sh_maxtrans maxtrans, sh_maxlocks locks, sh_longtx longtxs, dbinfo('UTC_TO_DATETIME',sh_pfclrtime)||' T' onstat_z_running_time from sysshmvals; EOF
echo "collect cpuvp info using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/cpuvp.unl delimiter '|' select vpid,classname class,pid,round(usecs_user,2) user_cpu,round(usecs_sys,2) sys_cpu,num_ready, total_semops,total_busy_wts,total_yields,total_spins,vp_cache_size,vp_cache_allocs from sysvplst ; EOF
echo "collect instance memory info using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/memory.unl delimiter '|' select indx,bufsize pagesize, nbuffs buffers, round(nbuffs*bufsize/1024/1024/1024,2)||'GB' buffsize, nlrus,mindirty,maxdirty, (bufwaits / (bufwrites + pagreads)) * 100.00 buff_wait_rate, 100 * (bufreads-dskreads)/ bufreads buff_read_rate, 100 * (bufwrites-dskwrites)/ bufwrites buff_write_rate, fgwrites,lruwrites ,chunkwrites from sysbufpool; EOF
echo "collect sqlhosts info using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/sqlhosts.unl delimiter '|' select dbsvrnm,nettype,hostname,svcname,options, svrsecurity,netbuf_size,svrgroup from syssqlhosts; EOF
echo "collect session runtime info using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/sessiontime.unl delimiter '|' SELECT first 500 s.sid, s.username, s.hostname, q.odb_dbname database, dbinfo('UTC_TO_DATETIME',s.connected) conection_time, dbinfo('UTC_TO_DATETIME',t.last_run_time) last_run_time, current - dbinfo('UTC_TO_DATETIME',s.connected) connected_since, current - dbinfo('UTC_TO_DATETIME',t.last_run_time) idle_time FROM syssessions s, systcblst t, sysrstcb r, sysopendb q WHERE t.tid = r.tid AND s.sid = r.sid AND s.sid = q.odb_sessionid ORDER BY 8 DESC; EOF
echo "collect session waits info using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/sessionwait.unl delimiter '|' select first 20 sid,pid, username, hostname, is_wlatch, -- blocked waiting on a latch is_wlock, -- blocked waiting on a locked record or table is_wbuff, -- blocked waiting on a buffer is_wckpt, -- blocked waiting on a checkpoint is_incrit -- session is in a critical section of transaction-- (e.g writting to disk) from syssessions order by is_wlatch+is_wlock+is_wbuff+is_wckpt+is_incrit desc; EOF
echo "collect session IO info using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/sessionio.unl delimiter '|' select first 100 syssesprof.sid,isreads,iswrites,isrewrites, isdeletes,bufreads,bufwrites,seqscans , pagreads ,pagwrites,total_sorts ,dsksorts , max_sortdiskspace,logspused from syssesprof, syssessions where syssesprof.sid = syssessions.sid order by bufreads+bufwrites desc ; EOF
echo "collect checkpoint info using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/checkpoint.unl delimiter '|' select intvl,type,caller,dbinfo('UTC_TO_DATETIME',clock_time)||' T' clock_time, round(crit_time,4),round(flush_time,4),round(cp_time,4),n_dirty_buffs, plogs_per_sec,llogs_per_sec,dskflush_per_sec,ckpt_logid,ckpt_logpos,physused,logused, n_crit_waits,tot_crit_wait,longest_crit_wait,block_time from syscheckpoint order by intvl; EOF
echo "collect database info using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/database.unl delimiter '|' SELECT trim(name) dbname,trim(owner) owner, created||' T' created_time, TRIM(DBINFO('dbspace',partnum)) AS dbspace, CASE WHEN is_logging+is_buff_log=1 THEN "Unbuffered logging" WHEN is_logging+is_buff_log=2 THEN "Buffered logging" WHEN is_logging+is_buff_log=0 THEN "No logging" ELSE "" END Logging_mode FROM sysdatabases where trim(name) not like 'sys%'; EOF
echo "collect dbspaces info using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/dbspace.unl delimiter '|' SELECT A.dbsnum as No, trim(B.name) as name, CASE WHEN (bitval(B.flags,'0x10')>0 AND bitval(B.flags,'0x2')>0) THEN 'MirroredBlobspace' WHEN bitval(B.flags,'0x10')>0 THEN 'Blobspace' WHEN bitval(B.flags,'0x2000')>0 AND bitval(B.flags,'0x8000')>0 THEN 'TempSbspace' WHEN bitval(B.flags,'0x2000')>0 THEN 'TempDbspace' WHEN (bitval(B.flags,'0x8000')>0 AND bitval(B.flags,'0x2')>0) THEN 'MirroredSbspace' WHEN bitval(B.flags,'0x8000')>0 THEN 'SmartBlobspace' WHEN bitval(B.flags,'0x2')>0 THEN 'MirroredDbspace' ELSE 'Dbspace' END as dbstype, round(sum(chksize)*2/1024/1024,2)||'GB' as DBS_SIZE , round(sum(decode(mdsize,-1,nfree,udfree))*2/1024/1024,2)||'GB' as free_size, case when sum(decode(mdsize,-1,nfree,udfree))*100/sum(decode(mdsize,-1,chksize,udsize)) >sum(decode(mdsize,-1,nfree,nfree))*100/sum(decode(mdsize,-1,chksize,mdsize)) then TRUNC(100-sum(decode(mdsize,-1,nfree,nfree))*100/sum(decode(mdsize,-1,chksize,mdsize)),2)||"%" else TRUNC(100-sum(decode(mdsize,-1,nfree,udfree))*100/sum(decode(mdsize,-1,chksize,udsize)),2)||"%" end as used, TRUNC(MAX(A.pagesize/1024))||"KB" as pgsize, MAX(B.nchunks) as nchunks FROM syschktab A, sysdbstab B WHERE A.dbsnum = B.dbsnum GROUP BY A.dbsnum,name, 3 ORDER BY A.dbsnum; EOF
echo "collect chunk info using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/chunks.unl delimiter '|' SELECT A.chknum as num, B.name as spacename, TRUNC((A.pagesize/1024)) as pgsize, A.offset offset, round( A.chksize*2/1024/1024,2)||'GB' as size, round(decode(A.mdsize,-1,A.nfree,A.udfree)*2/1024/1024,2)||'GB' as free, TRUNC(100 - decode(A.mdsize,-1,A.nfree,A.udfree)*100/A.chksize,2 ) as used, A.fname FROM syschktab A, sysdbstab B WHERE A.dbsnum = B.dbsnum order by B.dbsnum; EOF
echo "collect chunk IO using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/chunk_io.unl delimiter '|' select d.name dbspace, fname[1,125] chunk_name,reads read_count,writes write_count, reads+writes total_count,pagesread,pageswritten, pagesread+pageswritten total_pg from sysmaster:syschkio c, sysmaster:syschunks k, sysmaster:sysdbspaces d where d.dbsnum = k.dbsnum and k.chknum = c.chunknum order by 8 desc; EOF
echo "collect logical log using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/logicallog.unl delimiter '|' SELECT A.number as num, A.uniqid as uid, round(A.size*2/1024,2)||'MB' as size, TRIM( TRUNC(A.used*100/A.size,0)||'%') as used, d.name as spacename, TRIM( A.chunk||'_'||A.offset ) as location, decode(A.filltime,0,'NotFull', dbinfo('UTC_TO_DATETIME', A.filltime)::varchar(50))||' T' as filltime, CASE WHEN bitval(A.flags,'0x1') > 0 AND bitval(A.flags,'0x4')>0 THEN 'UsedBackedUp' WHEN bitval(A.flags,'0x1') > 0 AND bitval(A.flags,'0x2')>0 THEN 'UsedCurrent' WHEN bitval(A.flags,'0x1') > 0 THEN 'Used' ELSE hex(A.flags)::varchar(50) END as flags, CASE WHEN A.filltime-B.filltime > 0 THEN round(CAST(TRUNC(A.size/(A.filltime-B.filltime),4) as varchar(20))*2/1024,2)||'MB/S' ELSE ' N/A ' END as pps FROM syslogfil A, syslogfil B,syschktab c, sysdbstab d WHERE A.uniqid-1 = B.uniqid and c.dbsnum = d.dbsnum and a.chunk=c.chknum UNION SELECT A.number as num, A.uniqid as uid, round(A.size*2/1024,2)||'MB' as size, TRIM( TRUNC(A.used*100/A.size,0)||'%') as used, d.name as spacename, TRIM( A.chunk||'_'||A.offset ) as location, decode(A.filltime,0,'NotFull', dbinfo('UTC_TO_DATETIME', A.filltime)::varchar(50))||' T' as filltime, CASE WHEN bitval(A.flags,'0x1') > 0 AND bitval(A.flags,'0x4')>0 THEN 'UsedBackedUp' WHEN bitval(A.flags,'0x1') > 0 AND bitval(A.flags,'0x2')>0 THEN 'UsedCurrent' WHEN bitval(A.flags,'0x1') > 0 THEN 'Used' WHEN bitval(A.flags,'0x8') > 0 THEN 'NewAdd' ELSE hex(A.flags)::varchar(50) END as flags, 'N/A' as pps FROM syslogfil A ,syschktab c, sysdbstab d WHERE ( A.uniqid = (SELECT min(uniqid) FROM syslogfil WHERE uniqid > 0) OR A.uniqid = 0 ) and c.dbsnum = d.dbsnum and a.chunk=c.chknum ORDER BY A.uniqid ; EOF
echo "collect table locks using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/tab_actlock.unl delimiter '|' select dbsname,tabname, sum(pf_rqlock) as locks, sum(pf_wtlock) as lockwaits, sum(pf_deadlk) as deadlocks from sysactptnhdr,systabnames where systabnames.partnum = sysactptnhdr.partnum group by dbsname,tabname order by lockwaits,locks desc; EOF dbaccess sysmaster - << EOF unload to ./${outpath}/tab_lock.unl delimiter '|' select dbsname,tabname, sum(lockreqs) as lockreqs, sum(lockwts) as lockwaits, sum(deadlks) as deadlocks from sysptprof group by dbsname,tabname order by deadlocks,lockwaits,lockreqs desc; EOF
echo "collect database used space using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/database_space.unl delimiter '|' select t1.dbsname, round(sum(ti_nptotal)*max(ti_pagesize)/1024/1024/1024,2)||'GB' allocated_size, round(sum(ti_npused)*max(ti_pagesize)/1024/1024/1024,2)||'GB' used_size from systabnames t1, systabinfo t2,sysdatabases t3 where t1.partnum = t2.ti_partnum and trim(t3.name)=trim(t1.dbsname) group by dbsname order by sum(ti_nptotal) desc; EOF
echo "collect table and index used space using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/tab_space.unl delimiter '|' SELECT st.dbsname databasename, st.tabname, MAX(dbinfo('UTC_TO_DATETIME',sin.ti_created)) createdtime, SUM( sin.ti_nextns ) extents, SUM( sin.ti_nrows ) nrows, MAX( sin.ti_nkeys ) nkeys, MAX( sin.ti_pagesize ) pagesize, SUM( sin.ti_nptotal ) nptotal, round(SUM( sin.ti_nptotal*sd.pagesize )/1024/1024,2)||'MB' total_size, SUM( sin.ti_npused ) npused, round(SUM( sin.ti_npused*sd.pagesize )/1024/1024,2)||'MB' used_size, SUM( sin.ti_npdata ) npdata, round(SUM( sin.ti_npdata*sd.pagesize )/1024/1024,2)||'MB' data_size FROM sysmaster:systabnames st, sysmaster:sysdbspaces sd, sysmaster:systabinfo sin WHERE sd.dbsnum = trunc(st.partnum / 1048576) AND st.partnum = sin.ti_partnum AND st.dbsname NOT IN ('sysmaster','sysuser','sysadmin','sysutils','sysha','syscdr','syscdcv1') AND st.tabname[1,3] NOT IN ('sys','TBL') GROUP BY 1, 2 ORDER BY 9 DESC; EOF
echo "collect table and index partition used space using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/tab_space_frag.unl delimiter '|' SELECT st.dbsname databasename, st.tabname,st.partnum partnum, dbinfo('UTC_TO_DATETIME',sin.ti_created) createdtime, sin.ti_nextns extents, sin.ti_nrows nrows, sin.ti_nkeys nkeys, sin.ti_pagesize pagesize, sin.ti_nptotal nptotal, round(( sin.ti_nptotal*sd.pagesize )/1024/1024,2)||'MB' total_size, ( sin.ti_npused ) npused, round(( sin.ti_npused*sd.pagesize )/1024/1024,2)||'MB' used_size, ( sin.ti_npdata ) npdata, round(( sin.ti_npdata*sd.pagesize )/1024/1024,2)||'MB' data_size FROM sysmaster:systabnames st, sysmaster:sysdbspaces sd, sysmaster:systabinfo sin WHERE sd.dbsnum = trunc(st.partnum / 1048576) AND st.partnum = sin.ti_partnum AND st.dbsname NOT IN ('sysmaster','sysuser','sysadmin','sysutils','sysha','syscdr','syscdcv1') AND st.tabname[1,3] NOT IN ('sys','TBL') ORDER BY 9 DESC; EOF
echo "collect table and index io and seqscans using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/tab_io.unl delimiter '|' SELECT st.dbsname,p.tabname,SUM( sin.ti_nrows ) nrows, round(SUM( sin.ti_nptotal*sd.pagesize )/1024/1024,2)||'MB' total_size, round(SUM( sin.ti_npused*sd.pagesize )/1024/1024,2)||'MB' used_size, SUM( seqscans ) AS seqscans, SUM( pagreads ) diskreads, SUM( bufreads ) bufreads, SUM( bufwrites ) bufwrites, SUM( pagwrites ) diskwrites, SUM( pagreads )+ SUM( pagwrites ) disk_rsws, trunc(decode(SUM( bufreads ),0,0,(100 -((SUM( pagreads )* 100)/ SUM( bufreads + pagreads )))),2) AS rbufhits, trunc(decode(SUM( bufwrites ),0,0,(100 -((SUM( pagwrites )* 100)/ SUM( bufwrites + pagwrites )))),2) AS wbufhits FROM sysmaster:sysptprof p, sysmaster:systabinfo sin, sysmaster:sysdbspaces sd, sysmaster:systabnames st WHERE sd.dbsnum = trunc(st.partnum / 1048576) AND p.partnum = st.partnum AND st.partnum = sin.ti_partnum AND st.dbsname NOT IN ('sysmaster','sysuser','sysadmin','sysutils','sysha','syscdr','syscdcv1') AND st.tabname[1,3] NOT IN ('sys','TBL') GROUP BY 1, 2 ORDER BY 11 DESC; EOF
echo "collect current slowest sql using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/slowsql.unl delimiter '|' Select first 100 sqx_estcost,sqx_estrows,sqx_sqlstatement FROM sysmaster:syssqexplain order by sqx_estcost desc; EOF
echo "collect tables statistics,lockmode,index keys using sql ......" dbaccess sysmaster - << EOF unload to ./${outpath}/tabstat.sql delimiter ";" select "unload to ./${outpath}/"||trim(name)||"_stat.unl Select t.tabname,t.created as tabcreated,t.nrows,tmpt.nrows as realrows,t.locklevel,t.ustlowts,i.idxname,"|| "trim(case when i.part1>0 then (select colname from "||trim(name)||":syscolumns where colno=i.part1 and tabid=i.tabid) else '' end)||"|| "trim(case when i.part2>0 then (select ','||colname from "||trim(name)||":syscolumns where colno=i.part2 and tabid=i.tabid) else '' end)||"|| "trim(case when i.part3>0 then (select ','||colname from "||trim(name)||":syscolumns where colno=i.part3 and tabid=i.tabid) else '' end)||"|| "trim(case when i.part4>0 then (select ','||colname from "||trim(name)||":syscolumns where colno=i.part4 and tabid=i.tabid) else '' end)||"|| "trim(case when i.part5>0 then (select ','||colname from "||trim(name)||":syscolumns where colno=i.part5 and tabid=i.tabid) else '' end)||"|| "trim(case when i.part6>0 then (select ','||colname from "||trim(name)||":syscolumns where colno=i.part6 and tabid=i.tabid) else '' end)||"|| "trim(case when i.part7>0 then (select ','||colname from "||trim(name)||":syscolumns where colno=i.part7 and tabid=i.tabid) else '' end)||"|| "trim(case when i.part8>0 then (select ','||colname from "||trim(name)||":syscolumns where colno=i.part8 and tabid=i.tabid) else '' end)||"|| "trim(case when i.part9>0 then (select ','||colname from "||trim(name)||":syscolumns where colno=i.part9 and tabid=i.tabid) else '' end)||"|| "trim(case when i.part10>0 then (select ','||colname from "||trim(name)||":syscolumns where colno=i.part10 and tabid=i.tabid) else '' end)||"|| "trim(case when i.part11>0 then (select ','||colname from "||trim(name)||":syscolumns where colno=i.part11 and tabid=i.tabid) else '' end)||"|| "trim(case when i.part12>0 then (select ','||colname from "||trim(name)||":syscolumns where colno=i.part12 and tabid=i.tabid) else '' end)||"|| "trim(case when i.part13>0 then (select ','||colname from "||trim(name)||":syscolumns where colno=i.part13 and tabid=i.tabid) else '' end)||"|| "trim(case when i.part14>0 then (select ','||colname from "||trim(name)||":syscolumns where colno=i.part14 and tabid=i.tabid) else '' end)||"|| "trim(case when i.part15>0 then (select ','||colname from "||trim(name)||":syscolumns where colno=i.part15 and tabid=i.tabid) else '' end)||"|| "trim(case when i.part16>0 then (select ','||colname from "||trim(name)||":syscolumns where colno=i.part16 and tabid=i.tabid) else '' end ) index_cols"|| ",i.nunique "|| "from "||trim(name)||":systables t left join "||trim(name)||":sysindexes i on t.tabid=i.tabid "|| "join (select tabname,sum(ti_nrows) as nrows from systabnames tn join systabinfo ti on ti.ti_partnum=tn.partnum where dbsname='"||trim(name)||"' "|| "group by tabname) as tmpt "|| "on t.tabname=tmpt.tabname "|| "where t.tabid>99 "|| "and t.tabtype='T' "|| "order by 4 desc,1" from sysdatabases where name NOT IN ('sysmaster','sysuser','sysadmin','sysutils','sysha','syscdr','syscdcv1') and is_logging=1; EOF dbaccess sysmaster ${outpath}/tabstat.sql
echo "collect instance running status using onstat commands ......" onstat -b > ./${outpath}/onstat_b.unl onstat -C all > ./${outpath}/onstat_C_all.unl onstat -C > ./${outpath}/onstat_bigc.unl onstat -c > ./${outpath}/onstat_c.unl onstat -D > ./${outpath}/onstat_bigd.unl onstat -d > ./${outpath}/onstat_d.unl onstat -F > ./${outpath}/onstat_F.unl onstat -g act > ./${outpath}/onstat_g_act.unl onstat -g arc > ./${outpath}/onstat_g_arc.unl onstat -g ath > ./${outpath}/onstat_g_ath.unl onstat -g buf > ./${outpath}/onstat_g_buf.unl onstat -g cluster > ./${outpath}/onstat_g_cluster.unl onstat -g cmsm > ./${outpath}/onstat_g_cmsm.unl onstat -g cfg > ./${outpath}/onstat_g_cfg.unl onstat -g cfg diff > ./${outpath}/onstat_g_cfg_diff.unl onstat -g ckp > ./${outpath}/onstat_g_ckp.unl onstat -g con > ./${outpath}/onstat_g_con.unl onstat -g cpu > ./${outpath}/onstat_g_cpu.unl onstat -g dic > ./${outpath}/onstat_g_dic.unl onstat -g dis > ./${outpath}/onstat_g_dis.unl onstat -g dsc > ./${outpath}/onstat_g_dsc.unl onstat -g env > ./${outpath}/onstat_g_env.unl onstat -g glo > ./${outpath}/onstat_g_glo.unl onstat -g iof > ./${outpath}/onstat_g_iof.unl onstat -g iog > ./${outpath}/onstat_g_iog.unl onstat -g ioq > ./${outpath}/onstat_g_ioq.unl onstat -g iov > ./${outpath}/onstat_g_iov.unl onstat -g lmx > ./${outpath}/onstat_g_lmx.unl
onstat -g mgm > ./${outpath}/onstat_g_mgm.unl onstat -g ntd > ./${outpath}/onstat_g_ntd.unl onstat -g ntt > ./${outpath}/onstat_g_ntt.unl onstat -g ntu > ./${outpath}/onstat_g_ntu.unl onstat -g osi > ./${outpath}/onstat_g_osi.unl onstat -g rea > ./${outpath}/onstat_g_rea.unl onstat -g seg > ./${outpath}/onstat_g_seg.unl onstat -g ses 0 > ./${outpath}/onstat_g_ses_0.unl onstat -g ses > ./${outpath}/onstat_g_ses.unl onstat -g smb s > ./${outpath}/onstat_g_smb_s.unl
onstat -g sql > ./${outpath}/onstat_g_sql.unl onstat -g sql 0 > ./${outpath}/onstat_g_sql_0.unl
onstat -g wai > ./${outpath}/onstat_g_wai.unl onstat -L > ./${outpath}/onstat_bigl.unl onstat -l > ./${outpath}/onstat_l.unl onstat -p > ./${outpath}/onstat_p.unl onstat -R > ./${outpath}/onstat_R.unl onstat -u > ./${outpath}/onstat_u.unl onstat -V > ./${outpath}/onstat_V.unl onstat -x > ./${outpath}/onstat_x.unl onstat -X > ./${outpath}/onstat_bigx.unl
echo "" echo "collect instance running status using system command ......" echo "" echo "collect cm memory ......" ps -aux |grep cmsm > ./${outpath}/cm_mem.unl echo "" echo "collect online.log last 50000 rows......" onlinefile=`onstat -m |grep 'Message Log File' | awk '{print $4}'` tail -50000 ${onlinefile} > ./${outpath}/online.log echo "" echo "collect current user env ......" env > ./${outpath}/env.unl echo "" echo "collect system cpu and memory using vmstat ......" vmstat 1 5 > ./${outpath}/vmstat.unl echo "" echo "##################################################################" echo "GBase 8s Database Health Check Finshed" echo "tar all of the output files in path: ${outpath}" echo "tar -cvf ${outpath}.tar ${outpath} " echo "##################################################################"
|