#free -h #检查是否存swap分区,oracle安装时需要存在swap分区
#systemctl status firewalld
一般选择临时关闭,防止服务器重启带来其他意外情况
临时关闭: #setenforce 0
查看状态: #sestatus -v
永久关闭: #vi /etc/selinux/config 将配置文件中的SELINUX=enforcing,改为SELINUX=disabled,重启系统。
视情况更改hostname,只要保证hostname能够识别到本机就好
如果该服务器只做oracle服务,可以把hostname改为oracle
#echo "oracle" > /etc/hostname
如果服务器是综合应用,保留当前hostname,保证hostname能识别本机
#echo "127.0.0.1 oracle" >> /etc/hosts
#yum install gcc gcc-c++ libaio-devel compat-gcc-34 compat-gcc-34-c++
本次安装时compat-gcc-34-c++ 缺少依赖 libstdc++ < 4.5.0,本机已经安装libstdc+±4.8.5。于是将compat-gcc-34-c++更新为compat-gcc-44-c++。
#vim /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 32903162
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
其中kernel.shmmax = 32903162 建议数值为服务器内存一半
#vim /etc/pam.d/login #在尾行增加如下内容
session required /lib64/security/pam_limits.so
session required pam_limits.so
#vim /etc/profile #在最后添加
export LIBXCB_ALLOW_SLOPPY_LOCK=true
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
#cat >> /etc/security/limits.conf <<EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
EOF
#groupadd oinstall
#groupadd dba
#useradd -g oinstall -G dba oracle #G和g不要搞反
id oracle #验证oracle的组归属
uid=1001(oracle) gid=1001(oinstall) groups=1001(oinstall),1002(dba)
mkdir -p /u01/app/oracle/product/11.2.0/db_1 # mkdir /u01/app/oraInventory # chown -R oracle:oinstall /u01 # chmod -R 755 /u01
cat >> /home/oracle/.bash_profile <<EOF
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.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
export PATH
EOF
3.1解压oracle安装包
#我的安装包目录在/home/oracle/database,要按照先后顺序进行解压
unzip ./linux.x64_11gR2_database_1of2.zip # unzip ./linux.x64_11gR2_database_2of2.zip
3.2修改应答文件
db_install.rsp:安装应答
dbca.rsp:创建数据库应答
netca.rsp:建立监听、本地服务名等网络设置的应答#
应答文件主要是在静默安装的时候,直接让程序读取配置项,不再进行图形化选择或者输入。以上分别为安装软件时配置文件、建库时配置文件、建立监听时配置文件
#cd /home/oracle/database/database/response
#cp db_install.rsp db_install.rsp.default
#vim db_install.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=oracle
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=false
#oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.2.0,oracle.oraolap:11.2.0.2.0,oracle.rdbms.dm:11.2.0.2.0,oracle.rdbms.dv:11.2.0.2.0,orcle.rdbms.lbac:11.2.0.2.0,oracle.rdbms.rat:11.2.0.2.0
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false
oracle.install.db.config.starterdb.automatedBackup.enable=false
DECLINE_SECURITY_UPDATES=true #忽略邮箱为空的选项
#cd /home/oracle/database/
#./runInstaller -silent -responseFile /home/oracle/database/database/response/db_install.rsp -ignorePrereq
#如果正常,会弹出log目录所在,可以tail -f /dir/*.log 查看进度。如果上述response文件设置不正常,根据log查询问题所在。
1. [oracle@oracle database]$ ./runInstaller -silent -responseFile /home/oracle/database/database/response/db_install.rsp -ignorePrereq
2. Starting Oracle Universal Installer...
3. Checking Temp space: must be greater than 120 MB. Actual 36511 MB Passed
4. Checking swap space: must be greater than 150 MB. Actual 2013 MB Passed
5. Preparing to launch Oracle Universal Installer from /tmp/OraInstall2019-12-16_02-28-38PM. Please wait ...[oracle@oracle database]$ You can find the log of this install session at:
6. /u01/app/oraInventory/logs/installActions2019-12-16_02-28-38PM.log
8. The following configuration scripts need to be executed as the "root" user.
9. #!/bin/sh
10. #Root scripts to run
11. /u01/app/oraInventory/orainstRoot.sh
12. /u01/app/oracle/product/11.2.0/db_1/root.sh
13. To execute the configuration scripts:
14. 1. Open a terminal window
15. 2. Log in as "root"
16. 3. Run the scripts
17. 4. Return to this window and hit "Enter" key to continue
18. Successfully Setup Software.
根据第10行提示,切换root账户,进入相应目录下执行两个shell文件。
默认情况下,执行如下静默安装命令即可配置监听文件。如果netca显示not command,到/bin/目录下执行。
#netca /silent /responsefile /home/oracle/database/database/response/netca.rsp
若没有报错会在$TNS_ADMIN 下生成 listener.ora 和 sqlnet.ora
lsnrctl start #启动监听 # netstat -ano|grep 1521 #端口已经开启,监听配置完毕
3.5静默建库
cp /home/oracledatabase/response/dbca.rsp /home/oracledatabase/response/dbca.rsp.default # vi etc/dbca.rsp
[GENERAL] #Genreal不要更改,
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
[CREATEDATABASE] #更改实际建库信息
GDBNAME = "dbsrv2"
SID = "dbsrv2"
TEMPLATENAME = "General_Purpose.dbc"
CHARACTERSET = "AL32UTF8"
#dbca -silent -responseFile etc/dbca.rsp #实例创建完成
现象:
SEVERE: Email Address Not Specified
INFO: Adding ExitStatus VAR_VALIDATION_FAILURE to the exit status set
WARNING: A log of this session is currently saved as: /tmp/OraInstall2010-01-20_05-33-57PM/installActions2010-01-20_05-33-57PM.log. Oracle recommends that if you want to keep this log, you should move it from the temporary location to a more permanent location.
INFO: Finding the most appropriate exit status for the current application
INFO: Exit Status is -2
INFO: Shutdown Oracle Database 11g Release 2 Installer
INFO: Unloading Setup Driver
解决方案:邮箱未指定,db_install.rsp应答文件加一个选项: DECLINE_SECURITY_UPDATES=true
(oraInventory) ownership is invalid
解决:设置具有写oraInventory权限的组
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/home/oracle/oraInventory
解决:不更改默认项一般不会出问题,设置如下选项或者恢复默认设置
oracle.install.db.config.starterdb.globalDBName=oracle.sunyard
解决: 配置Oracle存储方式
解决:密码不能带@
解决:将“User”的组设置清楚,是否归属dba和oinstall
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
信息加载中,请等待
微信客服(速回)
微信客服(慢回)