What is the minimal setup required to deploy a .NET application with Oracle client 11?

前端 未结 4 1331
小蘑菇
小蘑菇 2020-11-28 02:53

What is the minimal setup required to be able to deploy a .NET application that talks to an Oracle database?

4条回答
  •  被撕碎了的回忆
    2020-11-28 03:12

    1. Download the ODAC 11 XCopy deployment.
    2. Extract the zip file and run the following:

      install.bat odp.net20 c:\oracle\11.1\odac myoraclehome true

    3. Copy the files from the 11.1 directory and place them in a subdirectory of your application's executable (e.g. debug\bin\oracle)

    4. Add the following statements to your Main() method. They will change the path such that your application executable will use the oracle client exclusive of any other oracle home's. The environment change is exclusive to your process and has no lasting effects when the application terminates:

      Environment.SetEnvironmentVariable("PATH", Environment.CurrentDirectory + "\\oracle\\11.1\\odac;" + Environment.CurrentDirectory + "\\oracle\\11.1\\odac\\bin;", EnvironmentVariableTarget.Process);

      Environment.SetEnvironmentVariable("ORACLE_HOME", Environment.CurrentDirectory + "\\oracle\\11.1\\odac", EnvironmentVariableTarget.Process);

提交回复
热议问题