ขั้นตอนการทดสอบ Connection ของ SQL Server |
|
|
|
1 |
ทดสอบ ปัญหา Network |
|
|
|
|
|
ping -a IP-Address |
|
|
|
|
|
|
ping -a Server name |
|
|
|
|
|
|
nslookup |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
SQL Server Configuration |
|
|
|
|
|
ใช้ SCM (SQL Server Configuration Manager) enable protocol ที่ต้องการใช้งาน |
|
เราสามารถตรวจสอบว่าระบบพร้อมรับ connection หรือไม่จาก log file |
|
|
%ProgramFile%Microsoft SQL Server/MSSQLxx.xxx/MSSQL/Log |
|
|
|
|
|
|
|
|
|
ที่ server ต้อง run "SQL Browser" ในกรณีที่ต้องการให้ client connect มาโดยใช้ "name instance" |
|
|
|
|
|
|
|
|
3 |
Firewall Issue |
|
|
|
|
|
|
เปิด Firewall สำหรับ SQL Browser and SQL Server |
|
|
|
สำหรับ Native Protocol ให้เปิด Firewall สำหรับ File sharing (ใช้ SMB protocol เหมือนกัน) |
|
สำหรับ TCP Protocol ให้เปิด Port ที่ต้องการ (default คือ 1433) |
|
|
สำหรับ UDP Protocol ให้เปิด Port ที่ต้องการ (default คือ 1434) |
|
|
|
|
|
|
|
|
|
4 |
Client Issue |
|
|
|
|
|
|
telnet server-ip-address tcp-port |
|
|
|
|
|
|
|
|
|
|
|
|
|
ใช้ tools ข้างล่างลอง test connect |
|
|
|
|
OSQL (SQL2000) ใช้ MDAC |
|
|
|
|
|
OSQL (SQL2005 & 2008) ใช้ SNAC ODBC |
|
|
|
|
SQLCMD (SQL2005 & 2008) ใช้ SNAC OLEDB |
|
|
|
SQL Management Studio (SQL2005 & 2008) ใช้ SQLclient |
|
|
|
|
|
|
|
|
|
|
osql -E -SYour_target_machine\Your_instance (Windows Auth) |
|
|
osql -Uyour_user -SYour_target_machine\Your_instance (SQL Auth) |
|
SQLCMD -Stcp:Your_target_machine, Tcp_port (for TCP) |
|
|
SQLCMD -Snp:Your_target_machine\Your_instance” (for Native Protocol) |
|
SQLCMD -Slpc:Your_target_machine\Your_instance” (for Shared Memory) |
|
|
|
|
|
|
|
|
|
net view \\sqlserver |
|
(สำหรับตรวจสอบเรื่องของ SMB protocol) |
|
net use \\sqlserver\share |
(สำหรับตรวจสอบเรื่องของ SMB protocol) |
|
|
|
|
|
|
|
|
|
ใช้ ODBC ในส่วนของ DSN แล้วสร้าง connect ขึ้นมา test ดูโดยที่ ให้ระบุ port ที่ต้องการ connect ให้ชัดเจน |
|
เรียก ODBC ได้ จาก “\windows\system32\odbcad32.exe” |
|
|
|
|
|
|
|
|
|
5 |
Application Issue |
|
|
|
|
|
|
Application ใช้ user อะไรในการ authen |
|
|
|
|
Application ใช้ SQL driver ตัวไหน |
|
|
|
|
|
Information ที่ใช้ในการ Connect เป็นอย่างไร |
|
|
|
|
|
http://www.connectionstrings.com/sql-server-2008 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
ตรวจสอบว่า เราอนุญาติให้ authen แบบไหนบ้าง (mixed / sql) |
|
|
ดูจาก เข้า SCM -> Connection properties -> security |
|
|
|
ตรวจสอบสิทธ์ของ user นั้น ๆ บน database ที่ต้องการ connect |
|
|
ตรวจสอบ event บน Windows |
|
|
|
|