ãã®èšäºã§ã¯ãMS SQLãŠãŒãã£ãªãã£ã®ã¯ã€ãã¯ã¡ã³ããã³ã¹ãšããã¯ã¢ããã䜿çšããŠããããã¯ãŒã¯äžã®SQL Serverã®ãã¹ãã€ã³ã¹ã¿ã³ã¹ã®ããã¯ã¢ããããèªåããŒã¿ããŒã¹å埩ãæ§æããæ¹æ³ã«ã€ããŠã話ããããšæããŸãã åæã«ãéåžžã®ãµãŒãã¹ãã©ã³ã§ããã¯ã¢ãããäœæãããŸãã èªåå埩ã®å¿ èŠæ§ã¯ã次ã®å Žåã«çºçããå¯èœæ§ããããŸãã
- ãã¹ããµãŒããŒäžã®ããŒã¿ããŒã¹ãå®æçã«æŽæ°ããå¿ èŠãããå Žåã
- ãªã«ããªãéããŠäœæãããããã¯ã¢ãããå®æçã«ç¢ºèªããå¿ èŠãããå ŽåïŒãã«ããã«ã¿ããã©ã³ã¶ã¯ã·ã§ã³ãã°ã
ãããã¯ãŒã¯äžã§ããããã®ã¿ã¹ã¯ãäœããã®æ¹æ³ã§èªååã§ããã¹ã¯ãªããã®äŸãèŠã€ããããšãã§ããŸãã ãã ããã»ãšãã©ã®ãœãªã¥ãŒã·ã§ã³ã§ã¯ããµããžã§ã¯ãé åã§ããT-SQLãååã«ç解ããå¿ èŠãããããµãŒãã¹ãã©ã³ãå€æŽããå¿ èŠããããŸãã MS SQLïŒQMBïŒãŠãŒãã£ãªãã£ã®ã¯ã€ãã¯ã¡ã³ããã³ã¹ãšããã¯ã¢ããã䜿çšããŠã15ã20åã§ãããè¡ãæ¹æ³ã瀺ããŸãã XMLãªã«ããªãã©ã³ã®ã¡ã«ããºã ã䜿çšããŸããããã¯ããŠãŒãã£ãªãã£ãäœæã§ããäžé£ã®ããã¯ã¢ãããå«ãXMLãã¡ã€ã«ã§ãã XMLãã¡ã€ã«ã®æ å ±ã«åŸã£ãŠãããã°ã©ã ã¯äžé£ã®ããã¯ã¢ãããåä¿¡ããå埩çšã®T-SQLã¹ã¯ãªãããçæããå®è¡ããããã«å®è¡ããŸãã ãã®æ©èœã®è©³çŽ°ã«ã€ããŠã¯ã ãã¡ããã芧ãã ãã ã
ãã®èšäºã®ä»ã«ã å ¬åŒWebãµã€ãã§ãŠãŒãã£ãªãã£ã®ä»ã®æ©èœã®è©³çŽ°ããèªã¿ãã ãã ã
ææŠãã
ãã®ãããããã€ãã®ããŒã¿ããŒã¹ãå®å šåŸ©æ§ã¢ãã«ã§å±éãããŠãã皌åäžã®SQL ServerïŒSrv01ïŒããããšããŸãã ä»»æã®ããã¯ã¢ããæŠç¥ãæã€ãµãŒãã¹ãã©ã³ããµãŒããŒäžã«äœæãããŸããã ç§ã®å Žåãããã¯æ¬¡ã®ãšããã§ãã
å®å šããã¯ã¢ãã-æ¯é±æ¥ææ¥ã®24.00
å·®åããã¯ã¢ãã-æ¥ææ¥ãé€ãæ¯æ©24æ
ãã°ããã¯ã¢ãã-æ¯æ¥1æéããšã«9.00ãã23.59ãŸã§
ããã¯ã¢ããã¯ãã©ã«ããŒFïŒ\ MS SQL \ Backupã«äœæãããŸãã åæã«ãSQL ServerãšãŒãžã§ã³ãã¯ããŒã¿ããŒã¹ããšã«åå¥ã®ãµããã©ã«ããŒãäœæããŸãã
ã¿ã¹ã¯ïŒããã¯ã¢ããSQL ServerïŒãã³ãã³ïŒã§æ¯æ¥23:00ã«ãSrv01ã§äœæãããããã¯ã¢ããããããŒã¿ããŒã¹ãå¯èœãªéãæåŸã®ç¶æ ã«åŸ©å ããŸãã äž¡æ¹ã®ãµãŒããŒãåäžã®ããŒã«ã«ãããã¯ãŒã¯äžã«ãããŸãã åããŒã¿ããŒã¹ã埩å ããåŸããã®æŽåæ§ããã§ãã¯ããå¿ èŠããããŸãïŒDBCC CHECKDBïŒã ãããã£ãŠãæ¥ææ¥ãé€ãæ¯æ©ãæ¥äžã«äœæããããã«ããã¯ã¢ãããå·®åããã³ãã©ã³ã¶ã¯ã·ã§ã³ãã°ããã®ãªã«ããªãå®è¡ãããŸãã æææ¥ã«ãæææ¥ã«äœæããããã«ããã¯ã¢ãããšãã©ã³ã¶ã¯ã·ã§ã³ãã°ãããªã«ããªãå®è¡ãããŸãã äœããã®çç±ã§ãªã«ããªã倱æããå Žåã管çè ã¯é»åã¡ãŒã«éç¥ãåä¿¡ããå¿ èŠããããŸãã
ãã¹ãSQL ServerïŒãã³ãã³ïŒãå埩ãå®è¡ã§ããããã«ããã«ã¯ãããã¯ã¢ãããã¡ã€ã«ã«ã¢ã¯ã»ã¹ã§ããå¿ èŠãããããšã¯æããã§ãã ããã§ã¯2ã€ã®ãªãã·ã§ã³ãå¯èœã§ãã
- Srv01ã§ãã©ã«ããŒFïŒ\ MS SQL \ Backupãå ±æããŠããã³ãã³ã§äœ¿çšã§ããããã«ããŸãã
- QMBã䜿çšããŠããã³ãã³ã§å©çšå¯èœãªå ±æãããã¯ãŒã¯ãã©ã«ããŒã«ããã¯ã¢ãããã³ããŒããŸãã
è¿œå ã®ä¿¡é Œæ§ãšã»ããã¢ããã®å®¹æãã«ããã2çªç®ã®ãªãã·ã§ã³ãã€ãŸã ãŠãŒãã£ãªãã£ã¯ããã«ãã¡ã€ã«ããããã¯ãŒã¯ãã©ã«ããŒã«ã³ããŒããŸãã
äžè¬çãªæé
ãã®ããã次ã®æé ãå®è¡ããå¿ èŠããããŸãã
- å ±æãããã¯ãŒã¯ãã©ã«ããŒãèšå®ãã
- QMBãŠãŒãã£ãªãã£ãã€ã³ã¹ããŒã«ãã
- éç¥ãèšå®ããããã°ã©ã ã«2ã€ã®SQL ServerïŒSrv01ãšLondonãç»é²ããŸãã
- ããã°ã©ã ã§2ã€ã®æ°ããã¿ã¹ã¯ãäœæããŸãã
- ãããã¯ãŒã¯ãã©ã€ãã§ã®XMLãªã«ããªãã©ã³ã®äœæ
- ãããã¯ãŒã¯ãã©ã€ãããã®XMLãã©ã³ã®å埩
- ããã°ã©ã ã§2ã€ã®ã¹ã¯ãªãããäœæããŸãã
- å ±æãµãŒããŒã«ããã¯ã¢ãããã¡ã€ã«ãã³ããŒããŠXMLãªã«ããªãã©ã³ãäœæããéçšãµãŒããŒSrv01äžã®ã¹ã¯ãªããã 1æéããšã«éå§ããŸãã
- å ±æãã©ã«ããŒã«ããããã¯ã¢ããããXMLå埩ãå®è¡ãããã³ãã³ã®ãã¹ããµãŒããŒäžã®ã¹ã¯ãªããã æ¯æ¥23.00ã«éå§ããŸãã
以äžã§ã¯ãåã¹ãããããã詳现ã«æ€èšããŸãã
QMBã€ã³ã¹ããŒã«
ãŠãŒãã£ãªãã£ã¯ããããããŠã³ããŒãã§ããŸã ã è©Šçšæéã¯30æ¥éã§ãã
ãã³ãã³ã®ãã¹ããµãŒããŒã«ãŠãŒãã£ãªãã£ãã€ã³ã¹ããŒã«ããŸããã äžè¬çã«ãããã°ã©ã ã¯24æé皌åããŠããã³ã³ãã¥ãŒã¿ãŒã«ã€ã³ã¹ããŒã«ã§ããŸãã SQL Serverãžã®ã€ã³ã¹ããŒã«ã¯ãªãã·ã§ã³ã§ãã ããã°ã©ã ãã€ã³ã¹ããŒã«ãããšãããã¹ãŠã®ããã©ã«ãèšå®ã®ãŸãŸã«ããŸãã ã€ã³ã¹ããŒã©ãŒã¯QmbServiceãšã¯ã©ã€ã¢ã³ããµãŒãã¹ãã€ã³ã¹ããŒã«ããŸãã
SQL Serverã®ç»é²ãšéç¥ã®æ§æ
ããã°ã©ã ãåããŠèµ·åãããšããŠã£ã¶ãŒããéããŸãã 次ã®ã¹ãããã«é²ã¿ããã¡ãŒã«ã¢ã©ãŒããæå¹ã«ããããã§ãã¯ããã¯ã¹ãèšå®ããŠãéç¥ãåä¿¡ããã¡ãŒã«ã¢ãã¬ã¹ãå ¥åããŸãã
éç¥ãéä¿¡ããã«ã¯ãç¬èªã®SMTPã¢ã«ãŠã³ããæ§æããããšããå§ãããŸãããç°¡åã«ããããã«çµã¿èŸŒã¿ã䜿çšããŸãã 次ã«ãSQL Serverã«æ¥ç¶ããSQL Serverã®ååãšã¢ã«ãŠã³ããå ¥åããŸãã sysadminç¹æš©ãæã€ã¢ã«ãŠã³ãïŒããã©ã«ãã§ã¯saïŒãæå®ããå¿ èŠããããŸãã
次ã®ã¹ãããã§ãããã°ã©ã ã¯ãµãŒããŒã®ããŒãžã§ã³ãã©ã€ã»ã³ã¹ãããã³ããã¯ã¢ããå§çž®ã®å åã衚瀺ããŸãã ããã©ã«ãã§ã¯ãã¹ãŠã®ãã©ã¡ãŒã¿ãŒãæ®ãããé²ãããã¿ã³ãã¯ãªãã¯ããŸãã
次ã®ãŠã£ã³ããŠã§ã空ããã£ã¹ã¯å®¹éã®è¿œè·¡ãèšå®ã§ããŸãã ãããäžèŠãªå Žåã¯ããã£ã¹ã¯ãããã¹ãŠã®ãã§ãã¯ããã¯ã¹ãåé€ããŸãã
[転é]ãã¿ã³ãã¯ãªãã¯ããŸãã
ããŒã¿ããŒã¹ã管çããå¿ èŠã¯ãªãã®ã§ãæåŸã®ããŒãžã§ã空ã®ã¹ã¿ã³ãã¢ãã³ã¹ã¯ãªãããäœæããããéžæããŸãã 次ã«ããã·ã¹ãã ããŒã¿ããŒã¹ãåŠçããããã®ã¹ã¿ã³ãã¢ãã³ã¹ã¯ãªãããäœæãããã®ãã§ãã¯ãå€ãããå®äºããã¿ã³ãã¯ãªãã¯ããŸãã
ããã°ã©ã ã¯SQL Serverãç»é²ããæ°ãã空ã®ã¹ã¯ãªãããã©ãŒã ãéããŸãã
XMLãªã«ããªãã©ã³ã®äœæ
ããã°ã©ã å ã®ã¿ã¹ã¯ã¯ãã¹ãŠãã¹ã¯ãªããã®äžéšãšããŠå®è¡ãããŸãã æ°ããã¹ã¿ã³ãã¢ãã³ã¹ã¯ãªããã®ãŠã£ã³ããŠã§ãååã XMLãªã«ããªãã©ã³ã®äœæ ããå ¥åããŸã ã
ãªã«ããªãã©ã³ã®XMLãã¡ã€ã«ãäœæããã¹ã¯ãªããã«ã¿ã¹ã¯ãè¿œå ããŸãã [è¿œå ]ãã¿ã³ãã¯ãªãã¯ããŸãã ã¿ã¹ã¯éžæãã©ãŒã ãéããŸãã ãã¿ã³ãã¯ãªãã¯ããŠãã ãã ãæ°ããã¿ã¹ã¯ãè¿œå ããŸããã æ°ããã¿ã¹ã¯ãã©ãŒã ãéããŸãã
å¿ èŠãªãã©ãŒã ïŒ
- ã¿ã¹ã¯ã¿ã€ãããXMLãªã«ããªãã©ã³ã®äœæãã«å€æŽããŸã
- å
±æãã©ã«ããŒãžã®æ°ããæ¥ç¶ãäœæããŸãã ç§ã®å Žåãããã¯ãã¡ã€ã«ãµãŒããŒäžã®\\ Server \ Backupãã©ã«ãã§ãã
泚ïŒãã¡ã€ã³ã®ãªããããã¯ãŒã¯ã®å ŽåããŠãŒã¶ãŒåã¯æ¬¡ã®åœ¢åŒã§æå®ããå¿ èŠããããŸãïŒComputer \ User
- XMLãªã«ããªãã©ã³ã«å«ããããŒã¿ããŒã¹ãéžæããŸãã ç§ã®å Žåããããã¯3ã€ã®ããŒã¿ããŒã¹ã§ã-Account2013ãAccount2014ãAccount2015ã
- ã¿ã¹ã¯ã®ååãæå®ããŸã-Account2013ãAccount2014ãAccount2015ã®XMLãã©ã³ãäœæããŸãã
ãã¹ãŠã®ã¹ããããå®äºãããšãã¿ã¹ã¯ã®ãã©ãŒã ã¯æ¬¡ã®ç»åã®ããã«ãªããŸãã
ãäžè¶³ããŠããã¢ãŒã«ã€ãã³ããŒãã¡ã€ã«ãå ±æãã©ã«ããŒã«ã³ããŒããããšããèšå·ã«æ³šæããŠãã ããã ãã®ãªãã·ã§ã³ã«ãããããã°ã©ã ã¯äžè¶³ããŠããããã¯ã¢ãããã¡ã€ã«ãããŒã«ã«ã®SQL Serverãã©ã€ããããããã¯ãŒã¯ãã©ã«ããŒã«èªåçã«ã³ããŒããŸãã åæã«ãããã°ã©ã ã¯äœæãããããã¯ã¢ããã«é¢ããç¬èªã®æ å ±ã«ãã£ãŠãœãŒã¹ãã¡ã€ã«ãžã®ãã¹ã決å®ããŸãããã®æ å ±ã¯ãSQL Serverãmsdbã·ã¹ãã ããŒã¿ããŒã¹ã«ä¿åããŸãã
[ æ¿è«Ÿ ]ãã¿ã³ãã¯ãªãã¯ããã¹ã¯ãªããã§äœæãããã¿ã¹ã¯ãéžæããŸãã ã¹ã¯ãªããã®ãã©ãŒã ã§ããã¹ã¯ãªãããã¹ã±ãžã¥ãŒã«ã©ããã«å®è¡ããã©ã°ãèšå®ããã¹ã±ãžã¥ãŒã«ã瀺ããŸããæ¯æ¥ã1æéåŸã®9:30ãã22:30ãŸã§ã ãµãŒãã¹ãã©ã³ã¯9:00ãã23:59ãŸã§1æéããšã«ããã¯ã¢ãããã°ãäœæããããšãæãåºãããŠãã ããã ãã®ããã«ããŠãQMBã¯30åã®ã·ããïŒ9ïŒ30ã10ïŒ30ã11ïŒ30ãªã©ïŒã§XMLãªã«ããªãã©ã³ãæŽæ°ããŸãã ããã¯ã¢ãããQMBãµãŒãã¹ããªã·ãŒã«ãã£ãŠäœæãããå Žåããªã«ããªãã©ã³ã®XMLãã¡ã€ã«ã¯èªåçã«æŽæ°ãããããšã«æ³šæããŠãã ããã
ã¹ã¯ãªããã¯æ¬¡ã®ç»åã®ããã«ãªããŸãã
次ã«ãã¹ã¯ãªããã確èªããŸãã ãããè¡ãã«ã¯ããå®è¡ããã¿ã³ãã¯ãªãã¯ããŸãã ãã¹ãŠãæ£ããæ§æãããŠããå Žåãããã¯ã¢ãããã¡ã€ã«ããããã¯ãŒã¯ãã©ã«ããŒã«ã³ããŒããã RestorationPlan.xmlãã¡ã€ã«ãäœæãããŸãã ããã°ã©ã ãæäœäžã«å¿ èŠãªããã¯ã¢ãããã¡ã€ã«ãèŠã€ããããªãå Žåãã¿ã¹ã¯ã¯å€±æããŸãã ãã®ããã«ããŠãæœåšçãªåé¡ã«ã€ããŠäºåã«ç¥ãããšãã§ããŸãã ããšãã°ãå€ãã®å Žåã管çè ã¯ããŒã¿ããŒã¹è»¢éã®ãã«ããã¯ã¢ãããïŒCOPY_ONLYãã©ã¡ãŒã¿ãŒãªãã§ïŒäœæãã転éåŸã«ã¹ããŒã¹ãå æããªãããã«ããã«åé€ããŸãã ãã ããããã¯ã¢ãããã§ãŒã³ãç ŽæããçŸåšã®æç¹ãžã®åŸ©å ãäžå¯èœã«ãªããŸãã ããã°ã©ã ã¯ãXMLãªã«ããªãã©ã³ãäœæãã段éã§ããã®åé¡ãç¹å®ããŸãã
ã¹ã¯ãªãããä¿åããŸãã ããã§ãQMBã¯1æéããšã«ãå埩èšç»ã®XMLãã¡ã€ã«ãåäœæããéåžžã®SQL ServerãšãŒãžã§ã³ããäœæããæ°ããããã¯ã¢ãããã¡ã€ã«ãã³ããŒããŸãã
XMLãã©ã³ãäœæããã¿ã¹ã¯ã¯ãå¯èœãªéãæåŸã®æç¹ã§ã®å埩ã«ã®ã¿å¿ èŠãªãã¡ã€ã«ãã³ããŒããããšã«æ³šæããŠãã ããã ãã®å Žåããã¡ã€ã«ã¯ãã©ã«ããŒãªãã§ã³ããŒãããŸãã ãã¹ãŠã®ãã¡ã€ã«ã¯ãæå®ããããããã¯ãŒã¯ãã©ã«ããŒã«é 眮ãããŸãã ãã®ããã°ã©ã ã«ã¯ããµããã©ã«ããŒã®ã³ããŒãããã³ãããã¯ãŒã¯ãã©ã«ããŒå ã®å€ããã¡ã€ã«ã®åé€ãæ§æããæ©èœããããŸãã ããã¯ãCMDã¹ã¯ãªãããå«ããŠãŒã¶ãŒã¿ã¹ã¯ãŸãã¯QMBãµãŒãã¹ããªã·ãŒã䜿çšããŠå®è¡ã§ããŸã ã
ãã¹ããµãŒããŒã§ã®å埩
ã¹ã¯ãªããã«é 眮ãããç¹å¥ãªã¿ã¹ã¯ã䜿çšããŠãXMLãã©ã³ããã®å埩ãåæ§ã«å®è¡ãããŸãã ãã ãããã¹ãSQL ServerïŒãã³ãã³ïŒã§ãªã«ããªãå®è¡ããå¿ èŠãããããããã®ãµãŒããŒãããã°ã©ã ã«ç»é²ããå¿ èŠããããŸãã ãããè¡ãã«ã¯ãå·ŠåŽã®ããªãŒãã¥ãŒã§ããã¯ãªãã¯ããŸã ãµãŒããŒãç»é²ããŸãã ãµãŒããŒã®ç»é²æé ã¯ãåè¿°ã®æé ãšãŸã£ããåãã§ãã
ãµãŒããŒãç»é²ãããšããªãã©ã€ã³ã¹ã¯ãªãããŠã£ã³ããŠãéããŸãã Srv01ã䜿çšããŠXMLãã©ã³ã«åŸã£ãŠRestoreãšããååãå ¥åãããã®ã¹ã±ãžã¥ãŒã«ã瀺ããŸãïŒæ¯æ¥23:00ã
ããã§ãXMLãã©ã³ãäœæããã¿ã¹ã¯ãäœæããæ¹æ³ãšåæ§ã«ãã¹ã¯ãªãããã©ãŒã ããæ°ããã¿ã¹ã¯ãè¿œå ããŸãã ãã ããããã§[ ã¿ã€ã]ãã£ãŒã«ãã§[ XMLãã©ã³ã§åŸ©å ]ãæå®ãã以åã«äœæãããããã¯ãŒã¯ãã©ã«ããŒãžã®æ¥ç¶ãéžæããŠãXMLãã¡ã€ã«ã®ååãæå®ããŸãã ãœãŒã¹ããŒã¿ããŒã¹ã¹ã€ããã¯ãXMLãªã«ããªãã©ã³ã®ã©ã®ããŒã¿ããŒã¹ã埩å ããå¿ èŠããããã決å®ããŸãã
å埩ãå®è¡ãããããŒã¿ããŒã¹ã¯ãåãååã®ã¹ã€ããã«ãã£ãŠæ±ºå®ãããŸãã ãã®å Žåãåãååã®ããŒã¿ããŒã¹ã«åŸ©å ããŸãã ããã¯ãSQL Serveräžã§é¡äŒŒããååã®ããŒã¿ããŒã¹ãäœæ/äžæžããããããšãæå³ããŸãïŒç§ã®å Žåããããã¯3ã€ã®ããŒã¿ããŒã¹ã§ãïŒAccount2013ãAccount2014ãAccount2015ïŒã ãããã£ãŠããããã®ããŒã¿ããŒã¹ã¯æåŸã®ç¶æ ã«æŽæ°ãããŸãã
ããã¯ã¢ãããã¡ã€ã«ãšå埩æé ã確èªããããã«å埩ãå®è¡ããå Žåã¯ã[äžæããŒã¿ããŒã¹ã«åŸ©å ]ã¢ãŒããéžæããå¿ èŠããããŸãã ãã®ã¢ãŒãã§ã¯ãQMBã¯qmbTempRestoreDb [Random Index]ãšããååã®äžæããŒã¿ããŒã¹ãäœæããŸãããã®ããŒã¿ããŒã¹ã¯ãæŽåæ§ã埩å ããŠç¢ºèªããåŸã«åé€ãããŸãã
ã¿ã¹ã¯ãä¿åããã·ããªãªã§éžæããŸãã
ãªã«ããªãæåããããšã確èªããããã«ãæåã¢ãŒãã§ã¹ã¯ãªãããå®è¡ããŸãã ããã°ã©ã ã¯åããŒã¿ããŒã¹ãé 次埩å ãããã®æŽåæ§ããã¹ãããŸãã ããŒã¿ããŒã¹ã®ãµã€ãºã«ãã£ãŠã¯ãæé ã«ããªãã®æéããããå ŽåããããŸãã
ã¹ã¯ãªãããä¿åããŸãã çŸåšãæ¯æ¥23:00ã«ããã°ã©ã ãèªåçã«ããŒã¿ããŒã¹ã埩å ããé害ãçºçããå Žåã«é»åã¡ãŒã«éç¥ãéä¿¡ããŸãã
ããã«ãå埩èšç»XMLãã¡ã€ã«ã䜿çšããŠãããã°ã©ã ã䜿çšãã管çè ã¯ãæ°åã¯ãªãã¯ããã ãã§ãä»ã®SQL Serverã®ããŒã¿ããŒã¹ãæåã§åŸ©å ã§ããŸãã
ã³ã¡ã³ããEã¡ãŒã«support@qmbsql.ruã§è³ªåã«ãçãããŸã
ãæž èŽããããšãããããŸããïŒ