[Windows] 安裝 SQL Server 2008 R2 @ Windows 2008 R2

[Windows] 安裝 SQL Server 2008 R2 @ Windows 2008 R2

安裝前要先想一下網路架構,想想SQL SERVER是否要加入網域管理??若要的話要先加入Domain,然後登入網域;反之,就不需要加入網域

1.安裝SQL Server

2.確認組態管理

3.設定防火牆(也可以先設定再安裝SQL SERVER)


1.安裝SQL Server

image

image

輸入序號

image

image

image

先安裝等一下再來設定防火牆

image

image

先安裝以下基本功能,若還有其他需求可以再安裝

Database Engine Services

全文檢索搜尋

Analysis Service

Reporting Service

用戶端工具連接性

管理工具-基本

管理工具-完整

image

建議輸入具名執行個體

image

image

選擇啟用服務的帳號

image

啟動類型都調成自動

image

image

image

image

image

image

image

安裝中…

image


2.確認組態管理

image

確認服務都是在"自動"

image

確認TCP/IP有啟用

image


3.設定防火牆

基本要設定的內容如下:

1433 TCP SQL Database Engine
1434 UDP SQL Browser Service
2382 TCP SQL Analysis Service Redirector
2383 TCP SQL Analysis Service
80 TCP SQLReporting Service

每次都要設這些防火牆太累了,我們可以用批次指令來完成,參考:http://support.microsoft.com/kb/968872/zh-tw

將以下內容存成*.bat檔並且執行

@echo =========  SQL Server Ports  ===================
@echo Enabling SQLServer default instance port 1433
netsh firewall set portopening TCP 1433 "SQLServer" 
@echo Enabling Dedicated Admin Connection port 1434
netsh firewall set portopening TCP 1434 "SQL Admin Connection" 
@echo Enabling conventional SQL Server Service Broker port 4022  
netsh firewall set portopening TCP 4022 "SQL Service Broker" 
@echo Enabling Transact-SQL Debugger/RPC port 135 
netsh firewall set portopening TCP 135 "SQL Debugger/RPC" 
@echo =========  Analysis Services Ports  ==============
@echo Enabling SSAS Default Instance port 2383
netsh firewall set portopening TCP 2383 "Analysis Services" 
@echo Enabling SQL Server Browser Service port 2382
netsh firewall set portopening TCP 2382 "SQL Browser" 
@echo =========  Misc Applications  ==============
@echo Enabling HTTP port 80 
netsh firewall set portopening TCP 80 "HTTP" 
@echo Enabling SSL port 443
netsh firewall set portopening TCP 443 "SSL" 
@echo Enabling port for SQL Server Browser Service's 'Browse' Button
netsh firewall set portopening UDP 1434 "SQL Browser" 
@echo Allowing multicast broadcast response on UDP (Browser Service Enumerations OK)
netsh firewall set multicastbroadcastresponse ENABLE 
 
使用批次檔設定完成的畫面如下

image

KB 已經更新使用方法 netsh advfirewall firewall

netsh advfirewall firewall add rule name="Open Port 80" dir=in action=allow protocol=TCP localport=80

@echo =========  SQL Server Ports  ===================
@echo Enabling SQLServer default instance port 1433
netsh advfirewall firewall add rule name="SQL Server" dir=in action=allow protocol=TCP localport=1433
@echo Enabling Dedicated Admin Connection port 1434
netsh advfirewall firewall add rule name="SQL Admin Connection" dir=in action=allow protocol=TCP localport=1434
@echo Enabling Conventional SQL Server Service Broker port 4022
netsh advfirewall firewall add rule name="SQL Service Broker" dir=in action=allow protocol=TCP localport=4022
@echo Enabling Transact SQL/RPC port 135
netsh advfirewall firewall add rule name="SQL Debugger/RPC" dir=in action=allow protocol=TCP localport=135
@echo =========  Analysis Services Ports  ==============
@echo Enabling SSAS Default Instance port 2383
netsh advfirewall firewall add rule name="Analysis Services" dir=in action=allow protocol=TCP localport=2383
@echo Enabling SQL Server Browser Service port 2382
netsh advfirewall firewall add rule name="SQL Browser" dir=in action=allow protocol=TCP localport=2382

@echo =========  Misc Applications  ==============
@echo Enabling HTTP port 80
netsh advfirewall firewall add rule name="HTTP" dir=in action=allow protocol=TCP localport=80
@echo Enabling SSL port 443
netsh advfirewall firewall add rule name="SSL" dir=in action=allow protocol=TCP localport=443
@echo Enabling port for SQL Server Browser Service's 'Browse' Button
netsh advfirewall firewall add rule name="SQL Browser" dir=in action=allow protocol=UDP localport=1434
@echo Allowing multicast broadcast response on UDP (Browser Service Enumerations OK)
netsh firewall set multicastbroadcastresponse ENABLE

若有謬誤,煩請告知,新手發帖請多包涵

2010~2015 C# 第四季