TELKOM NIKA Indonesia n  Journal of  Electrical En gineering   Vol.12, No.7, July 201 4, pp . 5693 ~ 56 9 8   DOI: 10.115 9 1 /telkomni ka. v 12i7.505 0          5693     Re cei v ed  No vem ber 4, 20 13; Re vised  Ma rch 25, 20 14; Accepted  April 15, 201 Partitioning of Oracle Application in Structured  Electronic Med i cal Records      Chua ndi Pan, Jiandong Hu*, Jian Shi  Dep a rtment of Comp uter and  Information Ma nag ement, t he  First Affiliated Hospit al of W enzho u Medic a Univers i t y ,   W enzho u, 325 005, Z hej ia ng  Provinc e , T he  Peop le’s R e p u b lic of Ch ina   *Corres p o ndi n g  author, e-ma i l : hjd1 05 6@1 6 3 .com      A b st r a ct   T h is pap er de scribe d  how  to use Oracle p a rtitio n i ng to a c hiev e classifi ed storag e of data fro m   structured elec tronic me dic a l records.  B e cau s e structure d  e l ectron ic  me dic a l rec o rds  stor ed  massive  dat a ,   the p e rfor manc e, security  an d  stabil i ty  of d a t abas e h ad  be e n  p a id  more  an more  attenti o ns. In this  pa p e r,  table w i th partit i on in structure d  electro n ic me dical  rec o rds s ystem w a s pre s ented to solv e  these prob le ms.  In add itio n, testing of co mpar ing  th e p e rfor ma nce  of tabl e w i th an w i thout p a rtitio had  be en tak e n to   prove it w a s much faster to retrieve partiti on ed t abl es w i th mass ive d a ta than n o t partitio ned tab l es.     Ke y w ords : ora c le, partitio n  tables, structure d  electro n ic  me dical r e cords,  VLDB     Copy right  ©  2014 In stitu t e o f  Ad van ced  En g i n eerin g and  Scien ce. All  rig h t s reser ve d .       1. Introduc tion  Electro n ic  m edical record s is focused  on o u tpatie nt and  ho sp italized  patie nts (or  obje c ts), it is  the integration  system of  clini c al dia g n o si s and  trea tment of information data [ 1 ].  Structu r ed el ectro n ic me d i cal re co rd s system  ap pli e s structu r e d  method to analyze medi cal  document s which a r e in pu t in natural l angu age fro m  medi cal in formation p o i n t of view, and  save s those  sema ntic  stru cture s  in the  way of  relati onal st ru cture to databa se [2]. Structured   electroni c m edical record system i s   rega rd ed a s  the future  of ele c troni c medi cal  re cord system, b e ca use  it ha s m any me rits.  Cho o si ng a p p rop r iate  dat a sto r ag e i s   vital to functi on,  perfo rman ce  and se cu rity of structu r e d  electroni c me dical record system, be ca use of too ma n y   data elem ent s, com p licate d  stru cture a nd hug e data  size. Th ro ug h partitionin g  related tabl e s retrievin g  efficien cy will  be  improve d  an d dat ab ase will be mo re  stable [3]. This  pape r de scri b e how to u s Ora c le pa rtitioning to a c hi eve cla ssi fie d  stora ge of d a ta from stru cture d  ele c tronic   medic a l re co r d s.       2. Oracle Par t itioning   Partitioning i s  provided by  Ora c le to sup port VLDB (V ery Large Da tabase).a pa rtitioned   table in  Ora c le  co ntain s   many pa rtitio ns  whi c h  ca n re sid e  in   different tabl e spa c e s . Each  partition i s  an individu al  segm ent [4]. Partit ioning is entirely transparent  to applications.   Retrievin g  da ta not only  can be i m ple m ented  by q uerying t able  with all  partit i ons, b u t also  can  be a c hieved  by queryin g   certai n pa rtitions  of  table. There are two  sugg est s  about ‘Whe n to  partition a tab l e’ from Oracl e (1) T able s  greater than 2 G B should al ways be con s id ered fo r partit i oning.   (2) T able s   containin g  historical  data,  in whi c h n e w  data i s  a dded into th e newest  partition. A typical exa m ple  is a histo r i c al  tabl e wh ere  only the cu rre n t month' s da ta is upd atabl e   and the othe r 11 months a r e read o n ly.  While  cre a tin g  partition, p a rtition key shoul d be  ch ose. Oracl e  aut omatically direct inse rt, upd ate ,  and d e lete  operation s  to  map s  dat a  to the a pprop riate pa rtition  throug h the  u s e   of the partition colum n s. O r acl e  provid e s  the followi n g  partitionin g  method s:  (1)  Ran ge P a rtitioning: Range p a rtitio ning map s  d a ta to partitio n s ba se d on  rang es  of  partition key values that you esta blish for ea ch pa rtition.  Evaluation Warning : The document was created with Spire.PDF for Python.
                               ISSN: 23 02-4 046                     TELKOM NI KA  Vol. 12, No. 7, July 201 4:  5693 – 56 98   5694 (2) Li st Partiti oning:  List  p a rtitioning  en able s  you to  explicitly cont rol how rows map to   partition s by  spe c ifying a li st of discrete  values  fo r the  partitionin g  key in the de scriptio n for e a c h   partition.   (3) Hash Part itioning: Hash Partitionin g  map s  d a ta b y  hash value  of pa rtition  key. You  can imp r ove  I/O perform ance by Hash Partiti oning , becau se  Hash Pa rtitioni ng map s  dat a   equally to ce rtain partition s.  (4)  Com p o s ite Partitioning: Com p o s ite  Partitioning, for ex ample  Ran g e -Hash   Partitioning o r   Range -Li s t Partitioning, allows  you  sub pa rtition a  table by  cre a te pa rtition i n  an  exist pa rtition ,  when  the ta ble is con s id ered  to  hu ge  after pa rtitio ning o r   whe n  there  are ot her   requi rem ents.        3. Conce p tu al Data M o d e l of Struc t u r ed Electro nic Medical Re cords Sy stem  Structu r ed  el ectro n ic me di cal  re co rd system  in  ou hospital u s e s  dynami c   an alysis of  data structu r e .  The con c ept  data mode is sho w n in Fig u re 1.   Table na med  medical _ re cord_i ndex st ore s  i ndexe s  of medical reco rd s. Tabl e named   medical_ re co rd_el eme n t_d e finition store s  eleme n t de finitions of medical re cord.  Table nam ed   medical_ re co rd_d ata  store s  el ement  da ta of ea ch  m edical record. Tabl e n a me d mo dify_trace  store s  tra c of modificatio n  of data of each  medi cal record. Ta ble name d  speci a lty_form at  store s  me dical record formats of ea ch sp e c ialty. Table nam ed format_ d e finition stores  definition s  of  every fo rma t s. Tabl e n a m ed fo rmat _s tyle  s t or es   s t yle s   o f  ea ch  fo r m a t. T a b l named  style_ definition sto r es def initio n of related styl es.           Figure 1. Con c ept Data Mo de of Struct u r ed Electroni c Medical Re co rds Syste m   Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM NIKA   ISSN:  2302-4 046     Partitioning of  Ora c le Appli c ation in Stru ct ure d  Electronic Me dical Re cords  (Ch uandi Pan )   5695 4. Ac complishment of  Using Par t itio n to  Stor Data  From S t r u ctur ed Elec tronic  Medic a Reco rds Sy s t em   We u s parti tion table to  store  data of  medical_record_ data tabl e and m odif y _trace   table, be cau s e the s e tabl e s  a r extrem ely huge  in   st ructu r e d  ele c t r oni c me dical  re co rd s sy stem  based on dyn a mic an alysi s  of data stru cture  [5]. Reali z ation of this  stora ge meth od:  Firstly, we  create several  table spa c e s , lik e t s _em r1 , ts_em r2, ts_emr3, ts_e mr4, et c,  whi c of dat a files are  stored  in  different phy si cal disks. (Certai n ly,  these   da ta  files ca n be  store d  in th same  physi cal disk, if I/O perfo rm an ce is  not con s id ered. ) Statem ents of  creati ng  table sp ace a r e as b e lo w:  cre a te ta ble s pa ce  ts_ e m r1  datafile   'D :\oradata \ts_emr1\data 01.dbf' si ze  100M  autoextend o n  next 100M maxsize 300 00M;  Rema rk: nam e of table  sp a c e: ts_em r1.  Data  file:  D:\oradata\ts _e mr1\data 01.d b f. Store  value of initial: 100M. Auto extension: al low.  Next extensi on: 100M . Store value of maximum:  3000 0M.  Secon d ly, we  create  anthe r table  sp ace for stori ng dat a of index.  cre a te table s pa ce ts_in dex datafile   'D:\orad a ta \ts_index\dat a01.dbf' size  100M  autoextend o n  next 100M maxsize 300 00M;  There are  statements of  cre a ting pa rti t ion table of medi cal_ re co rd_d ata by range of  medical_ re co rd_id.   cre a te table  medical_ re co rd_d ata (  medical_ re co rd_id n u mb er(10 )  not null,   element_ defi n ition_id nu m ber(8) n o t nul l,  seri al_n umbe r numb e r(8) n o t null,  e_re s ult VARCHA R2 (20 0 ),   e_modifie r  VARCHAR2(2 0 ),   modify_date DATE,  prima r y key(medical_ re co rd_id )   usin g index table s pa ce TS _INDEX )  pctfree  10 pct u se d 90   partition by ra nge(medi cal_ record_id )   (pa r tition med i cal_ re co rd_d ata_p1 valu e s  less than (5 0000 ) table s p a ce ts_em r1,   partition me di cal_ re co rd_d ata_p2 valu e s  less than (1 0000 0) table s pace ts_em r2 partition me di cal_ re co rd_d ata_p3 valu e s  less than (1 5000 0) table s pace ts_em r3 partition me di cal_ re co rd_d ata_p4 valu e s  less than (2 0000 0) table s pace ts_em r4 );  PCTF REE: Specify a  whol e num be r rep r esentin g   the percenta ge o f   spa c e   in ea ch data  block of th databa se  obj ect reserved   for future up dates to rows of the  obj e c t [6]. While   the   percenta ge  of spa c e  in d a ta blo c k re ach e s the   value  of PCTF REE, data bl ock  which i s   rem o ved   from FREE LI ST is not allo wed to in se rt. If the va lue of PCTFREE is too large, d a ta block is  n o taken full adv antage of. Otherwise, if th e value of  PCTF REE is so little, new reco rd s are fo rce d   to move to new data blo c k, and pe rform a nce  will be de grad ed.   PCTUSE D: Specify  a wh ole  n u mbe r  repr e s e n ting t he mini mum  perce ntage   of used  spa c e that O r acl e  maintai n s for ea ch  data bl o ck of  the database obje c t [6].  Only whe n  used   space of  dat a block fall below P C TUSED, data bl oc will  be  re-linked to available li st and will   be all o wed to  insert  data.  If the value  o f  PCTUSE D i s  too  la rge, f r equ ent  re-using d a ta bl ock  lead s to in creasi ng I/O  consumption.  If the value  of PCTUSE D is   s o  little, this   works  to  the   disa dvantag e  of re-u sing  data block.  However,  little PCTUSE D value hel p s  to red u ce I/O   con s um ption and  imp r ove perfo rman ce.   Cho o si ng p r o per P C TF REE value and  PCTUSE D value sum of  whi c h mu st e qual to p r   less  than 100 is vitally important. In our  s y s t e m , w e  se t PCT F R EE va lue  as  10  a nd s e PCTUSE D value as 9 0 Table medi ca l_re co rd_ data _p1 stores  da ta  wh i c h  med i cal_ re co rd_i d is le ss t han  500 00   and  whi c h i s   store d  in  tabl e spa c e of t s _emr1. Tabl e  medi cal_ re cord_ data_ p2  store s   data  which  medical_ re co rd_id i s  equal  to or larger than 500 00 a nd less than 1000 00 and  whi c h is sto r e d  in  table sp ace o f  ts_emr2, an d so on.   Enlargi ng tabl e sp ace or  achieving cro s disk  sto r ag can  be reali z ed by add  dat a file to   table sp ace, for exampl e ts_emr1, ts_em r2, ts_em r3, ts_em r4.   alter table s p a ce ts_em r1  add datafil 'E:\oradat a\ts_em r1\dat a02.dbf' size   100M  autoextend o n  next 100M maxsize 200 00M;  Evaluation Warning : The document was created with Spire.PDF for Python.
                               ISSN: 23 02-4 046                     TELKOM NI KA  Vol. 12, No. 7, July 201 4:  5693 – 56 98   5696 After creating table space which  will  be used  to  store new partition, we  can add a  partition to pa rtitioned tabl e .  For an in sta n ce,  we ad a partition  wh ich will  be u s ed to sto r e d a ta   whi c h m edica l_re co rd_id  is equal to  or l a rge r  tha n  20 0000  and l e ss than  25 000 0 and  whi c h  i s   store d  i n  tabl e spa c e  of t s _em r5  to ta ble m edical_ record_d ata. The stateme n is  sho w n as  belo w alter tabl medical_ re co rd_d ata a d d  partition  m edical_record _data_ p5 val ues l e ss  than(2 500 00 ) tablesp a ce ts_em r5;   There  are statement s of  cre a ting partiti on tabl e of modify_trace by range of  archive_d ate.  cre a te  table modify_tra ce (   medical _ record_i d num be r(1 0) not null,    element_d efinition_id nu m ber(8) n o t nul l,   e_re s ult VARCHAR2(200 ),   modifier VARCHAR2(10),   modify_date DATE,   archive _date  DATE not nu ll,   primary  key(medical_ re co rd_id,  ele m en t_definition_i d, modify_date)   using in dex table s pa ce TS _INDEX )   pctfree 0 p c t u se d 99    partition by range (a rchive_date)   (partition  m odify_trace_p 1 values less than(to_date ('2014-01-01',  'yyyy-mm-dd'))  tablespa ce ts_emr101,     partition m odify_trace_p2 values l e ss  than(to_date('2015-01 -01', 'yyyy- mm-dd'))  tablespa ce ts_emr102,     partition m odify_trace_p3 values l e ss  than(to_date('2016-01 -01', 'yyyy- mm-dd'))  tablespa ce ts_emr103,    partition mod i fy_trace_ p0  values le ss than (maxvalu e )  tablespa ce ts_em r1 99);   S t ruct u r ed el ect r o n ic m e d i cal re co rd sy stem ba se d on SaaS [7] can be  sh ared to  several ho spi t als throu gh  by storing m edical re co rd  indexes of d i fferent hospitals into different  list pa rtition s There a r e  sta t ements  of  creating li st  partition table  of  medical_ re co rd_in dex by  li st  of hospital _ id cre a te table  medical_ re co rd_in dex (   medical _ record_i d num be r(1 0) not null,    patient_id nu mber(10 )  not  null,   hospital _ id n u mbe r(5 ),    format_id nu mber(5 ),   primary  key(medical_ re co rd_id )    using in dex table s pa ce TS _INDEX )   pctfree 2 0  pctused 8 0    partition by list(ho spital _id )    (partition me dical _ re co rd_ i ndex_p 1 values(1 ) table s pace ts_em r2 01,   partition med i cal_ re co rd_i ndex_p 2 valu es(2) tabl esp a ce ts_em r20 2  partition med i cal_ re co rd_i ndex_p 3 valu es(3) tabl esp a ce ts_em r20 3  partition med i cal_ re co rd_i ndex_p 0 valu es(default )  tablespa ce ts_ e mr2 99);       5, Results a nd Discu ssi on  We ta ke tab l e modify_tra ce fo r an  e x ample to compa r e the  perfo rman ce  of not   partitione d ta ble and  partiti oned tabl e to prove that ta ble with p a rtition will imp r o v e performan ce.  Firstly,  two tables nam e d   modify_tra ce_ non  with out pa rtition  and m odify_trace  whi c h  is  partitione d b y  rang of archive _date  are cre a t ed.  There a r e  the statem ents of crea ting   modify_tra ce  by range of a r chive _date.   cre a te  table modify_tra ce (  medical_ re co rd_id n u mb er(10 )  not null,   element_ defi n ition_id nu m ber(8) n o t nul l,  e_re s ult VARCHA R2 (20 0 ),   modifier VARCHA R2 (10 ) modify_date DATE,  Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM NIKA   ISSN:  2302-4 046     Partitioning of  Ora c le Appli c ation in Stru ct ure d  Electronic Me dical Re cords  (Ch uandi Pan )   5697 archive_d ate DATE not nul l,  prima r y key(medical_ re co rd_id, el e m en t_definition_i d, modify_date)  usin g index table s pa ce TS _INDEX )  pctfree  0 pctu sed 9 9   partition by ra nge(archive_ date)  (partition m odify_trace_p1 values l e ss  than(to_date( '2009-01-01', 'yyyy-mm-dd'))  tablespa ce ts_emr101,   partition modify_trace_p2  va lues less than(to_date( '2010-01-01', 'yyyy-mm-dd'))  tablespa ce ts_emr102,   partition modify_trace_p3  va lues less than(to_date( '2011-01-01', 'yyyy-mm-dd'))  tablespa ce ts_emr103,   partition modify_trace_p4  va lues less than(to_date( '2012-01-01', 'yyyy-mm-dd'))  tablespa ce ts_emr104,   partition modify_trace_p5  va lues less than(to_date( '2013-01-01', 'yyyy-mm-dd'))  tablespa ce ts_emr105,   partition mo di fy_trace_ p6 value s  less tha n  (maxvalue )  tablespa ce ts_emr106 );  Then, after resp ectively inse rting sam e   massive d a ta which co ntains 10 000 000 ro ws  archive_d ate  ra ngin g  fro m  01/0 1 /200 8 to  31/ 12/2 013 i n to  bot h table s we  execute  qu ery  statement s fo r these t w o ta bles.   sele ct *  from  modify_trace_n on  wh ere  archive_ date bet wee n   to_date('20100716','yyyymmdd')  and to_date('201007 17','yyyymmdd') order  by archive_date;   sele ct *  from  modify _trace  whe r e  a r chive _date  betwee n   to_date('20100716','yyyymm dd')and to_date('201007 17','yyyymmdd') order  by archive_date;   We obtai n sta t istics from ex ecutin g these  statement s:  (1)  The  execution plan of  table modify _trace_non is  “TABLE A CCESS FULL”, Cos t   numbe r i s  1 7 833  and Byte s a r 190K,  as  sh own  in  Tabl 1. Mo re visible  resu lt is that it ta ke s   3.813 second s to retrieve 5 539 ro ws of data.      Table 1. Execution Plan of Table mo dify_trace_n on   ID Oper ation   name   Ro w s   B y tes  Cost(%CP U)   0 SELECT  STATE M ENT     4641   190K  17833(2 )   1 SORT  ORBE B Y     4641   190K  17833(2 )   TABLE ACCESS  FULL   MODI F Y _TRA C E _NON   4641   190K  17832(1 )       (2)  The  execution pla n  of t able mo dify_tra ce i s  “PARTITION  RANGE SINGLE ”  and the n   “TABLE ACCESS FULL”.  Bec a us e part ition s t art and  partition  s t op is  both 3,  it only need to  scan  partition  3 n a med  ts_emr103. A s  a  re sult, it  o n ly take 2.9 85  se con d s to ret r ieve  55 39  rows  mu ch fa ster th an th result of exe c uting  the  pre v ious  statem ent an d the  Cost n u mbe r  a nd  Bytes are re spectively red u ce d to 2492  and 15 7K, as  sho w n in Ta ble2. Each p a rtition is a small  part of the wh ole data table ,  so retrievin g  a par tition is  boun d to improve retrieval  perfo rman ce.       Table 2. Execution Plan of Table mo dify_trace   ID Oper ation   name   Ro w s   B y tes  Cost(%CP U)   Pstart  Pstop  0 SELECT  STATE M ENT     3935   157K  2492(2 )       PARTIT O N RA N G E SIN G LE     3935   157K  2492(2 )   2 SORT  ORBE B Y     3935   157K  2492(2 )       TABLE ACCESS  FULL   MODI F Y _TRA C E   3935   157K  2491(2 )       As a re sult, the Ora c le  ra nge pa rtitioni ng tech nolo g y  can optimize the huge a m ounts of  data table qu ery perfo rma n ce [8].      6, Conclusio n   There are ma ny advantage s of u s ing p a rtitioning of Oracle to  store data  from structured   electroni c medical re cord s system. (1 ) Improvi ng  perfo rman ce:  Operatio ns  of insert, del ete,  Evaluation Warning : The document was created with Spire.PDF for Python.
                               ISSN: 23 02-4 046                     TELKOM NI KA  Vol. 12, No. 7, July 201 4:  5693 – 56 98   5698 update  an d q uery a r e  di stri buted to  de sti nation  parti tio n , so  pe rform ance i s  imp r o v ed effectivel y.  This i s  th most im porta nt advantag e  for  stru ct ure d  ele c tro n ic  medical reco rds sy stem.  (2)  Conve n ient  maintena nce: We  ca n mai n tain certai n partition,  for example,  d a ta  re pair. (3 ) I/O   equilib rium: I/O equilib riu m  is achieve d  by storin g   different pa rtitions to dif f erent di sks.  (4)  Increasi ng  usability: If cert ain partition  of table fail s,  other partitio ns  of table st ill work well.  (5)  Conve n ient b a ckup   an d re covery: ba ckup  a n d   re co v e ry  can  be  d one to   certai n pa rtition.  (6)  Partitioning  is tra n spa r ent  to u s ers. P a rtiti oning  ha s mo re  obvi ous adva n ta ges to  stru ctured   electroni c me dical records  system b a se d on SaaS.      Referen ces   [1]  Di PC. D e si g n  of El ectroni c Medic a Re cord S y stem  Based  on  Cl o ud C o mp uting  T e chnolo g y .     T E LKOMNIKA Indon esi an Jou r nal of Electric al Eng i ne eri n g .  2014; 1 2 (5): 4 010- 401 7.   [2]  Cai S h a ohu a.  Desig n   and  im plem entatio o f  electro n ic me dical  recor d s.  Moder n C o mp uter . 20 06; 7:   110- 112   [3]  Yang Y, Ye H, F e i S.  Design of partitioned tabl e for VLDB in the vehicle monit o ring system.   Multimed ia T e chno log y  (ICMT ) . Inter nation a l Confer ence on . IEEE. 2011;5377- 537 9.   [4]  He Pi ng, Ya ng  Shuq ia ng, Ji a  Yan. Back up  and r e cov e r y   of VLDB  base d  on  Oracle  1 0g.  Co mpute r   eng ine e ri ng . 2 006; 32( 19): 79 -81.  [5]  Pan C h u a n d i,  Z hou  Xinch ao,  Shi Ji an. D e si g n  of  e l ectro n ic  medic a l rec o rd  s y stem  bas ed  on  d y n a mi c   ana l y sis of dat a structure .   Chi na Di gital Me di cine.  20 07; 2(3 ) : 20.  [6]  F i orill o C. Or acle  Data bas e  11 gR2  Perfo rmance T uni n g  Co okb ook:  Over 80  Rec i pes to  He lp   Begi nners Ac h i eve Better Pe rformance fro m  Oracle  Dat abas e App licat ions. Packt P ublis hi ng Ltd.   201 2.  [7]  Buxm an n P, Hess T ,  Lehman n S. Soft w a re  as a Service.  Wirtschaftsinform atik . 20 08; 5 0 (6): 500- 50 3.  [8]  W ang P, T i an  A, Guo C. T abl e Partit i oni ng T e chno lo g y  Base d o n  M a ssive  Data.  TEL K OMNIKA  Indon esi an Jou r nal of Electric al Eng i ne eri n g .  2014; 1 2 (3): 1 676- 168 6.       Evaluation Warning : The document was created with Spire.PDF for Python.