6

I am looking for a way to install Oracle client on Windows but running from command line. In order to run it automatically there shall be no user-interaction.

The Oracle documentation is quite sparse for command line options of Oracle Universal Installer. Even when running the setup as setup.exe -silent -responseFile filename.rsp the user has to press ENTER at certain point.

Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110
  • Why don't you use the instant client? The "installation" is as simple as extracting a zip archive. –  Jun 28 '19 at 07:41
  • @a_horse_with_no_name, if you need tools like SQLplus or ODBC driver or ODP.NET provider or tnsping, etc. then the instant client is not sufficient. – Wernfried Domscheit Jun 28 '19 at 07:45
  • There are additional packages for SQLPlus and ODBC, but you are right, it does not work for .Net –  Jun 28 '19 at 07:58
  • Yes, SQLPlus and ODBC might be poor examples but there are many components you may need which are not provided by additional packages. – Wernfried Domscheit Jun 28 '19 at 08:05
  • Does this answer your question? [Install Oracle Client via Ansible on Windows Machine - exit code 259, 1](https://stackoverflow.com/questions/53431566/install-oracle-client-via-ansible-on-windows-machine-exit-code-259-1) – 030 Oct 29 '21 at 06:04
  • @030 No it does not. Question is not about how to call `setup.exe`, its about the parameters. Apart from that, here is an accepted answer for 2 years now. And when you have a look at the number of upvotes, then it seems to be the much better answer anyway. – Wernfried Domscheit Oct 29 '21 at 09:19

2 Answers2

10

After some investigations I found out how to get the full command line options:

setup.exe -help

This works for version 11.2, 12.1 and 12.2. In version 18c and 19c this does work not anymore, instead you have to execute:

setup.exe -help -silent

Here the example output of an 18c setup:

Usage:  setup.exe [<flag>] [<option>]
Following are the possible flags:
    -help - display help.
    -silent - run in silent mode. The inputs can be a response file or a list of command line variable value pairs.
            [-ignorePrereqFailure - ignore all prerequisite checks failures.]
            [-lenientInstallMode - perform the best effort installation by automatically ignoring invalid data in input parameters.]
            [-showProgress - show the installation progress on the console. This option is supported for silent mode installation only.]
    -responseFile - specify the complete path of the response file to use.
    -invPtrLoc - point to a different inventory location. The orainst.loc file contains the location of the central inventory (inventory_loc) and the inventory group (inst_group).
    -jreLoc - specify the location for the jre used in the installation.
    -logLevel - enable the log of messages up to the priority level provided in this argument. Valid options are: severe, warning, info, config, fine, finer, finest.
    -paramFile - specify the location of the oraparam.ini file to be used in the installation.
    -executePrereqs | -executeConfigTools | -deinstall
    -executePrereqs - execute the prerequisite checks only.
    -executeConfigTools - execute the config tools for an installed home.
            [-all - execute all the config tools for an installed home, including the config tools that have already succeeded.]
    -deinstall - uninstall the specified home.
    -debug - run in debug mode.
    -executeSysPrereqs - execute the system prerequisite checks and exit.
    -ignoreSysPrereqs - ignore the results of the system prerequisite checks.
    -printdiskusage - log the debug information for the disk usage.
    -printmemory - log the debug information for the memory usage.
    -printtime - log the debug information for the time usage.
    -waitForCompletion - wait for the completion of the installation, instead of spawning the installer and returning the console prompt.
    -suppressPreCopyScript - suppress the execution of the precopy script.
    -acceptUntrustedCertificates - accept untrusted certificates from a secure site.
    -suppressPostCopyScript - suppress the execution of the postcopy script.
    -noconfig - do not execute the config tools.
    -noconsole - suppress the display of messages in the console. The console is not allocated.
    -ignoreInternalDriverError - ignore any internal driver errors.
    -promptForPassword - provide the passwords on the console during a silent installation of an Oracle database.
    -remotecp - specify the path to the remote copy program on the local cluster node. Used only for cluster installs.
    -remoteshell - specify the path to the remote shell program on the local cluster node. Used only for cluster installs.

Finally I managed to run full setup with single command even without a Response file which can be executed by a software deployment system. Here are some examples (needs to be in a single line):

setup.exe -silent -nowait -ignoreSysPrereqs -ignorePrereq -waitforcompletion -force \
   "INVENTORY_LOCATION=C:\Program Files\Oracle\Inventory" \
   "ORACLE_BASE=c:\oracle\product" \
   "ORACLE_HOME=c:\oracle\product\12.1\Client_x64" \
   "SELECTED_LANGUAGES=de,en,fr,it" \
   "oracle.install.IsBuiltInAccount=true" \
   "oracle.install.client.installType=Custom" \
   "oracle.install.client.customComponents=oracle.rdbms.util:12.1.0.2.0,oracle.sqlplus:12.1.0.2.0,oracle.odbc:12.1.0.2.0"


setup.exe -silent -nowait -ignoreSysPrereqs -ignorePrereqFailure -skipPrereqs -waitForCompletion -force \
   "INVENTORY_LOCATION=C:\Program Files\Oracle\Inventory" \
   "ORACLE_BASE=c:\oracle\product" \
   "ORACLE_HOME=c:\oracle\product\12.2\Client_x64" \
   "oracle.install.IsBuiltInAccount=true" \
   "oracle.install.client.installType=Custom" \
   "oracle.install.client.customComponents=oracle.rdbms.util:12.2.0.1.0,oracle.sqlplus:12.2.0.1.0,oracle.odbc:12.2.0.1.0"


setup.exe -silent -nowait -ignoreSysPrereqs -ignorePrereqFailure -waitForCompletion -force \
   "ORACLE_BASE=c:\oracle\product" \
   "ORACLE_HOME=c:\oracle\product\18c\Client_x86" \
   "oracle.install.IsBuiltInAccount=true" \
   "oracle.install.client.installType=Custom" \
   "oracle.install.client.customComponents=oracle.rdbms.util:18.0.0.0.0,oracle.sqlplus:18.0.0.0.0,oracle.odbc:18.0.0.0.0"

Note, option -nowait is not mentioned in help but required to suppress prompt "Press ENTER to close the program".

Option -force is not mentioned in help of version 12.2 and newer but seems to be still valid to force installation in non-empty directory

Apparently 18c 32-bit installer does not like option "INVENTORY_LOCATION=C:\Program Files (x86)\Oracle\Inventory", skip this entry. Using "INVENTORY_LOCATION=C:\PROGRA~2\Oracle\Inventory" causes an exception for lock files in c:\Program Files (x86)\Oracle\Inventory\locks\

Update

I am working on an update of our clients. Even with old installer I did not manage it to run the setup properly. I always have to use the response file, e.g.

setup.exe -silent -nowait -ignoreSysPrereqs -ignorePrereqFailure -waitForCompletion -force -responseFile ../client_x86_21c.rsp

Specifying the components in the command line does not work (anymore).

I was not able to run the 32-bit Oracle Universal Installer 18c - seems to be a bug. Since this version is EOL meanwhile, I did not further investigate it.

Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110
0
setup.exe -silent -nowait -ignoreSysPrereqs -ignorePrereq -waitForCompletion \
-force "INVENTORY_LOCATION=C:\Program Files\Oracle\Inventory" \
"ORACLE_BASE=c:\oracle\product" "ORACLE_HOME=c:\oracle\product\12.2\Client_x64" \
"oracle.install.IsBuiltInAccount=true" \
"oracle.install.client.installType=Administrator" \
"oracle.install.client.customComponents=oracle.rdbms.util:12.2.0.1.0,oracle.sqlplus:12.2.0.1.0,oracle.odbc:12.2.0.1.0"

This works for me. This will install Oracle Client Admin version from Command Prompt in Windows 10 {as i have used}. Thanks to the earlier posts.

Lalit Kumar B
  • 47,486
  • 13
  • 97
  • 124
Suresh
  • 1
  • 2
    I am not sure, but I think when you install "Administrator" version, then you cannot specify any custom components (they might be ignored) – Wernfried Domscheit May 02 '20 at 19:25
  • how can i keep cursor in same line till the installation completes. In my case, after given the statement in Command Prompt, I need to press enter. Then it starts to install and cursor moves to next line. Offcourse Setup is running. But how to control the cursor rather moving to next line? – Suresh May 03 '20 at 21:24
  • Do you really care about the cursor position? I don't think you can control that. – Wernfried Domscheit May 04 '20 at 06:27
  • I am trying to "Installing Oracle Client in Windows Container" which is not happening. I thought the issue with Command Position. As soon as the cursor coming to new position, Setup.exe running for a minute and stoping. – Suresh May 04 '20 at 09:57
  • Maybe try option `-force` – Wernfried Domscheit May 04 '20 at 11:31
  • Tried below: still no luck. setup.exe -silent -nowait -ignoreSysPrereqs -ignorePrereq -waitForCompletion \ -force "INVENTORY_LOCATION=C:\Program Files\Oracle\Inventory" \ "ORACLE_BASE=c:\oracle\product" "ORACLE_HOME=c:\oracle\product\12.2\Client_x64" \ "oracle.install.IsBuiltInAccount=true" \ "oracle.install.client.installType=Administrator" \ "oracle.install.client.customComponents=oracle.rdbms.util:12.2.0.1.0,oracle.sqlplus:12.2.0.1.0,oracle.odbc:12.2.0.1.0" – Suresh May 04 '20 at 17:22