之前在網上看了很多Oracle的靜默安裝教程,感覺有些亂,經過自己查閱Oracle官網英文手冊,結合在虛擬機中安裝測試,整理出了這篇RedHat 7 靜默安裝Oracle 12c。redhat 6靜默安裝Oracle 11g R2也已基本整理好了,等有時間了再發出來。
本文原始出處:江健龍的技術博客/content/11021015.html
一、環境要求與准備1、硬件要求(1)磁盤空間EnterpriseEdition : 6.4GBStandardEdition : 6.1GB1 GB of space inthe /tmp directory on your Linux system. (2)RAMMinimum: 1 GB of RAMRecommended: 2 GB ofRAM or more (3)SWAPRAM Swap SpaceBetween 1 GB and 2 GB ――1.5 times the size of the RAMBetween2 GB and 16 GB ――Equal to the size of the RAMMorethan 16 GB ――16 GB
2、軟件要求(1)操作系統■Supported OracleLinux 7 and Red Hat Enterprise Linux 7 Distributions for x86-64■ Supported OracleLinux 6 and Red Hat Enterprise Linux 6 Distributions for x86-64■ Supported OracleLinux 5 and Red Hat Enterprise Linux 5 Distributions for x86-64■ Supported SUSEDistributions for x86-64Starting with Oracle Database 12c Release 1 (12.1.0.2), Red HatEnterprise Linux 7 (3.10.0-54.0.1.el7.x86_64)are supported on Linuxx86-64 systems.
(2)RPM包要求forRH7binutils-2.23.52.0.1-12.el7.x86_64compat-libcap1-1.10-3.el7.x86_64compat-libstdc++-33-3.2.3-71.el7.i686(需另外下載)compat-libstdc++-33-3.2.3-71.el7.x86_64(需另外下載)gcc-4.8.2-3.el7.x86_64gcc-c++-4.8.2-3.el7.x86_64glibc-2.17-36.el7.i686glibc-2.17-36.el7.x86_64glibc-devel-2.17-36.el7.i686glibc-devel-2.17-36.el7.x86_64kshlibaio-0.3.109-9.el7.i686libaio-0.3.109-9.el7.x86_64libaio-devel-0.3.109-9.el7.i686libaio-devel-0.3.109-9.el7.x86_64libgcc-4.8.2-3.el7.i686libgcc-4.8.2-3.el7.x86_64libstdc++-4.8.2-3.el7.i686libstdc++-4.8.2-3.el7.x86_64libstdc++-devel-4.8.2-3.el7.i686libstdc++-devel-4.8.2-3.el7.x86_64libXi-1.7.2-1.el7.i686libXi-1.7.2-1.el7.x86_64libXtst-1.2.2-1.el7.i686libXtst-1.2.2-1.el7.x86_64make-3.82-19.el7.x86_64sysstat-10.1.5-1.el7.x86_64unixODBC-2.3.1 orlater
3、設置域名解析 4、關閉Transparent HugePages使用root登錄查看:
cat /sys/kernel/mm/redhat_transparent_hugepage/enabled關閉方法:官方推薦關閉,但Redhat 7我還未找到關閉方法,但也不影響安裝
5、創建用戶和組Thefollowing local operating system groups and users are required if you areinstalling Oracle Database:■ The OracleInventory group (typically, oinstall )■ The OSDBA group(typically, dba )■ The Oraclesoftware owner (typically, oracle )■ The OSOPER group(optional. Typically, oper )
# grep dba/etc/group# id oracleIf the oracle user exists:
# /usr/sbin/usermod-g oinstall -G dba oracleIf the oracle user does not exist:
# /usr/sbin/useradd-g oinstall -G dba oracleset the password:
# passwd oracle6、創建安裝目錄Oracle_Base目錄:/u01/app/oracle/Oracle_Home目錄:/u01/app/oracle/12cOracle清單目錄:/u01/app/oracle/oraInventory
7、設置資源限制查看方式:
$ ulimit -Sn1024
$ ulimit -Hn65536
$ ulimit -Su2047
$ ulimit -Hu16384
$ ulimit -Ss10240
$ ulimit -Hs32768修改方法:
vi /etc/security/limits.conf,加上以下內容:
oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536oracle hard stack 32768oracle soft stack 10240
注:如果Oracle已登錄,必須先登出後再次登錄才生效
8、配置Oracle用戶環境變量vi /home/oracle/.bash_profile,加上以下內容,標橙色的部分需要根據自己實際進行修改export EDITOR=viexport ORACLE_SID=orclexport ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/12cexport nls_date_format="yyyy-mm-dd hh24:mi:ss"export PATH=/u01/app/oracle/12c/bin:$PATH
9、配置內核參數Note:If the current value for any parameter is greater than the valuelisted in this table, then the Fixupscripts do not change the value of that parameter.查看方式:
修改方式:
vi /etc/sysctl.conf,修改或增加以下內容:fs.aio-max-nr =1048576fs.file-max =6815744kernel.shmall =2097152kernel.shmmax =4294967295kernel.shmmni = 4096kernel.sem = 25032000 100 128net.ipv4.ip_local_port_range= 9000 65500net.core.rmem_default= 262144net.core.rmem_max =4194304net.core.wmem_default= 262144net.core.wmem_max =1048576最好reboot一下,不然有的參數不生效
10、編輯/etc/profilevi /etc/profile末尾加入if [ $USER ="oracle" ]; then if [ $SHELL = "/bin/ksh" ]; thenulimit-p 16384ulimit-n 65536elseulimit-u 16384 -n 65536fifi
二、靜默安裝Oracle software1、編輯應答文件db_install.rspOracle安裝介質中有應答文件,復制一份出來進行修改,更改以下內容,標橙色部分需要根據自己實際修改,應答文件中的其他內容不需要改,Oracle版本:12.1.0.2本文原始出處:江健龍的技術博客/content/11021015.html
oracle.install.option=INSTALL_DB_SWONLYORACLE_HOSTNAME=rh7UNIX_GROUP_NAME=oinstallINVENTORY_LOCATION=/u01/app/oraInventorySELECTED_LANGUAGES=en,zh_CNORACLE_HOME=/u01/app/oracle/12cORACLE_BASE=/u01/app/oracleoracle.install.db.InstallEdition=EEoracle.install.db.DBA_GROUP=dbaoracle.install.db.OPER_GROUP=oinstalloracle.install.db.BACKUPDBA_GROUP=dbaoracle.install.db.DGDBA_GROUP=dbaoracle.install.db.KMDBA_GROUP=dbaDECLINE_SECURITY_UPDATES=true
2、執行靜默安裝命令[oracle@rh7
database]$ ./runInstaller -silent -ignorePrereq -responseFile
/oracle12czip/db_install.rsp 3、完成安裝後使用root登錄執行腳本4、配置監聽復制一份安裝介質中的應答文件netca.rsp,無需修改,直接靜默執行即可[oracle@rh7
oracle12czip]$ netca -silent -responseFile /oracle12czip/netca.rsp
三、靜默安裝數據庫1、編輯應答文件dbca.rspOracle安裝介質中有應答文件dbca.rsp,復制一份出來進行修改,更改以下內容,標橙色部分需要根據自己實際修改,應答文件中的其他內容不需要改[GENERAL]RESPONSEFILE_VERSION
= "12.1.0"OPERATION_TYPE =
"createDatabase"[CREATEDATABASE]GDBNAME ="orcl"SID =
"orcl"TEMPLATENAME =
"General_Purpose.dbc"SYSPASSWORD ="p@ssw0rd"SYSTEMPASSWORD ="p@ssw0rd"EMCONFIGURATION ="DBEXPRESS"EMEXPRESSPORT = "5520" #(指定該參數安裝後未生效,仍是默認的5500)DBSNMPPASSWORD ="p@ssw0rd"STORAGETYPE="FS"CHARACTERSET =
"ZHS16GBK"NATIONALCHARACTERSET=
"AL16UTF16"MEMORYPERCENTAGE ="40"TOTALMEMORY ="1024"
2、執行靜默安裝命令 $dbca -silent
-responseFile /oracle12czip/dbca.rsp四、安裝完成後檢查1、檢查監聽狀態:$ lsnrctl status2、檢查Oracle進程:]$ ps -ef
|grep ora_ |grep -v grep3、登錄Oracle數據庫SQL> select name
from V$database;SQL>
select instance_name from V$instance;SQL>
select name from V$datafile;SQL> select userenv('language') from dual;SQL> select *
from product_component_version;SQL>
show parameter background_dump_dest;4、登錄EMOracle 12c至此已在redhat 7上靜默安裝完成了,可以創建表空間、創建用戶去使用了。
本文出自 “江健龍的技術博客” 博客,請務必保留此出處/content/11021015.html