Arşiv Anasayfa SQL Server
Sayfalar: 1
Veritabanının Kullandığı TCP Portunu Kullanarak Timer ile Bağlantı Kontrolü Gönderen: dynamo Tarih: 18 October 2007 14:05:25
Veritabanları ve kullandıkları TCP portu:

oracle       -> 1521
sql server       -> 1433
interbase/firebird    -> 3050
mysql        -> 3306

netstat -an  kullanılan/dinlenilen TCP ve UDP port listesi:

C:\Documents and Settings\Administrator>netstat -an

Etkin Bağlantılar

  İl.Kr. Yerel Adres            Yabancı Adres          Durum
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:3050           0.0.0.0:0              LISTENING
  TCP    127.0.0.1:1027         0.0.0.0:0              LISTENING
  TCP    127.0.0.1:1034         0.0.0.0:0              LISTENING
  TCP    192.168.1.12:139       0.0.0.0:0              LISTENING
  UDP    0.0.0.0:445            *:*
  UDP    0.0.0.0:500            *:*
  UDP    0.0.0.0:1025           *:*
  UDP    0.0.0.0:1026           *:*
  UDP    0.0.0.0:1056           *:*
  UDP    0.0.0.0:1553           *:*
  UDP    0.0.0.0:1556           *:*
  UDP    0.0.0.0:4500           *:*
  UDP    127.0.0.1:123          *:*
  UDP    127.0.0.1:1900         *:*
  UDP    127.0.0.1:1962         *:*
  UDP    192.168.1.12:123       *:*
  UDP    192.168.1.12:137       *:*
  UDP    192.168.1.12:138       *:*
  UDP    192.168.1.12:1900      *:*

netstat -ano ile kullanılan/dinlenilen TCP ve UDP port listesi:

C:\Documents and Settings\Administrator>netstat -ano

Etkin Bağlantılar

  İl.Kr. Yerel Adres            Yabancı Adres          Durum           PID
TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       1440
TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       4
TCP    0.0.0.0:3050           0.0.0.0:0              LISTENING       3636
TCP    127.0.0.1:1027         0.0.0.0:0              LISTENING       516
TCP    127.0.0.1:1034         0.0.0.0:0              LISTENING       872
TCP    192.168.1.12:139       0.0.0.0:0              LISTENING       4
UDP    0.0.0.0:445            *:*                                    4
UDP    0.0.0.0:500            *:*                                    1160
UDP    0.0.0.0:1025           *:*                                    300
UDP    0.0.0.0:1026           *:*                                    1592
UDP    0.0.0.0:1056           *:*                                    1592
UDP    0.0.0.0:1553           *:*                                    1592
UDP    0.0.0.0:1556           *:*                                    1592
UDP    0.0.0.0:4500           *:*                                    1160
UDP    127.0.0.1:123          *:*                                    1528
UDP    127.0.0.1:1900         *:*                                    1716
UDP    127.0.0.1:1962         *:*                                    972
UDP    192.168.1.12:123       *:*                                    1528
UDP    192.168.1.12:137       *:*                                    4
UDP    192.168.1.12:138       *:*                                    4
UDP    192.168.1.12:1900      *:*                                    1716



netstat -a -b -n hangi portu hangi programın kullandığına dair ayrıntılı liste:

C:\Documents and Settings\Administrator>netstat -a -b -n

Etkin Bağlantılar

  İl.Kr. Yerel Adres            Yabancı Adres          Durum           PID
TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       1440
  c:\windows\system32\WS2_32.dll
  C:\WINDOWS\system32\RPCRT4.dll
  c:\windows\system32\rpcss.dll
  C:\WINDOWS\system32\svchost.exe
  -- bilinmeyen bileşen(ler) --
  [svchost.exe]

TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       4
  [Sistem]

TCP    0.0.0.0:3050           0.0.0.0:0              LISTENING       3636
  [ibserver.exe]

TCP    127.0.0.1:1027         0.0.0.0:0              LISTENING       516
  [alg.exe]

TCP    127.0.0.1:1034         0.0.0.0:0              LISTENING       872
  [ccApp.exe]

TCP    192.168.1.12:139       0.0.0.0:0              LISTENING       4
  [Sistem]

UDP    0.0.0.0:445            *:*                                    4
  [Sistem]

UDP    0.0.0.0:500            *:*                                    1160
  [lsass.exe]

UDP    0.0.0.0:1026           *:*                                    1592
  C:\WINDOWS\system32\mswsock.dll
  c:\windows\system32\WS2_32.dll
  c:\windows\system32\DNSAPI.dll
  c:\windows\system32\dnsrslvr.dll
  C:\WINDOWS\system32\RPCRT4.dll
  -- bilinmeyen bileşen(ler) --
  [svchost.exe]

UDP    0.0.0.0:1556           *:*                                    1592
  C:\WINDOWS\system32\mswsock.dll
  c:\windows\system32\WS2_32.dll
  c:\windows\system32\DNSAPI.dll
  c:\windows\system32\dnsrslvr.dll
  C:\WINDOWS\system32\RPCRT4.dll
  [svchost.exe]

UDP    0.0.0.0:1553           *:*                                    1592
  C:\WINDOWS\system32\mswsock.dll
  c:\windows\system32\WS2_32.dll
  c:\windows\system32\DNSAPI.dll
  c:\windows\system32\dnsrslvr.dll
  C:\WINDOWS\system32\RPCRT4.dll
  [svchost.exe]

UDP    0.0.0.0:1056           *:*                                    1592
  C:\WINDOWS\system32\mswsock.dll
  c:\windows\system32\WS2_32.dll
  c:\windows\system32\DNSAPI.dll
  c:\windows\system32\dnsrslvr.dll
  C:\WINDOWS\system32\RPCRT4.dll
  [svchost.exe]

UDP    0.0.0.0:1025           *:*                                    300
  [spoolsv.exe]

UDP    0.0.0.0:4500           *:*                                    1160
  [lsass.exe]

UDP    127.0.0.1:1900         *:*                                    1716
  c:\windows\system32\WS2_32.dll
  c:\windows\system32\ssdpsrv.dll
  C:\WINDOWS\system32\ADVAPI32.dll
  C:\WINDOWS\system32\kernel32.dll
  [svchost.exe]

UDP    127.0.0.1:1962         *:*                                    972
  [iexplore.exe]

UDP    127.0.0.1:123          *:*                                    1528
  c:\windows\system32\WS2_32.dll
  c:\windows\system32\w32time.dll
  ntdll.dll
  -- bilinmeyen bileşen(ler) --
  [svchost.exe]

UDP    192.168.1.12:137       *:*                                    4
  [Sistem]

UDP    192.168.1.12:138       *:*                                    4
  [Sistem]

UDP    192.168.1.12:123       *:*                                    1528
  c:\windows\system32\WS2_32.dll
  c:\windows\system32\w32time.dll
  ntdll.dll
  -- bilinmeyen bileşen(ler) --
  [svchost.exe]

UDP    192.168.1.12:1900      *:*                                    1716
  c:\windows\system32\WS2_32.dll
  c:\windows\system32\ssdpsrv.dll
  C:\WINDOWS\system32\ADVAPI32.dll
  C:\WINDOWS\system32\kernel32.dll



netstat -an -p TCP kullanılan TCP portlarını listeleme:

C:\Documents and Settings\Administrator>netstat -an -p TCP

Etkin Bağlantılar

  İl.Kr. Yerel Adres            Yabancı Adres          Durum
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:3050           0.0.0.0:0              LISTENING
  TCP    127.0.0.1:1027         0.0.0.0:0              LISTENING
  TCP    127.0.0.1:1034         0.0.0.0:0              LISTENING
  TCP    192.168.1.12:139       0.0.0.0:0              LISTENING


 

netstat -an -p UDP kullanılan UDP portlarını listeleme:

C:\Documents and Settings\Administrator>netstat -an -p UDP

Etkin Bağlantılar

  İl.Kr. Yerel Adres            Yabancı Adres          Durum
  UDP    0.0.0.0:445            *:*
  UDP    0.0.0.0:500            *:*
  UDP    0.0.0.0:1025           *:*
  UDP    0.0.0.0:1026           *:*
  UDP    0.0.0.0:1056           *:*
  UDP    0.0.0.0:1553           *:*
  UDP    0.0.0.0:1556           *:*
  UDP    0.0.0.0:4500           *:*
  UDP    127.0.0.1:123          *:*
  UDP    127.0.0.1:1900         *:*
  UDP    127.0.0.1:1962         *:*
  UDP    192.168.1.12:123       *:*
  UDP    192.168.1.12:137       *:*
  UDP    192.168.1.12:138       *:*
  UDP    192.168.1.12:1900      *:*



bir TCP yada UDP portunun açık/kapalı olduğunu netstat ile kontrol etme:

sql server için:

:
C:\Documents and Settings\Administrator>netstat -an | find "1433"
  TCP    0.0.0.0:1433           0.0.0.0:0              LISTENING

interbase/firebird için:

:
C:\Documents and Settings\Administrator>netstat -an | find "3050"
  TCP    0.0.0.0:3050           0.0.0.0:0              LISTENING

SORU:
Bilgisayarda sql server 2000 yüklü.komut satırında netstat -an  yazıp enter tuşuna bastığımda listelenen satırlar içinde

TCP    0.0.0.0:1433           0.0.0.0:0              LISTENING

satırını göremiyorum.Ne yapmam gerekiyor?


Eğer bilgisayarınızda sql server 2000 yüklü ise, sql server 2000 sp3 üzerine yükleyin.MSDE 2000 yüklü ise
MSDE 2000 sp3 üzerine yükleyin.komut satırında netstat -an  komutunu çalıştırdığınızda gelen listede

TCP    0.0.0.0:1433           0.0.0.0:0              LISTENING

satırı görünecektir:




sql server 2000 sp3 :

http://www.microsoft.com/downloads/details.aspx?FamilyId=90DCD52C-0488-4E46-AFBF-ACACE5369FA3&displaylang=en


adresinden Sql2ksp3.exe dosyasını download et.

MSDE 2000 sp3:

aynı adresten Sql2kdesksp3.exe dosyasını download edin.


• Sql2ksp3.exe. Updates for database components.
 
• Sql2kasp3.exe. Updates for Analysis Services components.   
 
• Sql2kdesksp3.exe. Updates for Microsoft SQL Server 2000 Desktop Engine (MSDE 2000).



sql2ksp3.exe     55.1 MB

sql2kasp3.exe    43.6 MB
 
sql2kdesksp3.exe 69.2 MB


download ettiğiniz dosyayı çalıştırdığınzda sıkıştırlmış program, C:\sql2ksp3 altına dizin oluşturup setup dosyalarını atar.C:\sql2ksp3 altında setup.bat dosyasını çalıştırıp yükleme işlemini başlatın.

eğer MSDE sp3'ü kurarken password hatası veriyorsa

C:\sql2ksp3\MSDE altında bulunan setup.ini dosyasına aşağıdaki satırları yazın.

[Options]
SAPWD="123"
SECURITYMODE=SQL
DISABLENETWORKPROTOCOLS=0

satırlarını ekleyin.

MSDE' yi Mixed Mod' a çevirelim;
1-)Registry' den
HKEY_LOCAL_MACHINE/Software/Microsoft/MSSQLServer/LoginMode adresindeki, LoginMode' un değerini 2 yapın.

2-)MSDE2'yi restart yapın  yani servisi kapatıp açın.



Örnek Uygulama:




:
procedure TForm1.Button1Click(Sender: TObject);
begin
   ClientSocket1.Active:=false;
   ClientSocket1.Address:=Edit1.Text;
   ClientSocket1.Port:=strtoint(Edit2.Text);
   ClientSocket1.Active:=true;
   timer1.Enabled:=true;
   timer2.Enabled:=true;
   Label1.Caption:='Bağlantı Kontrol Ediliyor....';
   Shape1.Brush.Color:=clAqua;
end;

edit1'e bilgisayarın ip adresi local yada ağ üzerindeki bilgisayar ip'si,edit2'ye port değeri sql server için 1433,firebird için 3050 değeri girilerek bağlantı testi yapılır.timer1 interval değeri 5000 olduğundan her 5 sn de bir bağlantının olup olmadığını kontrol eder.


örnek uygulama ekte.