从命令行安装Oracle客户端,无需用户交互

bnl4lu3b  于 2023-08-04  发布在  Oracle
关注(0)|答案(2)|浏览(132)

我正在寻找一种方法来安装Oracle客户端在Windows上,但从命令行运行。为了自动运行,应无用户交互
Oracle文档中有关Oracle Universal Installer的命令行选项的内容非常少。即使在运行setup.exe -silent -responseFile filename.rsp设置时,用户也必须在某个点按ENTER键。

tyg4sfes

tyg4sfes1#

经过一些调查,我发现了如何获得完整的命令行选项:

setup.exe -help

字符串
这适用于版本11.2、12.1和12.2。在版本18 c和19 c中,这不再起作用,而是必须执行:

setup.exe -help -silent


这里是18 c设置的示例输出:

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.


最后,我设法运行完整的安装与单一的命令,即使没有一个响应文件,可以执行的软件部署系统。以下是一些示例(需要在一行中):

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关闭程序”。
12.2版及更高版本的帮助中没有提到选项-force,但似乎仍然有效,可以强制在非空目录中安装
显然18 c 32位安装程序不喜欢选项"INVENTORY_LOCATION=C:\Program Files (x86)\Oracle\Inventory",跳过此条目。使用"INVENTORY_LOCATION=C:\PROGRA~2\Oracle\Inventory"会导致c:\Program Files (x86)\Oracle\Inventory\locks\中的锁文件出现异常

更新

我在更新我们客户的资料。即使使用旧的安装程序,我也没有管理它来正确运行安装程序。我总是要使用响应文件,例如。

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


在命令行中指定组件不再起作用。
我无法运行32位Oracle Universal Installer 18 c-似乎是一个错误。由于这个版本是EOL同时,我没有进一步调查。

q9yhzks0

q9yhzks02#

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"

字符串
这对我很有效这将从Windows 10中的命令提示符安装Oracle Client Admin版本{就像我使用的那样}。感谢先前的帖子。

相关问题