winmysql
Transcription
winmysql
2 Volume HOSxP High Performance Application for Hospital Administrator manual HOSXP Administrator manual Chaiyaporn Suratemekul Revision 0.4 December 2004 i !" # $%&' () *+ )*,.- 0*/ 12. %3*/& $4& 5 6( 7#.819):10 #(' #(9039 2.9; .9 <%2 =94 2 4;= 85>?1. > 3*/ *+ • 85>; -85>6) 3*/?A.7#.:*1BC 9=D< E9 6( !" F9($%7 C( A)9 2.9; .9)*1$ *+ • G==096( (- H 3*/ 9=$ 2 %2.9; .9 3*/ 2.97 6( 7#. F9($%7 $42.9; .909)&B+ #1$% • 6, AB ?30-6, AB 6) !" 3*/2.9; .9?A. 0- 9D$0 • 906;30I;GB ; &B=B G9!= ABEJI 3*/?A.7#.K 9D7 9=;$L 98=$+%6= 3*/K=%;0949( 29&1 19% $%#1$A 2 6 • 906;30I?;4-(0I ;MN&51==> 3*/?A.7#. 9=& $4& 5 2.9; .97 35 HA.9 3$+% Hardware 6!( H 3*/ 2.9; .98%?))*K 9D?A.7:. : 8='/ % Palm, Cisco Router #=' Bio Finger Scan • 906;30I:-:0$ CM)U B ?;D9( 6( G==09 3*/?A.7#.K 9&6( & $4& 5 7#.29. ; 9. ?A.;$L 9= 44 HOSxP 09% CM)3*/ 7 2> 3*/2.9; .9?A.=4$ =9: 9=3*/K=%;0949( C5=;$ C=;B)9 %$ #1$A=. 0 AM • 906;30I&5 ;*0% <+%1B 9=0I!N V N9 6( 906;30I&)4-=>I $ 39 B: 3*?/ A. #M 819)&F98$N 6( ?A.7#. K 9D7 9=;$L 9 $4K=%;0949(3*/)*2 9A7#N 09% : K=%;0949(K;U9=9) • 906;30I31*3 % $ C -( 3*/8 06 F96( ?A.7#.K 9D2.9; .9?A. F9 & ,(%9 3*/%9 != :5) 1B:9 9= TMI • G .&5:$0 A5 )8F9 3*/8 0 !" F9($%7 6( :10 #(' 35 8=$%+ 3*/?A.?!;$L 9K!=6 =)3*/K=%;0949(K;U9=9) • 85>: BC9 C$+%:B%:$0 3*/8 0 !" U5= CBAC != &9 %9 6( F9 10819)& A1 $4[\90C9%H 7 K=%;0949(K;U9=9) 6( 8 0 $A#9 9#9=?1.7#.35 )'+ • G . F9;( 1B4(- 0ID$ AB&] 5( 3*8/ 07#.8F96 F93*/)*897 9=;$L 9= 44 • 458(9 =35 39 7 35 K=%;0949( 3*/?A.7#.89F 6 6 ;'/ 9=;$L 96( !=$4!=5%K!=6 =) i 2 HOSxP 6 ! "# $% 9 &' $% )( *( 14 &' $% )( &" + 17 ,$$% )( ". 19 ,$$% )( &/ 0 SQL Windows 21 : % ; < <% # 23 ! %/' & &+ 26 "# # % $% )( 32 $% )( , 0 $% )( %/' %/' 36 mysql client command line 38 E $% )( ! F 0 $% )( STAT 2.x 40 Upgrade 44 &' "-O &0 $% )( 47 ! "# $% Replication Agent 49 0 $% )( , %/' 57 i 1 Chapter H OSxP )*= 44 9=CBAC$+%,9 = 44 Windows Installer 3*/&9)9=i3*/ (' CBAC$+%K!=6 =) j;9 &1 3*C/ . % 9=?A. KA0C$1CBAC$+% !" 6kl) A*01 )*2 9A != )9> 200 Mb 1BU* 9=CBAC$+%KA03$/1H ?! )*2$+ C A$% *+ 7:. Windows Explorer !oA Folder 3*/C1$ CBAC$+% 0- (! CB Double Click 3*:/ '/ 6kl)CBAC$+% ;'/ =*0 C$1CBAC$+%)97:.%9 2 0-7 6, CD-ROM) !=9 t# .9 CBAC$+%A$%=-! (' A!5)\ 0 )=$4 (' != G3 9=CBAC$+% i.9C. % 9=CBAC$+% ;'/ 3A& 4 9=3F9%9 7#. (' MySQL Server A.10 (' Folder 3*C/ . % 9=CBAC$+%K!=6 =) (6 9F 7#.7:. C:\Program Files\HOSXP) 3 = &$ 8=-K!=6 =) 3F9 9=CBAC$+%6kl)3*/ F9 !" 7 9=7:.%9 )'/ !=9 t# .9 Microsoft Data Access Component Setup 7#.7:. )9&I (' I accept { 6(.1 A!5\) Next 4 )'/ MDAC CBAC$+% &=M 6(.17#. A!5)\ Finish ;'/ 3F9 9=CBAC$+% HOSxP C )'/ CBAC$+% &=M 6(.1 !=9 t# .9 A$%=-! 7#. A!5)\ &=M &B+ M &9)9=i7:.%9 HOSxP ?A. ( )'/ CBAC$+% &=M 6(.181= Restart = 44 A.10) 5 2 Chapter HOSxP )'/ CBAC$+%:5AK!=6 =) HOSxP 6(.1 7 =>*3*/ (' CBAC$+%644 Full Stand alone C$1 CBAC$+% 3F9 9=CBAC$+% MySQL ?1.7#.A1. 0 }</%,-.7:.&9)9=iC=1 & 4 9=3F9%9 2 % MySQL ?A.KA0&$% C5 3*/ Taskbar A$%=-! ,-.7:.%9 &9)9=i7:. )9&I8(B 219C=% Icon 2 % MySQL Monitor ;'/ 6&A% Service Properties ?A. A$%=-! # .9 #($ 2 % WinMySQL Admin 6&A% =5 2 % MySQL 6( 2. )-(3*/&F98$NC9%H 6 HOSXP 7 9= =*0 7:.%9 K!=6 =) HOSxP Client &9)9=i =*0 7:.%9 ?A. 9 Start Menu #=' 9 Icon 3*/ 0-4 Desktop ?M A. )'/ =*0 7:.%9 K!=6 =) HOSxP !=9 t# .9 7#.3F9 9= Login }</%,-.A-6(= 44 &9)9=i 2.9?!C$+%89 9= :'/ )C ?A. KA0 A!5\) =-! Computer Network 3*/ 0-39%A.9 219 2 %# .9 Login 3*/# .9 Login 81=C$+%89C9%H 7#.i- C. % j;9 8=$+%6= #($% 9 CBAC$%+ K!=6 =) &=M 6(.1 6( 81=3A& 4 9= :'/ )C 35 8=$+%3*/)* 9=C$%+ 897#) 7 HOSXP #($% 9 C$+%89 &=M 6(.1 7 9= 2.97:.%9 K!=6 =)8=$+%6= =#$& Login 7& !" ?= M ?A. 6( 7& Password !" C$1 ?= M?A. : A*01 $ KA0#($% 9 Login 2.9?!6(.1 ?A.=4$ &B3UB !" ,-.A-6(= 44KA0 C$ K )$CB 7 9= 2.97:.%9 8=$+%6= K!=6 =) 6&A%# .9 2<+ )9 C' i<%=#$&6, 2 % 8='/ % 3*/ 0$%?)i- (%3 4*0 !" 9= C' KA0! CB ?)7:2. ,BA;(9A 7 =>*30/* $%?))* 9=C$+%896, 19C *+ 9F ($%3F9%9 3*/ A5 7A !=9 t# .9 7#.,.7- :.%9 3F9 9= (' 6, 2 % 8='/ % 8 3 Chapter ! "# $% Database 2 % HOSxP ?A.i- C$+%89 9=7:.%9 )96(.1 6C F9 !" C. %)* 9=C$+%897#) 7#. i- C. % 9=7:.%9 : :'/ &i9 ;0949( =-!644 9= #)90 (2 HN #=' =-!644 9= #)90 (2 AN =1)i<%=#$&3*/&F98$NC9%H KA0&9)9=i3F9?A.C9)2$+ C A$% *+ (' ) - = 44%9 '/ H -> 4F9=5%=$ E9= 44 -> System Setting !=9 t# .9 C$+%89= 44A$%=-! 9 !"" =90 9=3*/&9)9=i8. #9=#$&?A. !=9 t!5)\ { 7#. A3*:/ %219)' }<%/ )'/ A !=9 t # .9 8. #9 A$%=-! )'/ (' ?A.6(.1 9F 8F93*/8. #9?A. ?!7&7 : % A$%=-! UB490 9=C$+%89C9%H • HN =B/)C. : !" #)90 (2 HN =B/)C. 2 %= 44 • =-!644 9= HN : =-!6443*/C. % 9=7#. HN )* 0- 2 =-!6448' !• ;.D. C9)A.10(F9A$4 (Yyxxxxx) 6( =*0%(F9A$4?! ='/ 0H (xxxxxxx) • F9# A644k =I):F9= %B % : 7:.&F9#=$4= 457#. 644k =I):F9= %B 3*/ !" 6443*/ 9F # A % • ?) F9 !" C. % diag 3*/ ER : ?)4$%8$47#.#. % ER C. %(%,( 9=1B B j$0 • 6;30I?)C. %(% Diag : ?)4$%8$47#.6;30I(% Diagnosis 10 !"" • AN =B/)C. : #)90 (2 AN =B/)C. 2 %= 44 • ?) 9F (23*/C< )9 AN : ! CB AN != 4A.10 (2 9 #($ != 4A.10 !• ;.D. =#$&C< 6( (2 running 7 =-!6442 % YYWWxxxxx }</%i.9?)C. % 9=7#. )* (23*/C< 7 =#$& AN 7#. Check 3*/: % *+ • F9 AN 3*/2.9))97:. : 7 9= AN ! CB 9 BA 9=2.9)#)90 (2 ?A. }</%i.9 C. % 9=7#. 9F (23*/29. ))97:. 7#. Check 3*/: % *+ • 7:.= 44 IPD Drug Profile : ! CB Drug Profile )* 2 644 i.9C. % 9=7:.6447#) 7#. Check 3*/: % *+ • =#$&89097 4$N:* : = 45=#$&89092 %= 44 • =#$&8909 4$N:* : i.9C. % 9=7#.)* 9=60 09 4$N:* )9 7#.= 45=#$&89 09 4$N:*3:*/ % *+ 9= F9# A 9= :'/ )K0%2 %=#$&6, M&9)9=i3F9?A. : $ KA0 (' 8F9&$/% =#$&6, 9 Side Bar 39%A.9 }.90)' !=9 t: %7#. (' =#$&6, 11 !"" 9=C$+%89:'/ 4588( M&9)9=i3F9?A. : A*01 $ KA0 (' 8F9&$/% :'/ 4588( 6, 2 % 8='/ %8 );B1 C =IC9%H 7 = 44&9)9=iC$%+ 89?A.KA0 (' 8F9&$/% Computer Department 12 !"" 2. )-( Replicate Slave M&9)9=iC$+%89?A. : A*01 $ KA0 (' 8F9&$/% Replication 13 4 Chapter &' $% )( *( 9= 2.97:.%9 K!=6 =) HOSxP i.90$%?))* 9=C$+%89=#$&,-.7:.%9 35 8 &9)9=i 2.9 7:.?A.6( (90 !" Administrator 35 8 6C )'/ C$+%89=#$&,-.7:.%9 6(.1 ,-.3*/ 7:.%9 ?A. C. %7&=#$& Login 3*/i- 4$ 3< 0-7 J9 2. )-(4$N:*=90:'/ ,-.7:.%9 39 $+ =#$&,-.7:.%9 =#$&6= 3*8/ 1= C$+%8' =#$&2 %,-.A-6(= 44 KA0)*1BU* 9=C$%+ 89A$% *+ 2.9 ) - = 44%9 '/ H -> 4F9=5%=$ E9= 44 -> ,-.7:.= 44 -> ;B/) • (4 2. )-(,-.7:.= 44 14 #$ %&'% # .9 6&A%=90:'/ ,-.3*/)*&B3UB 2.97:.%9 = 44 HOSxP A3*/ Tab ;B/)=90 9=,-.7:.= 44 ;'/ 3F9 9= ;B)/ 2. )-(,-.7:.%9 15 #$ %&'% =#$&6= 3*/ C. % ;B)/ 8' =#$&2 %,-.A-6(= 44 KA0C=%: % Access Right 7#. (' :M8C=% Administrator : % A*01 16 5 Chapter &' $% )( &" + 458(9 =39% 9=6;30I35 8 81= )*=90:'/ !=9 t7 J9 2. )-(6;30I ;'/ 3*/ &9)9=i3F9 9= (' =90:'/ 6;30I 6( &9)9=i 2.9= 44&$/% 90 1:G$>‚I?A.i- C. % 9= ;B)/ #=' 6 .?22. )-(6;30I &9)9=i3F9?A.A$% *+ 2.9 ) - 4F9=5%=$ E9= 44 -> (%3 4*0 -> =90 9=6;30I,.C- =1 A!5\) ;B)/ =90 9=7#) ;'/ 3F9 9= ;B/)=90 9=6;30I,.C- =1 !5\) ;B/) =90 9=7#) !5\)6&A% =90 9= ;'/ 3F9 9=6 .?2 2. )-( 17 #$ %& # ( #($% 9 (' =90 9= ;B/)6;30I,.C- =1 6(.1 !=9 t# .9 7#. ;B/)#=' 6 .?2 2. )-( 6;30I =#$& Login 2 %6;30I &i9 G9;!V 54$ :'/ 2 %6;30I (23*/74!= 18 41B:9:*; 6 Chapter ,$$% )( "- . ! CB&B3UB 9==$ E93*/)9=$4C$1CBAC$+% HOSxP )*7#.8=435 &B3UB6(.1 6C&9)9i 2.9?! !=$46C%C$1 (' C9% H 7#.C=% $4= 442 %K=%;0949(?A. 9= ;B)/ #=' 6 .?22. )-(&B3UB 9==$ E9 &9)9=i3F9?A.A%$ *+ 2.9 ) - 4F9=5%=$ E9= 44 -> (%3 4*0 -> &B3UB 9==$ E9 !=9 t# .9 &B3UB 9==$ E93$+%#)A2 %= 443*/&9)9=i 2.9?! ;B/)/6 .?2 ?A. 19 ) %&* + , # .9C9%6&A%85>&)4$C2B %&B3UBC9%H &i9 G9; 9=7:.&B3UB :'/ 2 %&B3UB =#$& (9%2 %&B3UB Mask F9# A 9=4$%8$4 (%2. )-(C9)=-!644 &1 (A7 9=7:. &B3UB C$1 (' =#$&89U==) *0) $CK )$CB '/ H !(*/0 =#$&&B3UB !" =#$& '/ 20 6 Chapter ,$$% )( &/ 0 SQL Windows HOSxP )*= 44 Integrated SQL Query Command 3*/&9)9=iA<%2. )-( 9 C9=9%7AH M ?A. )96 .?2 #=' 9 4$ 3< ?1.6(.1 F9)97:.G90#($% ?M A. 9=7:.%9 = 44 Integrated SQL Query Command &9)9=i3F9?A.A$% *+ 2.9 ) - Tools -> (' SQL Query !=9 t# 9. SQL Query 2<+ )97#.39F 9= ;B);I8F9&$/% SQL 3*/7:.7 9=A<%2. )-()9 6&A%,( (D< E9=-!6448F9&$/%?A. 9 Report Manual) 21 ) %&#- . SQL WINDOW • Run 7:.&F9#=$4A<%2. )-( 9 8F9&$/% SQL !V 54$ 9F )96&A%0$% Grid A.9 (9% (Select Statement) • Exec 7:.&F9#=$4 =*0 7:.%9 8F9&$/% SQL !V 54$ (Insert,Update,Delete) KA0 )'/ A!5\)6(.1 ?)6&A% Error message 7AH (silent) 6Ci.9C. % 9=7#.6&A% Error Messaage 7#. 2.93*/ ) - Tools -> Options -> Debug SQL • Update 7:.&F9#=$40' 0$ 9=6 ?. 22. )-(7 Grid 6( &%,( 9=6 .?2?! M4?1.7 J9 2. )-( • Save 7:.&F9#=$44$ 3< ,(3*/?A. 9 8F9&$/% SQL 7#. 0-7 =-!2 %6kl) XML #=' CDS (Clientdataset) 3*&/ 9)9=i 9F ?! !oA0$% 8='/ % '/ H #=' 7:.7 9=0.902. )-(?!?1.0$%J9 2. )-( '/ H 7 Offline Mode • Open 7:.&F9#=$4 !oA6kl)3*/ 0-7 =-!6442 % XML #=' CDS 3*?/ A.4$ 3< ?1. • Append 7:.&F9#=$43F9 9= merge 2. )-( 9 6kl) CDS #=' XML ?!0$%C9=9%3*/ !oA 0-7 !V 54$ • Disable Highligth 7:.&F9#=$40 (B 9=3F9 Syntax Higlight (7 =>*3*/ BA!VN#9 9 9= Hightlight Error) 22 7 Chapter : % ; < <% # HOSxP )*= 44 C=1 & 4&B3UB 9= 2.9i<%C9):'/ 8='/ %8 );B1 C =I }</% i- 7:.7 = 44#. %:F9= %B }</% 9 ,-.7:.%9 C. %?A.=$4&B3UB 2.9= 44:F9= %B 6(.1 8='/ % 8 );B1 C =I37*/ :. MC. %?A.=4$ &B3UB7 9=7:.%9 A.10 9= !oA 9=7:.%9 &9)9=iC$+%89?A.KA07:.= 44 Integrated SQL Query Command KA03F9 ?A.A$% *+ (' 8F9&$/% SQL 9 Toolbar (' C9=9% canaccess 9 combobox 3*/)5)4 }.90 ;'/ !oAC9=9% canaccess 23 56 7 !""7 ! A!5\) Run ;'/ 3F9 9= !oA2. )-( 9 C9=9% )96&A%?1.7 Grid A.9 (9% 7 : %C9=9%A.9 (9% 7#. ;B)/ #=' 6 .?2=90 9=:'/ 2 % 8='/ %8 );B1 C =I3*/)*&B3UB 9= 2.9 7:.%9 = 44 7 2. )-(3*6/ &A%7 : %A.9 (9% ,-.7:.&9)9=i3F9 9= ('/ :1%2. )-(?!39%A.9 219 ;'/ 6 .?22. )-(3*/0%$ 6&A%?)#)A?A. 24 56 7 !""7 ! #($% 9 6 .?2 &=M 6(.17#. A!5\) Update ;'/ 3F9 9=4$ 3<8,( 9=6 .?2 25 8 Chapter ! %/' & &+ HOSxP )*= 44 9=;B);I,9 = 44 Windows Printing }</% F9 !" C. %)* 9=C$+%89 9= ;B);I7#. #)9 &) <% &9)9=i3F9%9 ?A. 09%)*!= &B3UBG9; }</% 9=C$+%89= 44 9=;B);I)2* . &F98$N3*/C. %;B 9=>9A$% *+ • 9=C$+%892 9A = A9E • 9= F9# A Advance Printing Feature • 9= F9# A Paper Source • 9= F9# A Print Quality 7 8 9 :9 ; 2 9A = A9E !" !VN#93*;/ 44 03*/&5A7 9=C$+%89 8='/ %;B);I '/ % 9 7 644k =I)3*/C. %;B);I,9 = A9EC '/ % F9 !" C. %C$+%892 9A = A9E7#.C=% $42 9A 2 % = A9E3*7/ :.%9 =B% ?) : $+ %9 ;B);I743*/& % M ;B);I?)C=%: % 2 9A2 % = A9E3*/&9)9=i7:.%9 ?A.! CB i- C$+%89)96(.1 4$ Driver 2 % 8='/ %;B);I }</%49% =>* ?))*2 9A3*/C=% 4$ 2 9A3*/ 7:.%9 =B%H F9 !" C. %&=.9% 2 9A2 %644k =I)2<+ )97#) (7 Windows 2000/ XP) }</%)*1BU* 9=&=.9%644k =I)7#) A$% *+ (' Printer 9 Start Menu 26 " -$ # #( #($% 9 (' 6(.1 !=9 t# .9 Printers and Faxes }</% !" # 9. 6&A%=90 9= 8='/ %;B);I3+%$ #)A7 = 44 2.9 ) - File 6( (' 8F9&$/% Server Properties !=9 t# .9 Print Server Properties 2<+ )9 27 " -$ # #( AC=% Create a new form C$+%89:'/ 2 % Form 7#) 28 " -$ # #( 2. A!5\) save Form 1. C$+%89# 106( 2 9A 2 % = A9E #($% 9 A!5\) Save Form 6(.1 k =I)3*/i- C$%+ 89 M i- M4?1.7 2. )-(2 % = A9E }</% &9)9=i F9)9C$+%892 9A2 % 8='/ %;B);I?A.C9)2$+ C A$% *+ 1. (' Icon 2 % 8='/ %;B);I3*/C. % 9=C$+%89KA0 9=8(B 2192 % )9&I !=9 t Popup Menu 7#. (' Properties 29 " -$ # #( A!5\) Printing Preference (' Tab Paper/Quality Paper Source (' 7#.C=% $46#(%2 % = A9E A!5\) Advanced 30 " -$ # #( (' 2 9A = A9E7#.C=% 4$ 2 9A3*/?A.C$+%?1. (' 85>G9; 9=;B);I3*/C. % 9= Advanced Printing Features 7#.C$+% 89 !" Disabled 31 9 Chapter "# # % $% )( HOSxP )*= 44 9=&F9= %2. )-( 9 Client Program KA02. )-(3*/i- &$/%&F9= % 4M ?1.3/* 8='/ %3*/&$/%7#.&F9= % #=' 9 7:.= 44 Windows Schedule :103F9&F9= %2. )-( $CK )$CB M?A. < => 8 ? @ Manual (' 8F9&$/% &F9= %2. )-( 9 ) -= 44%9 '/ H !=9 t# .9 Backup System A!5\) &F9= %2. )-( 32 * %& (' Cold Backup A!5\) 3F9 9=&F9= %2. )-( < => 8 ? B9 : Windows Schedule = < F (' Command Prompt !=9 t# .9C9% Command Prompt A$%=-! 33 B > * %& 7#.;B);I89F &$/%A$% *+ ;'/ &=.9%= 44&F9= %2. )-( C$ K )$CB ( download ?A. 9 http://altos.scphkk.ac.th/~manoi/hosxp/backup_schedule.bat ) md c:\backup c: cd \backup md 1 md 2 md 3 md 4 md 5 md 6 md 7 echo mysqldump --opt -h 192.168.0.1 -u sa -psa hos -r hos.sql > 1\backup.bat echo mysqldump --opt -h 192.168.0.1 -u sa -psa hos -r hos.sql > 2\backup.bat echo mysqldump --opt -h 192.168.0.1 -u sa -psa hos -r hos.sql > 3\backup.bat echo mysqldump --opt -h 192.168.0.1 -u sa -psa hos -r hos.sql > 4\backup.bat echo mysqldump --opt -h 192.168.0.1 -u sa -psa hos -r hos.sql > 5\backup.bat echo mysqldump --opt -h 192.168.0.1 -u sa -psa hos -r hos.sql > 6\backup.bat echo mysqldump --opt -h 192.168.0.1 -u sa -psa hos -r hos.sql > 7\backup.bat at 1 /delete at 2 /delete at 3 /delete at 4 /delete at 5 /delete at 6 /delete at 7 /delete at 01:30 /EVERY:1 "c:\backup\1\backup.bat" at 01:30 /EVERY:2 "c:\backup\2\backup.bat" at 01:30 /EVERY:3 "c:\backup\3\backup.bat" 34 * %& at 01:30 /EVERY:4 "c:\backup\4\backup.bat" at 01:30 /EVERY:5 "c:\backup\5\backup.bat" at 01:30 /EVERY:6 "c:\backup\6\backup.bat" at 01:30 /EVERY:7 "c:\backup\7\backup.bat" copy c:\progra~1\hosxp\mysqldump.exe c:\windows 8 ? >< (' 6kl)3*/ C. % 9= F9)97:. A!5\) F92. )-()97:. (2. 81== 1$% : ` 9= F92. )-()97:. KA0?)= 1$% 3F97#.2. )-(3*/)* 0-3$+%#)A AB 819) &*0#90?A.) 35 10 Chapter $% )( , 0 $% )( %/' %/' HOSxP )*= 44 9=3F9 Emergency Restore }</%&9)9=i F9)97:.:107 9=0.902. )-( ?!?1.7 8='/ % '/ H ?A. : 0.902. )-( 9 Windows ?!?1.7 Linux Server !" C. 9=0.902. )-()*2$+ C A$% *+ 1. :'/ )C ?!0$%J9 2. )-(C. 644 6(.13F9 9=&F9= %2. )-( 2. 9 K!=6 =) 6( 2.9K!=6 =)7#) C$+%89 9= :'/ )C ?!0$% J9 2. )-(C$1 7#) (3*/ 0-7 Linux) 6( C$+%89 9= :'/ )C !" 644 Emergency Mode 3. 2.9&-= 44 Emergency Restore 6( &$/% Restore 2. )-(?!0$%J9 2. )-(C$17#) 8B @ Mode Emergency Restore 3*/# .9 C$+%89 9= :'/ )C 7#.7&8F919 emergency (%7 : % SOAP URL 36 %&) . %& -$ -$ 7&8F919 emergency 7 : % login 7&8F919 emergency 7 : % Password #($% 9 2.9&-K!=6 =)6(.1 2.9# .9 Backup/Restore }</%&9)9=i&$/%7#. Restore 2. )-(?A. 37 11 Chapter mysql client command line 7 9=3F9%9 $4J9 2. )-( MySQL 7 J9 2 %,-.A-6(= 44&B/%3*/C. %D< E96( =*0 =-. ?1. M8' 9=3F9%9 $4 MySQL }</%7 43 *+ 6 9F 1BU* 9= :'/ )C ?!0$% MySQL KA0 7:. command line 6( &=5!8F9&$/%3*/ 9 ?A.7:.4 0H 9= 2.9 mysql command line &9)9=i3F9?A.A$% *+ 2.9 Accessories 6(.1 (' Command Prompt ;B);I8F9&$/% cd \progra~1\hosxp ;'/ !(*/0 directory ?!0$% hosxp 38 MYSQL CLIENT COMMAND LINE ;B);I8F9&$/%3*/7:.7 9= =*0 mysql client 6( :'/ )C ?!0$% mysql server 8' mysql –h 127.0.0.1 –u sa –psa hos !=9 t !" prompt 3*/7:.7 9=;B);I89F &$/% SQL 8F9&$/%3*/81=3=948' • show databases ; • show tables ; • show full processlist ; • describe table_name ; • repair table table_name ; • select * from table_name where condition ; (download quick reference ?A.3*/ http://altos.scphkk.ac.th/~manoi/hosxp/mysql-ref.pdf) 39 12 Chapter E $% )( ! F 0 $% )( STAT 2.x HOSxP )*= 44 9=A<%2. )-( 9 9 J9 2. )-( STAT }</%&9)9=iA<%2. )-(!= 1$C,B .!- \10 9=)9=$4 9==$ E9 9= Admit/Discharge )9 ;'/ 7#.&9)9=i =B/)C. = 447#)?A.%902<+ 9J 8 ? 87 9 7 1. C=*0)2. )-( 9F 2. )-( 9 3$+%#)A )9?1.7 folder A*01 $ 40 > %& ? . %& STAT 2. 2.9= 44A<%2. )-( 3. 3F9 9=A<%2. )-( C$+%89 Directory 3*C/ . % 9= Import !" d:\stat 6(.1 F9# A!•6( A' 3*/C. % 9= 6(.1 A!5)\ Import ()*,( j;9 $4 CAME ,Diag (ipd) 6( ADM) &1 patient,doctor,pttype,insure,ward,cid A Import 688=$+% A*01 M; (81=3F9 9= Import came,diag,adm) 41 > %& ? . %& STAT 7 8 ?K L 8 ? STAT 7 9= =B/)7:.%9 HOSxP 4$ = 44%9 AB) &F9#=$4K=%;0949(3*)/ *= 44}$4}. 6( C. % 9= =B)/ = 44 7#) 3*( = 44KA0?)C. % 9=7#.)*,( 4$ = 44 AB) &9)9=i !oA7:.%9 Realtime Stat Export ?A. KA0 HOSxP 3F9 9=&%2. )-(,-.!\103*/ BA2<+ ?!0$%C9=9% PATIENT1, PATIENT2 , INSURE,NEWyy 6( INSURLOG 2 %J9 2. )-( STAT )*2$+ C 9=C$+%89A$% *+ 2.9# .9 • • • • • System Setting (' C$+%89 C=%#$12. STAT Export A$% *+ Check C=% Save to STAT (' Check C=% Use Pooler C$+%89CF96# % Root Folder 2 % STAT C=%: % Root Directory A!5\) Save 9 K!=6 =)6( 2.9K!=6 =)7#) 42 > %& ? . %& STAT (' 8F9&$/% Stat Exchange 9 ) - Tools -> Import & Export Data !=9 t# 9. Stat Exchange A$%=-! A!5)\ Start ;'/ =B)/ 3F9 9=&% 43 2. )-( 13 Chapter Upgrade HOSxP )* 9=!=$4!=5%6( ;$L 9 0-C( A 1(9 7 6C( version 3*/ 819)&9)9=i7#)H 6( C. % 9=K8=%&=.9%J9 2. )-(=5 7#)A.10 : $ 9= Upgrade = 44!= )97#) )* 4A.10%9 & %&1 8' • 9= Upgrade Client Software • 9= Upgrade Sturcture 2 %= 44J9 2. )-( 9= Upgrade Client Software &9)9=i3F9?A. (0 KA0 9= =*0 7:.%9 C$1 Upgrade Setup &1 %9 3*0/ 9 6( C. % 9D$0!= &4 9=>I8' %9 Upgrade Structure 9= Upgrade Structure )*2$+ C A$% *+ (' 8F9&$/% Check DB 9 ) - Miscellaneous 44 UPGRADE !"" (' 8F9&$/% Update Structure A!5\) Update Structure 45 UPGRADE !"" 3F9 9= Browse ?!0$% Program File\HOSxP 6(.1 (' 6kl) HOSXP-DB-Struture.cds 6(.1 A!5\) Upgrade 46 14 Chapter &' "-O &0 $% )( J9 2. )-(#($ 2 % HOSxP 8' MySQL }</%7 9=3F9%9 3$/1H ?! M42. )-(7 =-!6442 % MyISAM }</% !" ($ E> 2 % 9= M4 !" 6kl)2. )-(8(.90H Dbase }</%)* 819)=1A =M17 9= 9 6( 2*0 &-% '/ % 9 )* 9= A$ 4M ?1.7 =-!6442 %6kl)2. )-( }</%= %=$4 9= 9 2. )-(;=. )H $ ?A. ( #)9 &F9#=$4 Web Application) 6C 9 )* !VN#9 )'/ 7:.%9 $4= 443*C/ . %)* 9= 9 / 2*0 2. )-(7 C9=9% A*01 $ ;=. )H $ !VN#93*/&F98$N 2 %J9 2. )-(!= G3 MyISAM 8' !VN#9 ='/ % Index &*0 6( Data Corrupt }</% 9 BA2<+ ?A.4 0 #9 )*,7.- :.%9 ;=. )H $ )9 H 6( 7:.%9 7 OS 3*/ !" Windows }</%)* 9= Shutdown 09%?)i- C. % }</%3F97#.,-.A-6(= 44C. %3F9 9= } )6}) (repair table bad_table) C9=9%3*)*!VN#9 0- ='/ 0H 4$ 19K:80$%A*3*/ MySQL &9)9=i $A M42. )-(KA07:. Engine 2 % InnoDB ?A. }</% J9 2. )-(!= G3 )*+ *2. A*8' = %=$4 9=3F9 Transaction = %=$4 9= 9 6( 2*0 ;=. )H $ ?A.A* 19J9 2. )-(!= G3 MyISAM 6( 0$%)*= 44 Auto Data Recovery #9 )* 9= shutdown KA0?) #)9 &) (?kA$4) 6C)*2. &*08' 9=3F9%9 :.9 19 J9 2. )-(!= G3 MyISAM }</%7 9=7:.%9 ,-.7:.&9)9=i (' ?A.19 7#.C9=9%7A !" != G3 InnoDB #=' MyISAM 2<+ 0- $4819) #)9 &) (19 (' 819) =M1 #=' != &B3UBG9;) 7:.%9 J9 2. )-(!= G3 InnoDB $+ ,-.7:.%9 C. %C$+%897#. MySQL &9)9=i 4$ 3< 2. )-(7 =-!6442 % InnoDB ?A.} KA0 9=6 .?26kl) /etc/my.cnf #=' \windows\my.ini KA0!oA Option skip-innodb #=' 6 .?2 section innodb 7#. #)9 &) 47 #$ !* +C #. %& C$1 09% configuration 7 &1 2 % InnoDB 3*/7:. &F9#=$4 8='/ % Server 3*/)* # 10819) F9 09% . 0 512 Mb innodb_data_home_dir = /var/lib/mysql/ innodb_data_file_path = ibdata1:3000M:autoextend innodb_log_group_home_dir = /var/lib/mysql/ innodb_log_arch_dir = /var/lib/mysql/ set-variable = innodb_buffer_pool_size=256M set-variable = innodb_additional_mem_pool_size=20M set-variable = innodb_log_file_size=64M set-variable = innodb_log_buffer_size=8M innodb_flush_log_at_trx_commit=1 set-variable = innodb_lock_wait_timeout=50 ,-.7:.%9 &9)9=i !(*/0 != G32 %J9 2. )-(?A. KA07:.8F9&$/% alter table table_name type = innodb (i.9C9=9%)*2. )-( 0 9 7:. 1(9 9 )9 ) HOSxP )*= 443*/ :107#.,.A- -6( = 44 Tune != &B3UBG9;7 9=3F9%9 2 % MySQL KA0 0-7 Module CheckDB High Performance !" 9= !(*0 C9=9%3*/&F98$N7#. !" != G3 InnoDB High Speed !" 9= !(*/0 C9=9% &F98$N 7#. !" != G3 MyISAM 48 15 Chapter ! "# $% C$+%89 Replication ( % 9 Concept A- Replication Agent 8=$4 HOSxP HOSxP Project : What is data replication What is data replication ? Data replication is the process of making an exact copy of an organization’s current data, preferably without disrupting or disabling active applications. This copy may then be kept on an adjacent storage system, either locally, ready to be used in an instant should the primary system fail, or it may reside at a distant location, quickly available should a disaster hit the primary data center. In addition, the copies may be used for advanced backup initiatives, server or storage consolidations or for data migration needs. 49 !"" REPLICATION HOSxP HOSxP Project : Advantage Advantage Instant Access Ease of data transfer Ability to get data offsite immediately Highly realible storage media HOSxP HOSxP Project : Simple replication model Simple replication model (Online Backup) HOSxP Application 2-Tier Connection MySQL PostgreSQL Interbase 2-Tier Connection Replication Agent Transaction Log Transaction Log Master/Slave MySQL PostgreSQL Interbase Master/Slave 50 !"" REPLICATION HOSxP HOSxP Project : Realtime Replication Model Simple replication model (Multi-Master / Multi-Slave) RP Agent RP Agent RP Agent Synchronize Time : 3-10 seconds (100 Transaction/Sec.) Botton Neck Problem ! HOSxP HOSxP Project : How it work ? How it work ? HOSxP application has an ability to intercept SQL transaction and logging it Transaction log interception occur in application level All transaction log was collected to master database (only change event : insert, update, delete, … ) Replication agent read transaction log from master and apply updates to their slave databases Replication process occurs continously at scheduled intervals or on demand Replication engine does not require constant network connectivity (can work with dialup connection) 51 !"" REPLICATION HOSxP HOSxP Project : Advance Replication Model Advance replication model HOSxP Application MySQL PostgreSQL Interbase MS SQL Data Center Replication Agent Transaction Log Transaction Log HOSxP HOSxP Project : Advance Replication Model Advance replication model Data Center RP Agent Hospital node A Control Application RP Agent RP Agent PCU 1 node B PCU 2 node C 52 !"" REPLICATION HOSxP HOSxP Project : Advance capabilities Advanced capabilities Replication occurs in application level and can work with any database (MySQL , PostgreSQL, Interbase, MS SQL) Replication process is not impact DBMS performance Easy configuration, just set slave configuration and start replication agent. Network connectivity is flexible, multiple database scenarios and organizations are possible , replication process can be done with low speed connection. Replication agent can run in the same host where DBMS is running (in console mode) < ><N O 9P : Replication 9 7 • Replication Agent (RP Agent) • Transaction Log • 9=C$+%89 Master 6( Slave Replication Agent !V 54$ i- ;$L 97 = 44!•B4$CB 9= Linux ( <%C. %&$/%7#.39F %9 7 Linux A.10) &9)9=i Download ?A.3/* */ http://prdownloads.sourceforge.net/hosxp/my_replicator-2004-12-01.gz?download Transaction Log 7 9=3F9%9 ! CB HOSxP ?)&=.9% Transaction Log }</%C. % 2.9?!C$%+ 89 Replication Slave 2 %= 44 HOSxP <% &=.9% Transaction Log 7 2> 3F9%9 KA0)*1BU*C+%$ 89 A$% *+ 53 !"" REPLICATION C$+%89 Slave (%7 : % Slave List A!5)\ Check Slave ;'/ C=1 & 4 9= :'/ )C 4$ Slave &i9 9= Synchronize !V 54$ 2 % Slave A!5)\ Reset ;'/ &$%/ 7#. Slave 3F9 9= Reset Transaction Log Count ;'/ 3*/ 3F9 9= =B/) Replication Process 7#) 54 !"" REPLICATION Event ID i- Reset 7#.C=% $42 % Master #($% 9 3*/)* 9=C$+%89 Replication Slave 6(.1i.9C. % 9=7#. BA 9= Replication C. %)* 9= &$/% 7#. Replication Agent 3F9%9 KA0)*2$+ C A$% *+ ( =B/)C$%+ 6C#($% 9 Download Agent )96(.1) 55 !"" REPLICATION 9= =*0 7:.%9 Replication Agent &9)9=i3F9?A.KA0;B);I my_replicator host database user password : my_replicator 10.0.0.1 hos sa sa :B ><K9N > Replication • )$/ 7 ?A.19#9 8='/ % Server C$16= )*!VN#9A.9 Hardware &9)9=i7:. Server 3*/ !" Slave 3A63 ?A.3$ 3* • &9)9=i7:. 8='/ % Server 3*/ !" Slave 3F9 !" Report Server ?A. ( '/ % 9 9=3F9 =90%9 &1 7#N 7:. 9=!= )1(,( 9 ) • #9 C$%+ 9=3F9%9 !" N-Way &9)9=iC$+% 8='/ % Server 7 = 443*/3F9%9 ;=. )H $ ?A.#(90H 8='/ % ;'/ = %=$4 9= :'/ )C 9 #(90 Client (>1,000 connection) 56 16 Chapter 0 $% )( , %/' HOSxP & $4& 5 9=3F9%9 $4J9 2. )-(#(90!= G3 ?A.6 MySQL, PostgreSQL, Microsoft SQL 6( Interbase (Fire Bird) 6CJ9 2. )-(#($ 3*/7:.%9 ?A.A*8' MySQL (4.0.15) 7 49%K=%;0949( ?A.)* 9=}'+ (B2&B3UB]2 %J9 2. )-(?1.6(.1 : Microsoft SQL Server #=' 49%K=%;0949( 9 )*819)85. 80 4$ J9 2. )-(C$1 '/ 0-6(.1 : PostgreSQL 7 43 *+ F9 & 1BU* 9=K J9 2. )-(?!?1.7 = 44 /' H F L 8 ? 87 9 7 1. 3F9 9=&=.9% DDL 2 %J9 2. )-(!(9039%KA0 9D$0 2. )-(K8=%&=.9% 9 J9 2. )-(!V 45 $ 2. 7:. Admin Tools 2 %J9 2. )-(!(9039% 3F9 9=&=.9% User Account 6( Database ;=. )3$%+ Grant &B3UBC9%H 7#. =*04=. 0 3. F9 DDL 3*?/ A. ?!3F9 9=&=.9%K8=%&=.9%C9=9%7 J9 2. )-(!(9039% 4. 3F9 9=K 2. )-( 9 J9 2. )-(!V 54$ ?!0$%J9 2. )-(!(9039% 5. 3A& 4 9=3F9%9 $4J9 2. )-(!(9039% ( : '/ % 9 HOSxP i6447#.3F9%9 4$ MySQL !" #($ A$% +$ 49%= 44 0$%?) &9)9=i7:.%9 =1) 4$ J9 2. )-(!= G3 '/ H ?A. 6( 7 9=0.90J9 2. )-( C$1J9 2. )-(C. 39% C. % !" MySQL 39 $+ ) 57 . %&) " !"" -$ B 8 ?K PostgreSQL (' 8F9&$/% Check DB 9 ) Tools -> Miscellaneous (' 8F9&$/%0 0 Export DDL 58 . %&) " !"" -$ A!5)\ PostgreSQL ;'/ 3F9 9= Generate DDL &F9#=$4 PostgreSQL (' Tab Destination DB ;'/ 2.9 # .9 Run Script 59 . %&) " !"" -$ C$+%89 9= :'/ )C 4$ J9 2. )-(!(9039% 7#. =*04=. 0 9 +$ A!5\) Connect 6( Run Script ;'/ 3F9 9=&%:5A8F9&$/% DDL ?!0$%J9 2. )-( !(9039% (' 8F9&$/% Data Exporter 9 ) - Tools -> Import & Export Data 60 . %&) " !"" -$ C$+%89 9= :'/ )C 4$ J9 2. )-(!(9039%7#.i- C. % A!5)\ Start Export ;'/ 3F9 9=&%2. )-(?!0$%J9 2. )-( !(9039% 61 . %&) " !"" -$ 62 6 3 63