2010年7月7日 星期三

如何散佈DTS元件(DTSRUN)

剛好同事需要在沒有安裝SQL Server上的伺服器上執行遠端DTS,要用DTSRUN,我把DTSRUN拷貝過去後發現無法使用,看來缺少一些檔案,上網查了一下,參考到Redistributing DTS with your program這篇,發覺檔案還不少,還得註冊dll,挺麻煩的,於是寫了簡單的SCRIPT與說明,有需要者自行更改部份內容,基本上如果用預設安裝SQL Server的,相關路徑應該就不用改

Step 1 將以下script存成batch檔後,在安裝有SQL 2000的來源端執行會產生C:\DTSuti\目錄



set InstallDestination="C:\DTSuti\"



xcopy /I "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\sqlresld.dll" %InstallDestination%


xcopy /I "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\dtsffile.dll" %InstallDestination%


xcopy /I "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\Resources\1033\dtsffile.rll" %InstallDestination%Resources\1033\


xcopy /I "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\dtspkg.dll" %InstallDestination%


xcopy /I "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\Resources\1033\dtspkg.rll" %InstallDestination%Resources\1033\


xcopy /I "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\dtspump.dll" %InstallDestination%


xcopy /I "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\Resources\1033\dtspump.rll" %InstallDestination%Resources\1033\


xcopy /I "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\axscphst.dll" %InstallDestination%


xcopy /I "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\Resources\1033\axscphst.rll" %InstallDestination%Resources\1033\


xcopy /I "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\dtsrun.exe" %InstallDestination%


xcopy /I "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\Resources\1033\dtsrun.rll" %InstallDestination%Resources\1033\


xcopy /I "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\custtask.dll" %InstallDestination%


xcopy /I "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\Resources\1033\custtask.rll" %InstallDestination%Resources\1033\


xcopy /I "%SystemRoot%\system32\sqlunirl.dll" %InstallDestination%\System32\
 
Step 2 將來源端DTSuti目錄複製一份到目的端Server的C槽
 
Step 3 將目的端DTSuti目錄system32下的檔案複製一份到目的端系統槽system32底下
 
Step 4 將以下script一樣存成batch檔後,在目的端執行以註冊相關dll

 set InstallDestination=C:\DTSuti\



Regsvr32.exe "%InstallDestination%dtsffile.dll"


Regsvr32.exe "%InstallDestination%dtspkg.dll"


Regsvr32.exe "%InstallDestination%dtspump.dll"


Regsvr32.exe "%InstallDestination%axscphst.dll"


Regsvr32.exe "%InstallDestination%custtask.dll"

Step 5 記得把C:\DTSuti\路徑加到環境變數的PATH裡,然後就可以用啦,不加也行,加不加看個人囉,加的好處是直接在C:\下就可打DTSRUN,不加就自行加上路徑就好

0 意見:

張貼留言