从命令行安装Oracle Client,无需用户交互 [英] Install Oracle Client from command line without user-interaction
问题描述
我正在寻找一种在Windows上安装Oracle客户端但可以从命令行运行的方法.为了自动运行它,必须没有用户交互.
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.
Oracle文档对于Oracle Universal Installer的命令行选项非常少.即使以setup.exe -silent -responseFile filename.rsp
运行设置,用户也必须在特定点按ENTER.
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.
推荐答案
经过一些调查,我发现了如何获取完整的命令行选项:
After some investigations I found out how to get the full command line options:
setup.exe -help
这适用于版本11.2、12.1和12.2.在版本18c和19c中,此功能不再起作用,而是必须执行:
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
以下是18c设置的示例输出:
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.
最后,即使没有可以由软件部署系统执行的Response文件,我也设法用单个命令运行了完整的安装程序.以下是一些示例(需要放在一行中):
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"
请注意,选项-nowait
在帮助中未提及,但需要禁止显示提示按ENTER关闭程序".
Note, option -nowait
is not mentioned in help but required to suppress prompt "Press ENTER to close the program".
在版本12.2和更高版本的帮助中未提及选项-force
,但似乎仍然有效,可以强制将其安装在非空目录中
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
显然18c 32位安装程序不喜欢选项"INVENTORY_LOCATION=C:\Program Files (x86)\Oracle\Inventory"
,请跳过此条目.使用"INVENTORY_LOCATION=C:\PROGRA~2\Oracle\Inventory"
会导致c:\Program Files (x86)\Oracle\Inventory\locks\
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\
这篇关于从命令行安装Oracle Client,无需用户交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!