您好,登錄后才能下訂單哦!
這篇文章主要為大家展示了“VMware下CentOS靜默安裝oracle12.2的方法”,內容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領大家一起研究并學習一下“VMware下CentOS靜默安裝oracle12.2的方法”這篇文章吧。
環境準備:
VMware+CentOS,jdk
一、校驗系統磁盤大小
1.命令 df -h
保證可用磁盤大小15GB(包括oracle安裝時需要空間7.5GB + oracle安裝zip包接近3G+安裝包解壓文件3G)
如果磁盤不滿足,安裝會失敗,需要擴容!
二、安裝準備
1.創建運行oracle數據庫的系統用戶和用戶組
groupadd oinstall groupadd dba useradd -g oinstall -g dba -m oracle
passwd oracle #不用管提示,連續輸入兩次密碼就可成功
2.創建oracle數據庫安裝目錄,并將目錄賦權給oracle用戶
mkdir -p /opt/oracle/database #oracle安裝包解壓的文件 mkdir -p /opt/oracle/product/oraInventory # mkdir -p /opt/oracle/product/12.2.0/db_1 #oracle安裝目錄 chown -R oracle:oinstall /opt/oracle #更改oracle目錄的屬主 chmod 755 -R /opt/oracle #更改oracle目錄的權限
3.安裝oracle數據庫依賴的軟件包
3.1.安裝
yum -y install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio-devel libaio libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel pdksh numactl-devel glibc-headers
3.2.查看是否安裝成功
rpm -q \binutils \compat-libstdc++-33 \elfutils-libelf \elfutils-libelf-devel \expat \gcc \gcc-c++ \glibc \glibc-common \glibc-devel \glibc-headers \libaio \libaio-devel \libgcc \libstdc++ \libstdc++-devel \make \pdksh \sysstat \unixODBC \unixODBC-devel | grep "not installed"
4.關閉selinux,需要重啟生效(可以在最后安裝oracle之前再重啟) vim /etc/selinux/config
5.修改內核參數 vim /etc/sysctl.conf
添加如下內容:
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.rp_filter = 1
fs.file-max = 6815744
fs.aio-max-nr = 1048576
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max= 4194304
net.core.wmem_default= 262144
net.core.wmem_max= 1048576
sysctl -p #使配置生效
6.對oracle用戶設置限制,提高系統運行性能
vim /etc/security/limits.conf
添加如下內容:
oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536
7.配置用戶環境變量
vim /home/oracle/.bash_profile
添加如下內容:
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1
export ORACLE_SID=orcl
export ORACLE_TERM=xterm
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export LANG=C
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
source /home/oracle/.bash_profile #使配置失效
8.解壓oracle安裝文件的壓縮包,在/opt/oracle/目錄下解壓
unzip 文件名(unzip不存在,可用命令進行安裝: yum install unzip)加壓較慢,需要等會
9.配置應答文件
vim /opt/oracle/database/response/db_install.rsp
10.配置oraInventory目錄位置
存放oracle軟件安裝的目錄信息,oracle的安裝和升級都需要用到這個目錄(最好放在ORACLE_BASE對應的目錄下邊)
vim /etc/oraInst.loc
添加或修改成如下內容:
inventory_loc=/opt/oracle/product/oraInventory
inst_group=oinstall
11.重啟CentOS,reboot
12.關閉防火墻,systemctl stop firewalld
三、靜默安裝Oracle12
1.已oracle用戶登陸linux系統
2.靜默安裝
/opt/oracle/database/runInstaller -silent -force -ignorePrereq -responseFile /opt/oracle/database/response/db_install.rsp
執行過程需要等待幾分鐘。
可監控日志:
tail -f /opt/oracle/product/oraInventory/logs/installActions2018-11-22_11-04-03AM.log
3.切換root用戶登陸
4.執行兩個sh文件
4.1. sh /opt/oracle/product/oraInventory/orainstRoot.sh
如果目錄下沒有改腳本,可以新建一個,腳本內容為:
# cat /oracle/oraInventory/orainstRoot.sh #!/bin/sh AWK=/bin/awk CHMOD=/bin/chmod CHGRP=/bin/chgrp CP=/bin/cp ECHO=/bin/echo MKDIR=/bin/mkdir RUID=`/usr/bin/id|$AWK -F ′ print$2 ′ |$AWK?F ′print$2′|$AWK?F '{print $2}'|$AWK -F '{print $1}'` if [ ${RUID} != "root" ];then $ECHO "This script must be executed as root" exit 1 fi if [ -d "/etc" ]; then $CHMOD 755 /etc; else $MKDIR -p /etc; fi if [ -f "/oracle/oraInventory/oraInst.loc" ]; then $CP /oracle/oraInventory/oraInst.loc /etc/oraInst.loc; $CHMOD 644 /etc/oraInst.loc else INVPTR=/etc/oraInst.loc INVLOC=/oracle/oraInventory GRP=oinstall PTRDIR="`dirname $INVPTR`"; # Create the software inventory location pointer file if [ ! -d "$PTRDIR" ]; then $MKDIR -p $PTRDIR; fi $ECHO "Creating the Oracle inventory pointer file ($INVPTR)"; $ECHO inventory_loc=$INVLOC > $INVPTR $ECHO inst_group=$GRP >> $INVPTR chmod 644 $INVPTR # Create the inventory directory if it doesn't exist if [ ! -d "$INVLOC" ];then $ECHO "Creating the Oracle inventory directory ($INVLOC)"; $MKDIR -p $INVLOC; fi fi $ECHO "Changing permissions of /oracle/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world. "; $CHMOD -R g+rw,o-rwx /oracle/oraInventory; if [ $? != 0 ]; then $ECHO "OUI-35086:WARNING: chmod of /oracle/oraInventory Adding read,write permissions for group. ,Removing read,write,execute permissions for world. failed!"; fi $ECHO "Changing groupname of /oracle/oraInventory to oinstall."; $CHGRP -R oinstall /oracle/oraInventory; if [ $? != 0 ]; then $ECHO "OUI-10057:WARNING: chgrp of /oracle/oraInventory to oinstall failed!"; fi $ECHO "The execution of the script is complete."
4.2. sh /opt/oracle/product/12.2.0/db_1/root.sh
5.切換oracle用戶登陸
6.安裝監聽
$ORACLE_HOME/bin/netca /silent /responseFile /opt/oracle/database/response/netca.rsp
7.啟動監聽程序
lsnrctl start
8.查看監聽狀態
lsnrctl status
9.通過dbca創建數據庫
/opt/oracle/product/12.2.0/db_1/bin/dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname orcl -sid orcl -responseFile NO_VALUE -characterSet ZHS16GBK -memoryPercentage 30 -emConfiguration LOCAL
(刪除:dbca -silent -deleteDatabase -sourcedb orcl -sid orcl)
10.啟動實例(創建完,一般會自動啟動)
sqlplus / as sysdba SQL> startup SQL> select instance_name,version from v$instance;
查看數據庫文件dbf
SQL> select name from v$datafile;
以上是“VMware下CentOS靜默安裝oracle12.2的方法”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。