真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

rhel6.4自動安裝oracle11g客戶端


1、安裝過程

點(diǎn)擊(此處)折疊或打開

創(chuàng)新互聯(lián)公司秉承實(shí)現(xiàn)全網(wǎng)價值營銷的理念,以專業(yè)定制企業(yè)官網(wǎng),成都網(wǎng)站設(shè)計、做網(wǎng)站,微信小程序,網(wǎng)頁設(shè)計制作,手機(jī)網(wǎng)站制作,成都全網(wǎng)營銷幫助傳統(tǒng)企業(yè)實(shí)現(xiàn)“互聯(lián)網(wǎng)+”轉(zhuǎn)型升級專業(yè)定制企業(yè)官網(wǎng),公司注重人才、技術(shù)和管理,匯聚了一批優(yōu)秀的互聯(lián)網(wǎng)技術(shù)人才,對客戶都以感恩的心態(tài)奉獻(xiàn)自己的專業(yè)和所長。

  1. [root@localhost ~]# cd /tmp/client/
  2. [root@localhost client]# ll
  3. total 640676
  4. -rw-r--r--. 1 root root 5554 Dec 13 16:24 auto_install_oracle_client.sh #主腳本
  5. -rw-r--r--. 1 root root 12062 Dec 13 16:24 client_install.rsp #靜默安裝配置文件
  6. -rw-r--r--. 1 root root 656026876 Dec 13 16:22 p13390677_112040_Linux-x86-64_4of7.zip #安裝包
  7. [root@localhost client]# chmod u+x auto_install_oracle_client.sh #賦權(quán)
  8. [root@localhost client]# ./auto_install_oracle_client.sh #在文件所在路徑使用root用戶執(zhí)行
  9. tmp is.................................................... [ok] #檢查/tmp目錄,需要大于120 MB
  10. swap is.................................................... [ok] #檢查swap空間,需要大于150 MB
  11. finding sqlplus #通過find查找sqlplus,此處需要等待
  12. env is.................................................... [ok] #環(huán)境ok
  13. pkg is.................................................... [ok] #安裝包ok
  14. rsp is.................................................... [ok] #靜默安裝配置文件ok
  15. please input which user to install oracle client:oracle #可以是已經(jīng)存在的用戶,也可以是新用戶
  16. please input ip addr:192.168.1.222 #輸入該系統(tǒng)ip地址
  17. unziping p13390677_112040_Linux-x86-64_4of7.zip #正在解壓安裝包,此處需要等待
  18. starting install,may be take a minutes,you can see log:/tmp/install_client.log #需要等待
  19. starting orainstRoot.sh,you can see /tmp/orainstRoot.sh.log
  20. The execution of the script is complete.
  21. #######################################################################
  22. #########please use root to run /tmp/del_client.sh to deinstall####### #卸載腳本
  23. #########dba oinstall oracle need your check################### #若需要,用戶和組需手動刪除
  24. #######################################################################
2、驗(yàn)證過程

點(diǎn)擊(此處)折疊或打開

  1. [root@localhost client]# su - oracle
  2. [oracle@localhost ~]$ cd $ORACLE_HOME/network/admin/
  3. [oracle@localhost admin]$ vi tnsnames.ora
  4. [oracle@localhost admin]$ cat tnsnames.ora
  5. ORCL =
  6.     (DESCRIPTION =
  7.         (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.42)(PORT = 1521))
  8.         (CONNECT_DATA =
  9.             (SERVER = DEDICATED)
  10.             (SERVICE_NAME = orcl)
  11.         )
  12.      )
  13. [oracle@localhost admin]$ sqlplus scott/tiger@orcl
  14. SQL>
3、卸載過程(需根據(jù)實(shí)際需求手動刪除用戶組和用戶)

點(diǎn)擊(此處)折疊或打開

  1. [root@localhost client]# /tmp/del_client.sh
  2. [root@localhost client]# su - oracle
  3. [oracle@localhost ~]$ sqlplus
  4. -bash: sqlplus: command not found

auto_install_oracle_client.sh的內(nèi)容:

點(diǎn)擊(此處)折疊或打開

  1. #!/bin/bash
  2. #檢查/tmp空間
  3. if [ `df -m /tmp|wc -l` -eq 2 ];then
  4.     tmp=`df -m /tmp|tail -1|awk '{print $4}'`
  5. else
  6.     tmp=`df -m /tmp|tail -1|awk '{print $3}'`
  7. fi
  8. if [ $tmp -gt 120 ];then
  9.     echo "tmp is.................................................... [ok]"
  10. else
  11.     echo "[fail]====>/tmp must more than 120MB"
  12. exit 5
  13. fi
  14. #檢查swap空間
  15. if [ `free -m|grep Swap|awk '{print $2}'` -gt 150 ];then
  16.     echo "swap is.................................................... [ok]"
  17. else
  18.     echo "[fail]====>swap must more than 150MB"
  19. exit 5
  20. fi
  21. #檢查該主機(jī)是否已經(jīng)安裝了sqlplus
  22. echo "finding sqlplus"
  23. if [ `find / -name "sqlplus"|grep sqlplus|wc -l` -gt 0 ]
  24. then
  25.     echo "this system has installed oracle client.install process exit!"
  26.     echo "install process stop!"
  27.     exit 0
  28. else
  29.     echo "env is.................................................... [ok]"
  30. fi
  31. #檢查客戶端安裝包是否已經(jīng)上傳
  32. LOCALDIR=`pwd`
  33. if [ `ls -l $LOCALDIR|grep "p13390677_112040_Linux-x86-64_4of7.zip" |wc -l` -gt 0 ]
  34. then
  35.     echo "pkg is.................................................... [ok]"
  36. else
  37.     echo "please upload p13390677_112040_Linux-x86-64_4of7.zip in $LOCALDIR"
  38.     echo "install process stop!"
  39.     exit 0
  40. fi
  41. #檢查配置文件是否已經(jīng)上傳
  42. LOCALDIR=`pwd`
  43. if [ `ls -l $LOCALDIR|grep client_install.rsp|wc -l` -gt 0 ]
  44. then
  45.     echo "rsp is.................................................... [ok]"
  46. else
  47.     echo "please upload client_install.rsp in $LOCALDIR"
  48.     echo "install process stop!"
  49.     exit 0
  50. fi
  51. #獲取用戶名、ORACLE_BASE、ip地址信息
  52. echo -e "please input which user to install oracle client:\c"
  53. read USERNAME
  54. ORACLE_BASE=/home/$USERNAME/oracle_client
  55. echo -e "please input ip addr:\c"
  56. read ip_addr
  57. #備份和修改/etc/hosts文件
  58. cp /etc/hosts /etc/hosts_lihbbak
  59. echo "$ip_addr `hostname`">>/etc/hosts
  60. #備份oraInst.loc文件
  61. mv -f /etc/oraInst.loc /etc/oraInst.loc_lihbbak >/dev/null 2>&1
  62. #創(chuàng)建dba、oinstall用戶組,創(chuàng)建用戶
  63. /usr/sbin/groupadd dba >/dev/null 2>&1
  64. /usr/sbin/groupadd oinstall >/dev/null 2>&1
  65. /usr/sbin/useradd -m -g oinstall -G dba $USERNAME >/dev/null 2>&1
  66. #創(chuàng)建目錄并附權(quán)
  67. mkdir -p $ORACLE_BASE >/dev/null 2>&1
  68. cd $ORACLE_BASE
  69. mkdir oraInventory
  70. chown -R $USERNAME:oinstall $ORACLE_BASE
  71. #解壓安裝包并附權(quán)
  72. echo "unziping p13390677_112040_Linux-x86-64_4of7.zip"
  73. cd $LOCALDIR
  74. /usr/bin/unzip p13390677_112040_Linux-x86-64_4of7.zip >/dev/null 2>&1
  75. chown -R $USERNAME:oinstall client
  76. chown $USERNAME:oinstall client_install.rsp
  77. #備份并修改配置文件
  78. cp client_install.rsp client_install.rsp_lihbbak
  79. sed -i "s|/u01/app|$ORACLE_BASE|g" client_install.rsp
  80. #配置用戶環(huán)境并安裝軟件
  81. echo "starting install,may be take a minutes,you can see log:/tmp/install_client.log"
  82. su - $USERNAME
  83.     echo "export ORACLE_BASE=$ORACLE_BASE" >>/home/$USERNAME/.bash_profile
  84.     echo "export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0.4/client_1" >>/home/$USERNAME/.bash_profile
  85.     echo 'export PATH=\$ORACLE_HOME/bin:\$PATH' >>/home/$USERNAME/.bash_profile
  86.     echo 'export LD_LIBRARY_PATH=$ORACLE_BASE/oracle/product/11.2.0.4/client_1/lib' >>/home/$USERNAME/.bash_profile
  87.     source ~/.bash_profile >/dev/null 2>&1
  88.     cd $LOCALDIR/client
  89.     ./runInstaller -silent -showProgress -ignorePrereq -waitforcompletion -responseFile $LOCALDIR/client_install.rsp
  90. EOF
  91. #執(zhí)行root.sh腳本
  92. sleep 2s
  93. echo "starting orainstRoot.sh,you can see /tmp/orainstRoot.sh.log"
  94. $ORACLE_BASE/oraInventory/orainstRoot.sh >/tmp/orainstRoot.sh.log 2>&1
  95. tail -1 /tmp/orainstRoot.sh.log
  96. #修改ORACLE_HOME/bin的權(quán)限
  97. chmod 755 $ORACLE_BASE/oracle/product/11.2.0.4/client_1/bin/*
  98. #配置tnsnames.ora文件用于測試
  99. su - $USERNAME
  100.     source ~/.bash_profile
  101.     cd $ORACLE_BASE/oracle/product/11.2.0.4/client_1/network/admin
  102.     touch tnsnames.ora
  103.     echo 'ORATEST1 ='>>tnsnames.ora
  104.     echo ' (DESCRIPTION = ' >>tnsnames.ora
  105.     echo ' (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.75.249)(PORT = 1521)) ' >>tnsnames.ora
  106.     echo ' (CONNECT_DATA = ' >>tnsnames.ora
  107.     echo ' (SERVER = DEDICATED) ' >>tnsnames.ora
  108.     echo ' (SERVICE_NAME = oratest1) ' >>tnsnames.ora
  109.     echo ' ) ' >>tnsnames.ora
  110.     echo ' ) ' >>tnsnames.ora
  111. EOF
  112. #生成卸載腳本
  113. touch /tmp/del_client.sh >/dev/null 2>&1
  114. echo "#!/bin/bash" >/tmp/del_client.sh
  115. echo "cd $LOCALDIR" >>/tmp/del_client.sh
  116. echo 'rm -rf client' >>/tmp/del_client.sh
  117. echo 'mv -f /etc/hosts_lihbbak /etc/hosts >/dev/null 2>&1' >>/tmp/del_client.sh
  118. echo 'mv -f client_install.rsp_lihbbak client_install.rsp >/dev/null 2>&1' >>/tmp/del_client.sh
  119. echo "rm -rf $ORACLE_BASE" >>/tmp/del_client.sh
  120. echo "mv -f /etc/oraInst.loc_lihbbak /etc/oraInst.loc >/dev/null 2>&1 " >>/tmp/del_client.sh
  121. chmod u+x /tmp/del_client.sh
  122. echo '#########################################################################'
  123. echo '###########please use root to run /tmp/del_client.sh to deinstall#######'
  124. echo "###########dba oinstall $USERNAME need your check################"
  125. echo '#########################################################################'
client_install.rsp 的內(nèi)容:

點(diǎn)擊(此處)折疊或打開

  1. [root@localhost client]# cat client_install.rsp |grep -v ^# |grep -v ^$
  2. oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v11_2_0
  3. ORACLE_HOSTNAME=
  4. UNIX_GROUP_NAME=oinstall
  5. INVENTORY_LOCATION=/u01/app/oraInventory
  6. SELECTED_LANGUAGES=en
  7. ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/client_1
  8. ORACLE_BASE=/u01/app/oracle
  9. oracle.install.client.installType=Administrator
  10. oracle.install.client.upgrading=false
  11. oracle.install.client.customComponents="oracle.sqlj:11.2.0.4.0","oracle.rdbms.util:11.2.0.4.0","oracle.javavm.client:11.2.0.4.0","oracle.sqlplus:11.2.0.4.0","oracle.dbjava.jdbc:11.2.0.4.0","oracle.ldap.client:11.2.0.4.0","oracle.rdbms.oci:11.2.0.4.0","oracle.precomp:11.2.0.4.0","oracle.xdk:11.2.0.4.0","oracle.network.aso:11.2.0.4.0","oracle.assistants.oemlt:11.2.0.4.0","oracle.oraolap.mgmt:11.2.0.4.0","oracle.network.client:11.2.0.4.0","oracle.network.cman:11.2.0.4.0","oracle.network.listener:11.2.0.4.0","oracle.ordim.client:11.2.0.4.0","oracle.odbc:11.2.0.4.0","oracle.has.client:11.2.0.4.0","oracle.dbdev:11.2.0.4.0","oracle.rdbms.scheduler:11.2.0.4.0"
  12. oracle.install.client.schedulerAgentHostName=
  13. oracle.install.client.schedulerAgentPortNumber=
  14. oracle.installer.autoupdates.option=SKIP_UPDATES
  15. oracle.installer.autoupdates.downloadUpdatesLoc=
  16. AUTOUPDATES_MYORACLESUPPORT_USERNAME=
  17. AUTOUPDATES_MYORACLESUPPORT_PASSWORD=
  18. PROXY_HOST=
  19. PROXY_PORT=
  20. PROXY_USER=
  21. PROXY_PWD=
  22. PROXY_REALM=







網(wǎng)站標(biāo)題:rhel6.4自動安裝oracle11g客戶端
文章來源:http://weahome.cn/article/geispd.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部