[MSSQL] สรุปงาน SQL Server Community Thailand Meeting #16

Blog นี้ Publish ช้านิดนึง เมื่อคืนมีเคสเข้า 555

SQL 2012 End Of Support ต้องทำอย่างไร ?

- Lifecycle Product ของ Microsoft ที่ติดตั้งบน On Premise (Local)
  • Life Cycle จะอายุประมาณ 10 ปี โดยแยกเป็น
    • 5 ปีแรกจะเป็นส่วนของ Feature ใหม่ๆ + Security Update
    • ส่วน 5 ปีหลังจะมีเฉพาะ Security Update
  • และ End Of Support
- End Of Support มีผลกระทบอะไรบ้าง ?
  • ไม่มี Security Update
  • ไม่ได้ Feature ใหม่ๆ ที่ช่วยให้ประสิทธิภาพของระบบดีขึ้น เช่น In-Memory DB เป็นต้น
  • มีปัญหากับ Compliance ใหม่ เช่น PDPA ที่หากข้อมูลเราหลุดไปจาก Server ที่ EOS ไปแล้ว เราอาจจะต้องมีส่วนรับผิดชอบตามกฏหมายด้วยนะ
- หลัง End Of Support ไปแล้ว ตัว SQL Server 2012 มีแนวทางไปต่ออย่างไร ?
  1. Do Nothing - ปล่อยมันไป อย่างที่เป็น
  2. On-Premise
    1. Upgrade tp SQL Server 2019 ++
    2. ใช้ SQL Server 2012 ซื้อ Extended Security Updates (ต้องมี SA License) หรือ + Azure Arc ได้
  3. Public Cloud
    • Azure SQL VM - laaS Solution สำหรับยกระบบขึ้นมาเลย
    • Azure Manage Instance - PaaS Solution สำหรัยยก DB ขึ้นมา แล้วในแง่ของ OS Azure จะดูแลเอง
  4. Hybrid Cloud - ย้ายมา Cloud แต่เป็น Private
    1. Azure Stack HCI + Azure SQL VM
    2. Azure Arc-enabled SQL Managed Instance Overview - Azure Arc | Microsoft Docs

NOTE: พวก App เดิมๆ ยังไม่ได้แก้ไข หลังจากย้าย Database ไปแล้ว ต้องไปกำหนด compatibility-level เพิ่มเติมตาม ALTER DATABASE compatibility level (Transact-SQL) - SQL Server

Migrate to Azure SQL

  • Pre-Migration
    • Discover - ตรวจสอบก่อนว่า DB Server มีกี่ Database / Size เท่าไหร่ / มีการกำหนด Property อะไรบ้าง / Initial Data วันไหน
    • Access - ดูว่า DB Server ของเดิม ตัว App / Store Proc เป็นต้น Compatible กับ MS SQL Server เวอรชั่นใหม่ไหม ถ้าเป็นการย้ายค่ายต้องเตรียมหา Feature หรือคำสั่งที่มาทดแทน เช่น จาก Oracle > MS SQL Server
    • Convert - Database / App เตรียมรอไว้ ในกรณีที่มาจากค่ายอื่นๆ
  • Migration
    • Migrate - ตั้งต้น Schema + Object ต่างๆ จากนั้นนำ Data มา Initial ตั้งต้น
      NOTE ถ้า Data ใหญ่มากๆ อาจจะเตรียม Solution ที่ Dump Data ด้วย
    • Data Sync - ขึ้นกับ Strategy ในการ Migrate ว่าเป็นการ Cut-Over (Offline Migrate) หรือ Parallel ถ้าเป็นแบบ Parallel ต้องสนใจในส่วนนี้ เพราะต้องทำให้ Data Database ใหม่ Update เท่ากับของเดิม ไม่ให้เปิด downtime นานเกินไป ถ้าเป็น
      • MS SQL อาจจะทำ Always On/ Log shipping / Azure Data Sync
      • ข้ามค่าย อาจจะต้องใช้ tool มาทำ batch / sync data
    • Cut Over ย้ายไปใช้ DB ใหม่
  • Post-Migration
    • ทดสอบ Application
    • ตรวจ Functional Test / Performance Test
    • Optimize มาปรับจูน Parameter ของ DB
- Migration Tools
  • Data Migration Assistant (DMA) ตรวจสอบ Compatibility Issue และ ทำ Migration
  • Azure Database Migration Service (DMS) สำหรับ Migrate Database ไป Azure
  • Azure Migrate มองภาพใหญกว่า Database โดยจะเป็น Tool ที่ตรวจสอบ Asset บน On-Premise และแนะนำ Size ที่ต้องใช้งานบน Azure ถ้าจะตรวจ Compatibility Issue มันจะไปเรียก DMA ต่ออีกที
  • Azure SQL migration extension for Azure Data Studio = Azure Migrate + DMA + DMS

- Azure SQL Migration Methodology

  • NOTE สำหรับตัว Demo แนะนำให้ดูจาก Clip ด้านล่างได้เลยครับ

เกร็ด SQL อ่านอย่างไร ?

อ่านได้ทั้ง 2 แบบครับ

  • SEQUEL ซึคั่ว - ยุคแรกของ SQL ที่พัฒนามาจาก IBM โดย SEQUEL ย่อยมาจาก Structured English Query Language
  • SQL - เอส คิว แอล สมัยใหม่ๆแล้วครับ
  • อ้างอิงจาก

ปิดท้าย

  • ส่วนตัวลอง MS SQL Server 2022 Container อยู่เหมือนกันครับ สงสัยเหมือนกันว่าทำ Recommend ยังให้ใช้ 2019
  • สำหรับใครที่อยากดู Blog สรุปงาน SQL Server Community Thailand Meeting ย้อนหลังสามารถติดตามที่ Tag SQLServerMeetupTH ได้ครับ

Resource

  • VDO งาน

Reference


Discover more from naiwaen@DebuggingSoft

Subscribe to get the latest posts to your email.