天天看點

RHEL7.5 靜默安裝(silent mode)oracle11gr2資料庫軟體

如果沒有圖形界面多可怕,或者圖形界面安裝總報些奇怪的錯誤多可怕,靜默安裝資料庫軟體了解一下

修改主機名、關閉selinux

[root@localhost ~]$ sed -i '3,$d' /etc/hosts
[root@localhost ~]$ echo '192.168.168.4 bss.example.com bss'>>/etc/hosts
[root@localhost ~]$ cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.168.4 bss.example.com bss
[root@localhost ~]$ hostnamectl --static set-hostname bss
[root@localhost ~]$ hostnamectl status
   Static hostname: bss
Transient hostname: localhost.localdomain
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 3c685e4e6f024d48a6f44b144640319b
           Boot ID: 4aea7c4deb314fa28ef9907623354b6f
    Virtualization: vmware
  Operating System: Oracle Linux Server 7.7
       CPE OS Name: cpe:/o:oracle:linux:7:7:server
            Kernel: Linux 4.14.35-1902.3.2.el7uek.x86_64
      Architecture: x86-64                                                                                                                                       
[root@localhost ~]$ cat /etc/selinux/config |grep SELINUX=|grep -v ^#
SELINUX=disabled
[root@localhost ~]$ 
      

安裝環境準備工具

[root@bss ~]$ yum install oracle-rdbms-server-11gR2-preinstall
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
--> Running transaction check
---> Package oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-6.el7 will be installed

(many more lines suppressed)

Installed:
  oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-6.el7                                                                                                                                          

Dependency Installed:
  compat-libcap1.x86_64 0:1.10-7.el7        compat-libstdc++-33.x86_64 0:3.2.3-72.el7        cpp.x86_64 0:4.8.5-39.0.1.el7                    gcc.x86_64 0:4.8.5-39.0.1.el7                     
  gcc-c++.x86_64 0:4.8.5-39.0.1.el7         glibc-devel.x86_64 0:2.17-292.0.1.el7            glibc-headers.x86_64 0:2.17-292.0.1.el7          kernel-headers.x86_64 0:3.10.0-1062.4.3.el7       
  ksh.x86_64 0:20120801-139.0.1.el7         libaio-devel.x86_64 0:0.3.109-13.el7             libstdc++-devel.x86_64 0:4.8.5-39.0.1.el7       

Complete!
[root@bss ~]$ 
      

建立目錄

[root@bss ~]$ mkdir -p /u01/app/oracle/product/11.2.0.4/dbhome_1
[root@bss ~]$ mkdir -p /u01/app/oraInventory
[root@bss ~]$ chown -R oracle:oinstall /u01
[root@bss ~]$ chmod -R 775 /u01
      

上傳安裝媒體并解壓

建立目錄/stage/db然後上傳安裝媒體,切換到oracle使用者解壓

[oracle@bss ~]$ cd /stage/db
[oracle@bss /stage/db]$ unzip -q p13390677_112040_Linux-x86-64_1of7.zip -d ~
[oracle@bss /stage/db]$ unzip -q p13390677_112040_Linux-x86-64_2of7.zip -d ~
[oracle@bss /stage/db]$ cd
[oracle@bss ~]$ ls
database
[oracle@bss ~]$
      

靜默安裝資料庫軟體

[oracle@bss ~]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/dbhome_1
[oracle@bss ~]$ ~/database/runInstaller -silent -ignorePrereq -waitforcompletion -responseFile ~/database/response/db_install.rsp \
> oracle.install.option=INSTALL_DB_SWONLY \
> ORACLE_HOSTNAME=vps4 \
> UNIX_GROUP_NAME=oinstall \
> INVENTORY_LOCATION=/u01/app/oraInventory \
> SELECTED_LANGUAGES=en \
> ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/dbhome_1 \
> ORACLE_BASE=/u01/app/oracle \
> oracle.install.db.InstallEdition=EE \
> oracle.install.db.DBA_GROUP=dba \
> oracle.install.db.OPER_GROUP=oinstall \
> DECLINE_SECURITY_UPDATES=true \
> oracle.install.db.config.starterdb.type=GENERAL_PURPOSE \
> DECLINE_SECURITY_UPDATES=true
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 36684 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 3967 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2019-11-22_10-30-51AM. Please wait ...You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2019-11-22_10-30-51AM.log
The installation of Oracle Database 11g was successful.
Please check '/u01/app/oraInventory/logs/silentInstall2019-11-22_10-30-51AM.log' for more details.

As a root user, execute the following script(s):
        1. /u01/app/oraInventory/orainstRoot.sh
        2. /u01/app/oracle/product/11.2.0.4/dbhome_1/root.sh


Successfully Setup Software.
[oracle@bss ~]$ su - root
Password: 
Last login: Fri Nov 22 10:10:00 CST 2019 from 192.168.168.1 on pts/1
[root@bss ~]$ /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@bss ~]$ /u01/app/oracle/product/11.2.0.4/dbhome_1/root.sh
Check /u01/app/oracle/product/11.2.0.4/dbhome_1/install/root_bss_2019-11-22_10-33-54.log for the output of root script
[root@bss ~]$ 
      

靜默安裝的代碼

~/database/runInstaller -silent -ignorePrereq -waitforcompletion -responseFile ~/database/response/db_install.rsp \
oracle.install.option=INSTALL_DB_SWONLY \
ORACLE_HOSTNAME=vps4 \
UNIX_GROUP_NAME=oinstall \
INVENTORY_LOCATION=/u01/app/oraInventory \
SELECTED_LANGUAGES=en \
ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/dbhome_1 \
ORACLE_BASE=/u01/app/oracle \
oracle.install.db.InstallEdition=EE \
oracle.install.db.DBA_GROUP=dba \
oracle.install.db.OPER_GROUP=oinstall \
DECLINE_SECURITY_UPDATES=true \
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE \
DECLINE_SECURITY_UPDATES=true
      

響應檔案的解釋可以看看 https://blog.csdn.net/java3344520/article/details/8063785

ps:部署實施過程中,注意版本相容問題要先設定環境變量export CV_ASSUME_DISTID=RHEL7.6 、export CV_ASSUME_DISTID=OEL6等這個方式,具體值根據oracle官方的認證的作業系統來,沒認證過的作業系統最好不要用于生産,沒認證過的系統預設按照OEL4來檢測依賴包,是以各種包缺失錯誤出現

作者:九命貓幺

部落格出處:http://www.cnblogs.com/yongestcat/

歡迎轉載,轉載請标明出處。

如果你覺得本文還不錯,對你的學習帶來了些許幫助,請幫忙點選右下角的推薦

繼續閱讀