Oracle 静默安装oracle client

静默安装oracle clint比较简单,修改instantclient.crsp文件的几个位置即可

[root@localhost ~]# vi /etc/oralnstloc

inventory_loc=/u01/app/oralnventory/
inst_group=oinstall
[root@localhost ~]# chmod 664 /etc/oralnstloc
2 修改rsp文件
[oracle@localhost response]$ pwd
/u01/oracle/client/response
[oracle@localhost response]$ ls
clientadmin.rsp clientcustom.rsp clientruntime.rsp instantClient.rsp
[oracle@localhost response]$ vi instantClient.rsp
UNIX_GROUP_NAME=oinstall
ORACLE_HOME=/u01/app/oracle/product/10.2.0/client
ORACLE_HOME_NAME=OraClient10ghome1
SELECTED_LANGUAGES=en
INSTALL_TYPE="Administrator"

----11.2.0.client
[oracle@oracle12c client]$ ./runInstaller -silent -noconfig -responseFile /u01/oracleware/client/response/client_install.rsp
ORACLE_HOSTNAME=oracle12c
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/u01/app/oracle/product/11.2.0/client_1
ORACLE_BASE=/u01/app/oracle
oracle.install.client.installType=Administrator
------11.2.0.client
[oracle@localhost client]$ ./runInstaller -silent-responseFile /u01/oracle/client/response/instantClient.rsp
[root@localhost ~]# vi /etc/oralnstloc
inventory_loc=/u01/app/oracle/oraInventory
inst_group=oinstall
[root@localhost ~]# mv /etc/oralnstloc /etc/oralnst.loc

[oracle@localhost client]$ more /etc/oralnst.loc
inventory_loc=/u01/app/oracle/oraInventory
inst_group=oinstall

[oracle@localhost response]$ vi clientadmin.rsp
./runInstaller -silent -noconfig -responseFile /u01/app/software/client/response/clientadmin.rsp
---UNIX_GROUP_NAME="oinstall"?ORACLE_HOME="/u01/app/oracle/product/10.2.0/client_1"?ORACLE_HOME_NAME="OraClient10g"

./runInstaller -silent -noconfig -responseFile /u01/oracle/client/response/clientruntime.rsp UNIX_GROUP_NAME="oinstall"?ORACLE_HOME="/u01/app/oracle/product/10.2.0/client_1"?ORACLE_HOME_NAME="OraClient10g"
[oracle@localhost client]$ ./runInstaller -silent -noconfig -responseFile /u01/oracle/client/response/clientadmin.rsp
./runInstaller: line 13: dirname: command not found
WARNING:The following configuration scripts
/u01/app/oracle/product/10.2.0/client_1/root.sh


dev.gnum.com
----------------
oracle@ip-10-134-31-19:~$ cd /u01/app/oracle/oraInventory/logs/
oracle@ip-10-134-31-19:/u01/app/oracle/oraInventory/logs$ ll
total 568
drwxr-x--- 2 oracle oinstall 4096 Nov 4 08:51 ./
drwxr-xr-x 6 oracle oinstall 4096 Nov 4 08:53 ../
-rw-r--r-- 1 oracle oinstall 6511 Jun 18 2012 installActions2012-06-18_03-54-00AM.log
-rw-r----- 1 oracle oinstall 152710 Jun 20 2012 installActions2012-06-18_04-02-23AM.log
-rw-r----- 1 oracle oinstall 387892 Nov 4 08:54 installActions2014-11-04_08-44-50AM.log
-rw-r----- 1 oracle oinstall 2310 Jun 18 2012 oraInstall2012-06-18_04-02-23AM.err
-rw-r----- 1 oracle oinstall 0 Jun 18 2012 oraInstall2012-06-18_04-02-23AM.out
-rw-r----- 1 oracle oinstall 935 Nov 4 08:45 oraInstall2014-11-04_08-44-50AM.err
-rw-r----- 1 oracle oinstall 7180 Nov 4 08:54 oraInstall2014-11-04_08-44-50AM.out
-rw-r----- 1 oracle oinstall 728 Nov 4 08:54 silentInstall2014-11-04_08-44-50AM.log
oracle@ip-10-134-31-19:/u01/app/oracle/oraInventory/logs$ more silentInstall2014-11-04_08-44-50AM.log
silentInstall2014-11-04_08-44-50AM.log
Error in invoking target 'install' of makefile '/u01/app/oracle/product/10.2.0/client_1/sqlplus/lib/ins_sqlplus.mk'
. See '/u01/app/oracle/oraInventory/logs/installActions2014-11-04_08-44-50AM.log' for details.
WARNING:The following configuration scripts
/u01/app/oracle/product/10.2.0/client_1/root.sh
need to be executed as root for configuring the system. If you skip the execution of the configuration tools, the c
onfiguration will not be complete and the product wont function properly. In order to get the product to function p
roperly, you will be required to execute the scripts and the configuration tools after exiting the OUI.

The installation of Oracle Client was successful.
oracle@ip-10-134-31-19:/u01/app/oracle/oraInventory/logs$ su -
Password:
root@ip-10-134-31-19:~# cd /u01/app/oracle/product/10.2.0/client_1
root@ip-10-134-31-19:/u01/app/oracle/product/10.2.0/client_1# ./root.sh

=========20200428

 有朋友问到出错误,我这里完全验证了一次,随便找了一台nginx的centos 6.4的机器

[root@localhost home]# rz -E
rz waiting to receive.
[root@localhost home]# setenforce 0
setenforce: SELinux is disabled
[root@localhost home]# service iptables stop
[root@localhost home]# cat >> /etc/pam.d/login << EOF
> session required pam_limits.so
> EOF
[root@localhost home]# cat >> /etc/security/limits.conf << EOF
> oracle soft nproc 2047 
> oracle hard nproc 16384 
> oracle soft nofile 1024 
> oracle hard nofile 65536
> EOF
[root@localhost home]# cat >> /etc/profile << EOF
> if [ $USER = "oracle" ] ; then
> if [ $SHELL = "/bin/ksh" ]; then
> ulimit -p 16384
> ulimit -n 65536
> else
> ulimit -u 16384 -n 65536
> fi
> umask 022
> fi
> EOF
[root@localhost home]# /usr/sbin/groupadd oinstall
[root@localhost home]# /usr/sbin/groupadd dba
[root@localhost home]# /usr/sbin/useradd -g oinstall -G dba oracle
[root@localhost home]# yum install gcc gcc-c++  libaio* glibc* glibc-devel* ksh libgcc* libstdc++* libstdc++-devel* make sysstat  \
> unixODBC* compat-libstdc++-33.x86_64 elfutils-libelf-devel  glibc.i686 compat-libcap1  smartmontools unzip openssh* parted cvuqdisk -y
Loaded plugins: fastestmirror, product-id, refresh-packagekit, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscripti
[root@localhost home]# mkdir -p /u01/app/oracle
[root@localhost home]# chown oracle:oinstall /u01/app/oracle
[root@localhost home]# chmod -R 775 /u01/
[root@localhost home]# vim /etc/oraInst.loc
[root@localhost home]# mkdir -p /u01/app/oraInventory
[root@localhost home]# chown -R oracle:oinstall /u01/app/oraInventory/
[root@localhost home]# chmod 664 /etc/oraInst.loc 
[root@localhost home]# ll /etc/oraInst.loc 
-rw-rw-r-- 1 root root 56 Apr 28 05:20 /etc/oraInst.loc
[root@localhost home]# unzip linux.x64_11gR2_client.zip
[root@localhost home]# hostname
localhost.localdomain
[root@localhost home]# echo "ip nginx1" >>/etc/hosts
[root@localhost home]# vim /etc/sysconfig/network
[root@localhost client]# cd response/
[root@localhost response]# ll
total 20
-rw-rw-r-- 1 root root 8591 Aug 15  2009 client_install.rsp
-rwxrwxr-x 1 root root 5740 Feb 26  2009 netca.rsp
[root@localhost response]# cp client_install.rsp client_install.rsp.bk
[root@localhost response]# cat client_install.rsp |grep -v "#"|grep -v "^$"
oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v11_2_0
ORACLE_HOSTNAME=nginx1
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/u01/app/oracle/product/11.2.0/client_1
ORACLE_BASE=/u01/app/oracle
oracle.install.client.installType=Administrator
[oracle@nginx1 client]$ ./runInstaller -silent -noconfig -responseFile /home/client/response/client_install.rsp
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 44382 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 5983 MB    Passed
[oracle@nginx1 client]$ [WARNING] [INS-13014] Target environment do not meet some optional requirements.
   CAUSE: Some of the optional prerequisites are not met. See logs for details. /u01/app/oraInventory/logs/installActions2020-04-28_05-33-00AM.log
   ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oraInventory/logs/installActions2020-04-28_05-33-00AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
[WARNING] [INS-13014] Target environment do not meet some optional requirements.
   CAUSE: Some of the optional prerequisites are not met. See logs for details. /u01/app/oraInventory/logs/installActions2020-04-28_05-33-00AM.log
   ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oraInventory/logs/installActions2020-04-28_05-33-00AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2020-04-28_05-33-00AM.log
[WARNING] [INS-13014] Target environment do not meet some optional requirements.
   CAUSE: Some of the optional prerequisites are not met. See logs for details. /u01/app/oraInventory/logs/installActions2020-04-28_05-33-00AM.log
   ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oraInventory/logs/installActions2020-04-28_05-33-00AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
^C
[oracle@nginx1 client]$ ll /home/client/response/client_install.rsp
-rw-rw-r-- 1 root root 8701 Apr 28 05:29 /home/client/response/client_install.rsp
[oracle@nginx1 client]$ hostname
nginx1
[oracle@nginx1 client]$ The following configuration scripts need to be executed as the "root" user. 
 #!/bin/sh 
 #Root scripts to run

/u01/app/oracle/product/11.2.0/client_1/root.sh
To execute the configuration scripts:
     1. Open a terminal window 
     2. Log in as "root" 
     3. Run the scripts 
     4. Return to this window and hit "Enter" key to continue 

Configuration assistants have not been run. This can happen for following reasons - either root.sh is to be run before config or Oracle Universal Installer was invoked with the -noConfig option.
"/u01/app/oracle/product/11.2.0/client_1/cfgtoollogs/configToolAllCommands" script contains all commands to be executed by the configuration assistants. This file may be used to run the configuration assistants outside of OUI. Note that you may have to update this script with passwords (if any) before executing the same.


Successfully Setup Software.
[root@nginx1 ~]# /u01/app/oracle/product/11.2.0/client_1/root.sh
Check /u01/app/oracle/product/11.2.0/client_1/install/root_nginx1_2020-04-28_05-35-39.log for the output of root script

[oracle@nginx1 client]$ ll /u01/app/oracle/product/11.2.0/client_1/bin/
Display all 190 possibilities? (y or n)
[oracle@nginx1 client]$ ll /u01/app/oracle/product/11.2.0/client_1/bin/

[oracle@nginx1 client]$ ll /u01/app/oracle/product/11.2.0/client_1/bin/netca
-rwxr-xr-x 1 oracle oinstall 6490 Apr 28 05:34 /u01/app/oracle/product/11.2.0/client_1/bin/netca

 

posted @ 2018-11-12 15:04  春困秋乏夏打盹  阅读(2122)  评论(5编辑  收藏  举报