All,
Your help is greatly appreciated in advance. I am having trouble packaging Oracle 10G for a batch file deployment. Everything is done except for getting the DSN created which is causing me major problems. We am working with the Oracle 10G R2 10.2.0.1.0 Client on Windows XP Professional SP2. The Oracle database resides on a Windows 2000 Professional Server SP4 running Oracle 9i.

Our Environment: I am creating two packages of the Oracle 10G client. The first is for a batch file distribution via LANDesk and the other package is for normal batch file install if someone from IT is installing this from a user's desk. Both scripts are really identical the only differences are how they are laid out. I only need help with the DSN creation as everything else is ready to go. I am going to focus on the Non-LANDesk batch file as once I fix this in one script the other one should also be fixed.

The Problem: The batch script copies the neccesary files to the temporary directory. I then extract the setup files to the temp folder. I run a custom Oracle install using the RSP file from a recorded install. After the install is complete I copy the TNS Names file to the proper location. I then try to call a CMD file with the ODBC command seen below the main script.

Script (May be easier to read if you download using link below):

-------------------------------------------
@ECHO ON
::This batch files installs Oracle 10G Release 2 Version 10.2.0.1.0 with a Custom Response File
::Installation is Interactive
::All files are extracted from the ZIP file via the 7-Zip command line tool
::The Net Configuration Assistant TNS Names File is copied to its proper location
::The CCR ODBC connection is created once the install is complete
::All folders used for installation are cleaned up-deleted

@ECHO Setting Variables
set NetworkPath=\\dc-landesk\SoftwareForLDAgent\Oracle10G-R2-10.2.0.1.0\Non-LD
set DefaultPackagePath=C:\Program Files\LANDesk\LDClient\sdmcache\SoftwareForLDAgent\Oracle10G-R2-10.2.0.1.0\Non-LD
set ExtractionPath=C:\Temp_Oracle10G
set TempInstallFromPath=C:\Temp_Oracle10G\SetupFiles
set FileFolderCleanupPath=C:\Program Files\LANDesk\LDClient\sdmcache\SoftwareForLDAgent

@ECHO Creating Directories
mkdir "C:\Program Files\LANDesk\LDClient\sdmcache\SoftwareForLDAgent\Oracle10G-R2-10.2.0.1.0\Non-LD"

@ECHO Copying Files to DefaultPackagePath
copy /Y "%NetworkPath%\7za.exe" "%DefaultPackagePath%"
copy /Y "%NetworkPath%\CCR-ODBC.cmd" "%DefaultPackagePath%"
copy /Y "%NetworkPath%\Oracle10GCustom.rsp" "%DefaultPackagePath%"
copy /Y "%NetworkPath%\SetupFiles.zip" "%DefaultPackagePath%"
copy /Y "%NetworkPath%\tnsnames.ora" "%DefaultPackagePath%"

@ECHO Changing to Extraction Directory
cd "%DefaultPackagePath%"

@ECHO Extracting Files to path with no spaces
"%DefaultPackagePath%\7za.exe" x SetupFiles.zip -o%ExtractionPath% -aoa

@ECHO Please Open the "Task Manager" manager, Sort by "CPU" Descending
@ECHO Watch Task Manager For Javaw.exe, press any key when the process Disappears

@ECHO Install using Custom Response File
"%TempInstallFromPath%\setup.exe" -responseFile "%DefaultPackagePath%\Oracle10GCustom.rsp" -force -silent -noconsole

pause

@ECHO Copying NETCA (Net Configuration Assistant) TNS Names File to proper Location in Oracle Product Directory
copy /Y "%DefaultPackagePath%\tnsnames.ora" "C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\tnsnames.ora"

@ECHO Creating ODBC Connections Using Oracle Driver installed by this Batch File
call "%DefaultPackagePath%\CCR-ODBC.cmd"

@ECHO Waiting 20 seconds before proceeding
ping -n 21 127.0.0.1 >NUL

@ECHO Remove Temp Files and Folders created during Install
rmdir /S /Q %ExtractionPath%
del /Q "%DefaultPackagePath%\*.exe"
del /Q "%DefaultPackagePath%\*.ora"
del /Q "%DefaultPackagePath%\*.rsp"
del /Q "%DefaultPackagePath%\*.reg"
del /Q "%DefaultPackagePath%\*.zip"
rmdir /S /Q %FileFolderCleanupPath%

@ECHO The Oracle 10G installation has been Completed
pause

-------------------------

ODBC Script

----------------------

odbcconf.exe /a {CONFIGSYSDSN "Oracle in OraClient10g_home1" "DSN=CCR|Description=CCR_data|SERVER=BWB|Database=CCR"}

----------------------

As soon as the command is called I see the following error message appear.

"CONFIGSYSDSN: Unable to create a data source for the 'Oracle in OraClient10g_home1' driver: Could not load the setup or translator library with error code -2147467259"

The really strange thing though is that if I let the main part of the script run (Not the ODBC call) and then immediately manually start the ODBC call script it works just fine. So, I don't really understand why the script can't add it itself. Or, I can go the Administrator Tools>Data Sources (ODBC)>and then add it manually which also works. I have tried just pasting the command directly in the main script, therefore, bypassing the call feature but it doesn't make a difference.

Link (Zip with all scripts mentioned above): http://www.cbridegum.com/Fourms/Oracle/Files.zip

Has anyone ever seen this kind of issue before? Does anyone have any idea on how to fix this? Any thoughts or suggestions would be great.

I thought it may be related to spaces in the path in which the script was called from. I tried having the ODBC command script in another directory but the same thing happens. It will give me the "CONFIGSYSDSN: Unable to create a data source for the 'Oracle in OraClient10g_home1' driver: Could not load the setup or translator library with error code -2147467259". As soon as the script is done running I can manually double click the script and it adds the DSN fine.

Thanks so much for your help in advance,
Clif

Hello,

Is it possible that permissions vary when running the script versus running the command from the commandline?

It could be that you're logged in as Administrator and can execute commands that alter the registry. However, your script runs under some other, non-privileged O/S uid.

Hello,

Is it possible that permissions vary when running the script versus running the command from the commandline?

It could be that you're logged in as Administrator and can execute commands that alter the registry. However, your script runs under some other, non-privileged O/S uid.

Do you have any idea on how to confirm what permissions are being used? When I sit down at a machine to run this script I am physically logged in as the local administrator on the PC.

Thanks:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.