Skip to content

Commit

Permalink
Merge pull request #666 from nick-ms-ts/main
Browse files Browse the repository at this point in the history
add ssis docs
  • Loading branch information
fhljys authored May 20, 2024
2 parents 8f2f950 + e812f9a commit 18e1925
Show file tree
Hide file tree
Showing 33 changed files with 1,718 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version ="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<requiredRuntime safemode="true" imageVersion="v4.0.30319" version="v4.0.30319"/>
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@echo off

xcopy /F /Y SleepTask.dll "%ProgramFiles%\Microsoft SQL Server\140\DTS\Tasks"
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo "Complete copied to x64 folder"

xcopy /F /Y SleepTask.dll "%ProgramFiles(x86)%\Microsoft SQL Server\140\DTS\Tasks"
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo "Complete copied to x86 folder"

gacutil\gacutil /i SleepTask.dll /f
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully installed Sleep Task.

REM If you want to persist access credentials for file shares or Azure Files, use the commands below:
REM cmdkey /add:YourFileShareServerName /user:YourDomainName\YourUsername /pass:YourPassword
REM cmdkey /add:YourAzureStorageAccountName.file.core.windows.net /user:azure\YourAzureStorageAccountName /pass:YourAccessKey
REM You can then access \\YourFileShareServerName\YourFolderName or \\YourAzureStorageAccountName.file.core.windows.net\YourFolderName directly in your SSIS packages.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Try {
if ((Get-WindowsFeature -Name Net-Framework-Core).Installed)
{
Write-Output ".NET framework 3.5 has already been installed."
}
else
{
if ((Install-WindowsFeature -Name Net-Framework-Core -Source (Get-Location).Path -LogPath %CUSTOM_SETUP_SCRIPT_LOG_DIR%\install.log).Success)
{
Write-Output ".NET framework 3.5 has been installed successfully"
}
else
{
throw "Failed to install .NET framework 3.5"
}
}
}
Catch {
Exit 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@echo off

powershell.exe -ExecutionPolicy RemoteSigned -File %~dp0\InstallNetFx35.ps1

REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully installation of .net framwork 3.5
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@echo off

echo Start to install MsSqlCmdLnUtils.msi
msiexec /i MsSqlCmdLnUtils.msi /quiet /lv %CUSTOM_SETUP_SCRIPT_LOG_DIR%\MsSqlCmdLnUtils.log IACCEPTMSSQLCMDLNUTILSLICENSETERMS=YES

REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully installation of MsSqlCmdLnUtils.msi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REG ADD HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /v SearchList /t REG_SZ /d test.com /f
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

powershell.exe -ExecutionPolicy RemoteSigned -File %~dp0\GacInstall.ps1 -AssemblyPath %1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
param(
[string]$AssemblyPath
)

$AssemblyPath = [System.IO.Path]::GetFullPath($AssemblyPath)
Write-Output "Start to Gac assembly '$AssemblyPath'"

$assembly = [System.Reflection.Assembly]::LoadFile($AssemblyPath)
if ($assembly.GetName().GetPublicKey().Length -eq 0)
{
throw "The assembly '$assembly' is not strong name signed!"
}
elseif ($assembly.GlobalAssemblyCache)
{
Write-Output "The assembly '$assembly' has already been GACed."
exit 0
}

[System.Reflection.Assembly]::LoadWithPartialName("System.EnterpriseServices") | Out-Null
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacInstall($AssemblyPath)

$assembly = [System.Reflection.Assembly]::LoadFile($AssemblyPath)
if ($assembly.GlobalAssemblyCache)
{
Write-Output "Successfully GACed assembly '$assembly'."
}
else
{
throw "Failed to Gac assembly '$assembly'."
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@echo off

call GacInstall.cmd ExcelDataReader.dll
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully installation of ExcelDataReader.dll

call GacInstall.cmd DocumentFormat.OpenXml.dll
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully installation of DocumentFormat.OpenXml.dll
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
@echo off

echo "start main.cmd"
time /T

"%SystemRoot%\System32\msiexec.exe" /i AttunitySSISOraAdaptersSetup.msi /qn /norestart /log oracle32bit.log EulaForm_Property=Yes RestartSqlServerSilent=true
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully installation of AttunitySSISOraAdaptersSetup.msi

"%SystemRoot%\System32\msiexec.exe" /i AttunitySSISOraAdaptersSetupX64.msi /qn /norestart /log oracle64bit.log EulaForm_Property=Yes RestartSqlServerSilent=true
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully installation of AttunitySSISOraAdaptersSetupX64.msi

start /wait xcopy /R /F /Y ".\*.log" "%CUSTOM_SETUP_SCRIPT_LOG_DIR%\"

PowerShell Expand-Archive -Path "instantclient-basic-windows.x64-19.13.0.0.0dbru.zip" -DestinationPath "%SystemDrive%\OracleInstantClient"
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully Expand-Archive instantclient-basic-windows.x64-19.13.0.0.0dbru.zip

setx /M PATH "%SystemDrive%\OracleInstantClient\instantclient_19_13\;%PATH%"
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully set environment path for Oracle instant client

reg add HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ORACLE_19_13
reg add HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ORACLE_19_13 /v ORACLE_HOME /t REG_SZ /d %SystemDrive%\OracleInstantClient\instantclient_19_13\
echo Successfully add registry for ORACLE_HOME

REM Set TNS_ADMIN variable for SSIS to read tbsnames.ora file
setx TNS_ADMIN "%SystemDrive%\OracleInstantClient\instantclient_19_13\network\admin" /M
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully set TNS_ADMIN

REM Copy tnsnames.ora which contains the connection information to be used by SSIS package Oracle Connector
REM TNS Service name can also in format of host:port/service_name, which does not use tnsnames.ora
start /wait xcopy /R /F /Y %cd%\tnsnames.ora %SystemDrive%\OracleInstantClient\instantclient_19_13\network\admin\
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully copied tnsnames.ora

echo "Target Log dir is %CUSTOM_SETUP_SCRIPT_LOG_DIR%"
dir "%CUSTOM_SETUP_SCRIPT_LOG_DIR%"

time /T
echo "Complete main.cmd"
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# tnsnames.ora Network Configuration File

ReplaceSampleTNSName =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = replace_hostname)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = replace_servicename)
)
)

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@echo off

PowerShell Expand-Archive -Path ".\ODP.NET_Managed_ODAC122cR1.zip" -DestinationPath ".\ODP.NET"
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully Expand-Archive ODP.NET_Managed_ODAC122cR1.zip

start /D .\ODP.NET /wait cmd /c "call install_odpm.bat %SystemDrive%\ODP.NET both true > %CUSTOM_SETUP_SCRIPT_LOG_DIR%\install2.log"
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully Execute install_odpm.bat

REM install_odpm.bat will redirect some of the standard output to %SystemDrive%\ODP.NET\install.log,
REM we need to copy it to %CUSTOM_SETUP_SCRIPT_LOG_DIR% so that it can be uploaded to your blob container

start /wait xcopy /R /F /Y %SystemDrive%\ODP.NET\install.log %CUSTOM_SETUP_SCRIPT_LOG_DIR%
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully Copied %SystemDrive%\ODP.NET\install.log to %CUSTOM_SETUP_SCRIPT_LOG_DIR%

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@echo off

set DriverFolderName=instantclient_18_3
set DriverName=Oracle in instantclient_18_3

REM Please overwrite the value of following three variables
set DSN=<DSN Name>
set ServerName=<Oracle Server Name>
set UserID=<User ID>

echo Install Oracle ODBC Driver ...
powershell.exe Expand-Archive -Path ".\instantclient-basiclite-windows.x64-18.3.0.0.0dbru.zip" -DestinationPath "%SystemDrive%\oracle"
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully Expand-Archive instantclient-basiclite-windows.x64

powershell.exe Expand-Archive -Path ".\instantclient-odbc-windows.x64-18.3.0.0.0dbru.zip" -DestinationPath "%SystemDrive%\oracle"
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully Expand-Archive instantclient-odbc-windows.x64

start /D %SystemDrive%\oracle\%DriverFolderName% .\odbc_install.exe
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully installed Oracle ODBC Driver!

setx /M PATH "%SystemDrive%\oracle\%DriverFolderName%;%PATH%"
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully set environment path

echo Add DSN %DSN%
odbcconf CONFIGSYSDSN "%DriverName%" "DSN=%DSN%|SERVER=%ServerName%|UID=%UserID%" /S /Lv %CUSTOM_SETUP_SCRIPT_LOG_DIR%\odbcconf.txt

REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully added DSN %DSN%!
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@echo off

PowerShell Expand-Archive -Path ".\ODAC122010Xcopy_x64.zip" -DestinationPath ".\ODAC122010Xcopy_x64"
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully Expand-Archive ODAC122010Xcopy_x64.zip completed

start /D .\ODAC122010Xcopy_x64 /wait cmd /c "call install.bat oledb %SystemDrive%\ODAC odbc > %CUSTOM_SETUP_SCRIPT_LOG_DIR%\install2.log"
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully Execute install.bat completed

REM need to set install path to environment variable
setx /M PATH "%SystemDrive%\ODAC;%SystemDrive%\ODAC\bin;%PATH%"

REM install.bat will redirect some of the standard output to %SystemDrive%\ODAC\install.log,
REM we need to copy it to %CUSTOM_SETUP_SCRIPT_LOG_DIR% so that it can be uploaded to your blob container
start /wait xcopy /R /F /Y %SystemDrive%\ODAC\install.log %CUSTOM_SETUP_SCRIPT_LOG_DIR%
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully Copied %SystemDrive%\ODAC\install.log to %CUSTOM_SETUP_SCRIPT_LOG_DIR%
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@echo off

echo Installing PostgreSQL ODBC drivers...

msiexec /i psqlodbc_x64.msi /qn /lv %CUSTOM_SETUP_SCRIPT_LOG_DIR%\psqx64l.LOG

msiexec /i psqlodbc_x86.msi /qn /lv %CUSTOM_SETUP_SCRIPT_LOG_DIR%\psqlx86.LOG

echo Installation completed
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@echo off

REM Copy for SAP connector depended file
start /wait xcopy /R /F /Y librfc32.dll %windir%\System32\
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
start /wait xcopy /R /F /Y librfc32.dll %windir%\SysWow64\
REM error handling
if %ERRORLEVEL% neq 0 (
echo Failed with ExitCode %ERRORLEVEL%
exit /b %ERRORLEVEL%)
echo Successfully copied for SAP connector depended file
Binary file not shown.
Loading

0 comments on commit 18e1925

Please sign in to comment.